Тёмный

Woocommerce How To Change Add To Cart Button Text 

Mr Web
Подписаться 53 тыс.
Просмотров 48 тыс.
50% 1

Woocommerce How To Change Add To Cart Button Text
FREE no premium plugin required.
Easy in just 2 steps.
1_Add the free plugin called Code Snippet
2_Insert the code below
Enjoy!
// Code Start
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' ); // Replace "By Now" text with your own text
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' ); // Replace "By Now" text with your own text
}
// Code End
------------------------------------------------------------------------
✅ NEED HOSTING ?
▶ Get Hosting Here 👉 mrweb.tv/hosting
This is a co-branded page that I have with Hostinger, Which means that I've negotiated special terms for my viewers and subscribers.
Enjoy up to 91% Discount + Promo Code 'MRWEBREVIEWS' for an extra 7% Discount
------------------------------------------------------------------------
✅ HIRE US --- NEED HELP WITH A NEW ONLINE PROJECT
▶ Do you need a new website?
▶ Do you need a custom-built project?
▶ Have an idea for a new website that requires custom development?
NO PROBLEMS... Our team of dedicated web developers would be delighted to help you with that
▶▶▶ Visit👉 mrweb.tv
------------------------------------------------------------------------
✅ LET'S CONNECT
▶ Twitter: / mrwebreviews
Feel free to follow me on Twitter as well
#MrWebReviews #Wordpress #Tutorials
▶ D I S C L A I M E R:
This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps support the channel and allows us to continue to make videos like this. Thank you for the support! Everything in this video is based on experience, information we learned from online resources and tests that we've run. Please do your own research before making any important decisions. You and only you are responsible for any and all digital marketing decisions you make.
Background Music: Produced by Danya Vodovoz
• London Lounge - Royalt...
Royalty Free Music

Опубликовано:

 

21 янв 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 134   
@graduardo
@graduardo 3 года назад
Thank you very much. I knew your code would work once I started your video. Tried multiple before and none worked :) Now I will search for change button color. All the best
@Mr_Web
@Mr_Web 3 года назад
Thanks, that's very kind of you 👍
@bosscetak
@bosscetak 2 года назад
to change button color just simply custom css , if you using elementor started with .selector .(class) { background : Black ( or your color ) ; } or you want to add some round button just simply add property border-radius: ... px;
@KBlakK
@KBlakK Год назад
Thanks so much for this!!! Great presentation, and I've been looking for this solution for a long time!!!
@katharinabeer
@katharinabeer 9 месяцев назад
Hi, do you have a tip as well, on how to change the link of the shop buttons and their text (as mine have different texts for some reason..or can I in that case use this method here as well?). The first button displayed links directly to the cart, the next buttons (button text "read further") link to the individual product pages.. Thank you for your help!
@vrobel.r
@vrobel.r Год назад
Thank You so much. I was so hopples. And You gave me the solution 👏
@DPsUniqueVibes
@DPsUniqueVibes 2 года назад
Thank you so much sir I was stuck with some of my buttons saying learn more and buy now😩 I didn’t know what to do😊🌺Thank You so much!
@swetha2584
@swetha2584 2 года назад
Hi, When I click add to cart, a kind of animation occurs and view cart link is display next to the add to cart, is it possible to edit the look of the view cart link and also change the onclick animation of add to cart button, I have been trying for an entire day but couldn't come up with a solution. Any hint / idea would be of great help ! Thanks
@RodrigoLima-lz8do
@RodrigoLima-lz8do Год назад
Thank you so much, this video was very helpful
@djagemenona.k.aagieh
@djagemenona.k.aagieh Год назад
That was Wonderful. It saved me alot of data and time. A lot of dead end solutions on the web from Phishers on an Expedition. Bless you
@MohamedGamal-ly3hd
@MohamedGamal-ly3hd Год назад
Thank you so much, if i want to change pay for order button in plugin WooCommerce MPGS please?
@antiquedealer6101
@antiquedealer6101 2 года назад
Thank you!! this was so fast and easy, I like your tutorial style
@Mr_Web
@Mr_Web 2 года назад
Glad it was helpful!
@heeebeeegeeebeee
@heeebeeegeeebeee Год назад
Very helpful, thanks!
@pinkbalem
@pinkbalem Месяц назад
I need a way to change the text of the coupon code that says "Apply". How can I reference to this button when using a code snippet???
@dragon3602010
@dragon3602010 2 года назад
Great and how did you manage to put the add to cart button on in the listing page ? Is it possible with Divi
@amirkhan-rq9xo
@amirkhan-rq9xo 2 года назад
Thank you so much for great learning video!!! Keep doing great work!!!
@Mr_Web
@Mr_Web 2 года назад
Thanks 🙏
@techikbal
@techikbal 3 месяца назад
thank you soooooo much
@rajart6788
@rajart6788 2 года назад
Excellent one. I did it within 2 mins after seeing your video instructions.. Thanks a lot.
@Mr_Web
@Mr_Web 2 года назад
Great job!
@mrjixter
@mrjixter Год назад
what if I want to add a "view product" button on the product listing page and when someone clicks the view product button then I will show the buy now/add to cart button?
@fairiesareallaround9387
@fairiesareallaround9387 Год назад
Thank you so much
@tvs3497
@tvs3497 3 года назад
Worked, after I disabled Boost. Thanks.
@haq7280
@haq7280 2 года назад
Thanks man, Suscribed
@supremeboatcleaning7962
@supremeboatcleaning7962 2 года назад
Great video! How to set the radius and fontname and fontsize?
@joleneengelbrecht284
@joleneengelbrecht284 2 года назад
My button says Buy Now and I want it to say Add To Cart 😅 I changed the Buy Now to Add To Cart as you mentioned in your video however it's not changing after refreshing. Should I change anything else in the Code? I've also tried to change the add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); to add_filter( 'woocommerce_product_single_buy_now_text', 'woocommerce_custom_single_buy_now_text' ); and still doesn't work 😓 Thank you Mr Web Reviews 🤗
@rabiamunir9690
@rabiamunir9690 2 года назад
Hey, this code is not changing add to cart button on shop page but changing it on single product page, Please help me out
@suellensanto5724
@suellensanto5724 2 года назад
Great! Thank You! Help me a lot!
@Mr_Web
@Mr_Web 2 года назад
Glad to hear that!
@abdouchokri2382
@abdouchokri2382 Год назад
thank you it work perfect ^^
@khaidiratz7958
@khaidiratz7958 2 года назад
Thanks you.. but how can i do this for the translation as well?
@guillermomunoz324
@guillermomunoz324 7 месяцев назад
how do you change the colour of the bottons?
@uwaizmmustapha86
@uwaizmmustapha86 7 месяцев назад
This video was helpful.
@Mr_Web
@Mr_Web 7 месяцев назад
Great!
@rainbowsunshinekitty3953
@rainbowsunshinekitty3953 3 года назад
Hi, thank you for the video! I want to make all the letters capitalized in Woocommerce buttons. I followed your video for the Buy Now button. How do I change the Apply Coupon and Update cart buttons? I want everything to be uniform on the site.
@Mr_Web
@Mr_Web 3 года назад
You'll need to apply some CSS coding to these elements. Use this line of code: text-transform: capitalize;
@camhospitalityagency
@camhospitalityagency Год назад
LOVELY, THANKS !
@Mr_Web
@Mr_Web Год назад
Thank you too!
@MaaritRei
@MaaritRei 2 года назад
Thank you very much!
@Mr_Web
@Mr_Web 2 года назад
No thanks you for watching my videos and taking the time to leave a comment 👍
@RobertErwinSr
@RobertErwinSr 9 месяцев назад
Thank you.
@Mr_Web
@Mr_Web 9 месяцев назад
You're welcome!
@afiqibrahim2455
@afiqibrahim2455 3 года назад
It's works. thank you very much :)
@Mr_Web
@Mr_Web 3 года назад
Yay! Glad it worked for you 👍
@sebastianmyrvold3527
@sebastianmyrvold3527 2 года назад
Thank you, man!
@Mr_Web
@Mr_Web 2 года назад
You're welcome 😁
@webadvltd
@webadvltd Год назад
Thanks!
@webadvltd
@webadvltd Год назад
I just got your code to work. Super Thanks!
@lifeisbeautiful7174
@lifeisbeautiful7174 2 года назад
Thanks
@SheikhSohel
@SheikhSohel 2 года назад
Thanks a lot. It's very heplful.
@Mr_Web
@Mr_Web 2 года назад
Glad it was helpful!
@Cercasan
@Cercasan 2 года назад
it works - thank you 👍
@Mr_Web
@Mr_Web 2 года назад
Great! Glad to hear that...
@BamwebsolutionsCoUk
@BamwebsolutionsCoUk 6 месяцев назад
Great video! I am looking to change text on a product page, where do i find the code to change? I have a deposit plugin on and the text reads Pay a deposit of £99.00 per item I would like it to read Pay a deposit of £99.00 per item subject to t&cs
@marlonhenrique2196
@marlonhenrique2196 Год назад
tks so much... ☺☺
@dimitridjeukou812
@dimitridjeukou812 2 месяца назад
To make the "Add to Cart" button in WooCommerce remain static and not change when hovered over,
@is_rar
@is_rar 3 года назад
Thank you so much it worked, can you also tell me when I click that button ,Hunter that button comes view CART how can I turn it off?
@Mr_Web
@Mr_Web 3 года назад
Sorry can you rephrase that please 👉 "that button comes view CART" ❓ I'm not too sure what you mean by that 🤔
@frizzamedia5967
@frizzamedia5967 2 года назад
how if want to add buy now button without erasing add to cart button
@conte4762
@conte4762 2 года назад
thank you , you help a lot
@Mr_Web
@Mr_Web 2 года назад
Happy to help
@eyimusic7534
@eyimusic7534 3 года назад
Thank you for the tutorial, it works well. Could you please also provide the code snippet for changing "View Cart"(Appears to me when I click on the Basket Icon on the navigation) + "Continue Shopping"(That shows on Checkout Page) + "Checkout"(Appears to me when I click on the Basket Icon on the navigation) button texts? I sort of got the process of creating the code watching your video, but wanted to be on the safe side still :) Thanks alot!
@Mr_Web
@Mr_Web 3 года назад
// CHANGE VIEW CART add_filter( 'gettext', function( $translated_text ) { if ( 'View cart' === $translated_text ) { $translated_text = 'Your new text here'; } return $translated_text; } ); // CHANGE CONTINUE SHOPPING BUTTON TEXT add_filter( 'woocommerce_continue_shopping_redirect', 'my_changed_woocommerce_continue_shopping_redirect', 10, 1 ); function my_changed_woocommerce_continue_shopping_redirect( $return_to ){ $return_to = wc_get_page_permalink( 'checkout' ); return $return_to; } add_filter( 'wc_add_to_cart_message_html', 'my_changed_wc_add_to_cart_message_html', 10, 2 ); function my_changed_wc_add_to_cart_message_html($message, $products){ if (strpos($message, 'Continue shopping') !== false) { $message = str_replace("Continue shopping", "Go to checkout", $message); } return $message; } // CHANGE CHECKOUT BUTTON TEXT add_filter('gettext', 'change_checkout_btn'); add_filter('ngettext', 'change_checkout_btn'); function change_checkout_btn($checkout_btn){ $checkout_btn= str_ireplace('Checkout', 'Your New Text', $checkout_btn); return $checkout_btn; }
@eyimusic7534
@eyimusic7534 3 года назад
@@Mr_Web Hello David, thank you very much for your prompt reply and all the infos. I have a few more customizations needs, should I send an email here; hello@mrwebreviews.com ? Best,
@Nergy-Web-Design
@Nergy-Web-Design 2 месяца назад
how can i change the size of add to cart
@sergiumaximov3046
@sergiumaximov3046 2 года назад
Thank you!
@Mr_Web
@Mr_Web 2 года назад
You're welcome!
@Al-Munqith
@Al-Munqith 2 года назад
thanks
@glamified1
@glamified1 2 года назад
i added this code from theme editor>function.php at the bottom but now that page is not editing with elementor it says 'preview could not be loaded' should I add it from code snippet will it solve the problem?
@Mr_Web
@Mr_Web 2 года назад
Yes use code snippet much easier
@glamified1
@glamified1 2 года назад
@@Mr_Web ok will try it
@anything2305
@anything2305 Год назад
Thank you
@Mr_Web
@Mr_Web Год назад
You're welcome
@Ayman-jq6nh
@Ayman-jq6nh 7 месяцев назад
This is changing to all capital letters, I want only the first letter to be capital not all the words. Please help.
@Pranta_Saha
@Pranta_Saha 2 года назад
I cloud no find in your discaption in php code it’s need
@jennersmith7179
@jennersmith7179 2 года назад
thank you for this...
@Mr_Web
@Mr_Web 2 года назад
You're welcome 😊
@mdronimia000
@mdronimia000 Месяц назад
Nice videp
@willowwebmedia9343
@willowwebmedia9343 2 года назад
Geat Video and easy to follow; I am trying to find a similar code that will encourage visitors to login before they get prices so button will show 'Learn More' on the shop page, and link to the Product page where 'Buy Now' will only show price on the cart visitor is logged in. Is that possible?
@Mr_Web
@Mr_Web 2 года назад
www.businessbloomer.com/woocommerce-hide-price-add-cart-logged-users/
@meggokayzee6620
@meggokayzee6620 Год назад
You are the man!!! Thank you so much.. I wanted to ask if there is a way to add an icon on the button using a code.
@Mr_Web
@Mr_Web Год назад
CREATE A FILTER: add_filter( 'woocommerce_product_single_add_to_cart_text', 'mrweb_add_symbol_add_cart_button_single' ); function mrweb_add_symbol_add_cart_button_single( $button ) { $button_new = '» ' . $button; return $button_new; } ADD CUSTOM CSS CODE: button.single_add_to_cart_button:before { display: inline-block; font-family: FontAwesome; float: left; content: "\f217"; font-weight: 300; margin-right: 1em; }
@geraldbarnes6940
@geraldbarnes6940 2 года назад
Hello, please is it possible to change the add to a text with a different link? Like "Send Inquiry" with a link to the contact form.
@Mr_Web
@Mr_Web 2 года назад
wordpressdeveloperonline.com/add-to-cart-button-change-to-enquiry-button-linking-to-the-contact-us-page/
@anna.buckowska
@anna.buckowska Год назад
Hi, thank you for this video. By any chance do you also have a code to change a text on a checkout button? It would be very helpful as well.
@Mr_Web
@Mr_Web Год назад
add_filter( 'woocommerce_order_button_text', 'mrwebreviews_custom_button_text' ); function mrwebreviews_custom_button_text( $button_text ) { return 'Submit'; // new text is here }
@anna.buckowska
@anna.buckowska Год назад
@@Mr_Web thank you!!! You are a star!!!
@african_parrot
@african_parrot 2 года назад
nice content
@kokgampang9611
@kokgampang9611 3 года назад
Thx from indo brooo, thanks
@Mr_Web
@Mr_Web 3 года назад
You're welcome, glad to be of help 😂
@haithemzaatchi
@haithemzaatchi 2 года назад
thank you
@Mr_Web
@Mr_Web 2 года назад
You're welcome
@sathishchandrasekaran2580
@sathishchandrasekaran2580 5 месяцев назад
How to change 'checkout' button text in mini cart
@ShivakumarShegale
@ShivakumarShegale 3 года назад
Thanks a Lot ★★★★★
@vimalkhaini
@vimalkhaini 2 года назад
i love you
@zhafransshop6307
@zhafransshop6307 2 года назад
hi , is there a code to change 'Place Order' button on the checkout page ?
@Mr_Web
@Mr_Web 2 года назад
add_filter( 'woocommerce_order_button_text', 'woo_custom_order_button_text' ); function woo_custom_order_button_text() { return __( 'Your new button text here', 'woocommerce' ); }
@fatimakhaliqdad3648
@fatimakhaliqdad3648 Год назад
Thank you, it worked for me. How can I change the update cart text?
@Mr_Web
@Mr_Web Год назад
function change_update_cart_text( $translated, $text, $domain ) { if( is_cart() && $translated == 'Update cart' ){ $translated = 'New Text Here'; } return $translated; } add_filter( 'gettext', 'change_update_cart_text', 20, 3 );
@fatimakhaliqdad3648
@fatimakhaliqdad3648 Год назад
@@Mr_Web its working form me thank you so much.
@peterpekings6170
@peterpekings6170 3 года назад
May God bless you. Amen
@Mr_Web
@Mr_Web 3 года назад
Thank you 👍
@princewillonyebuchi4954
@princewillonyebuchi4954 2 года назад
THANKS FOR THE VIDEO. PLEASE HOW CAN I RENAME "VIEW CART"?
@Mr_Web
@Mr_Web 2 года назад
add_filter( 'gettext', function( $translated_text ) { if ( 'View cart' === $translated_text ) { $translated_text = 'Your new text here'; } return $translated_text; } );
@mr.mohammed4971
@mr.mohammed4971 Год назад
button dimension change please
@Kyor1s
@Kyor1s Год назад
Merci infiniment
@webadvltd
@webadvltd Год назад
What would be the snippet to change "Coupon Code" to "Referral Code"?
@Mr_Web
@Mr_Web Год назад
add_filter( 'woocommerce_checkout_coupon_message', 'mrweb_have_coupon_message'); function mrweb_have_coupon_message() { return ' Have a coupon? Click here to enter your discount code'; }
@webadvltd
@webadvltd Год назад
@@Mr_Web Thanks for your prompt reply. That works for the Top String but under that I also need to change the Text Place Holder "Coupon code" and the "Apply coupon" Button.
@Mr_Web
@Mr_Web Год назад
@@webadvltd This should work for ALL coupon text instances: add_filter( 'gettext', 'mrweb_rename_coupon_field_on_cart', 10, 3 ); add_filter( 'woocommerce_coupon_error', 'mrweb_rename_coupon_label', 10, 3 ); add_filter( 'woocommerce_coupon_message', 'mrweb_rename_coupon_label', 10, 3 ); add_filter( 'woocommerce_cart_totals_coupon_label', 'mrweb_rename_coupon_label',10, 1 ); add_filter( 'woocommerce_checkout_coupon_message', 'mrweb_rename_coupon_message_on_checkout' ); function mrweb_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) { if ( is_admin() || 'woocommerce' !== $text_domain ) { return $translated_text; } if ( 'Coupon:' === $text ) { $translated_text = 'Voucher Code:'; } if ('Coupon has been removed.' === $text){ $translated_text = 'Voucher code has been removed.'; } if ( 'Apply coupon' === $text ) { $translated_text = 'Apply Voucher'; } if ( 'Coupon code' === $text ) { $translated_text = 'Voucher Code'; } return $translated_text; } function mrweb_rename_coupon_message_on_checkout() { return 'Have a coupon code?' . ' ' . __( 'Click here to enter your code', 'woocommerce' ) . ''; } function mrweb_rename_coupon_label( $err, $err_code=null, $something=null ){ $err = str_ireplace("Coupon","Voucher Code ",$err); return $err; }
@webadvltd
@webadvltd Год назад
@@Mr_Web Now the ability to click on "Click here to enter your code" is not linked
@nikhillakshman2983
@nikhillakshman2983 2 года назад
iam nikhil from india sir your video is very very helpful , and how to change checkout now button name
@Mr_Web
@Mr_Web 2 года назад
njengah.com/woocommerce-change-checkout-button-text/
@cyberwarrior_
@cyberwarrior_ 2 года назад
Not working i am using astra theme please help
@Mr_Web
@Mr_Web 2 года назад
Doesn't matter if it's Astra. This works with any theme. Check if you got the code right
@user-jw8xb9tu3f
@user-jw8xb9tu3f 3 месяца назад
sir this code not works on express shop plugin
@Mr_Web
@Mr_Web 3 месяца назад
Only WooCommerce
@digitalafzal
@digitalafzal 2 месяца назад
Its not working now
@asrar-alf-layla-walayla
@asrar-alf-layla-walayla 2 года назад
Sir, this will not impact the link inside
@Mr_Web
@Mr_Web 2 года назад
No
@trojanmaths823
@trojanmaths823 Год назад
not working.. your code
@heyiftikhar
@heyiftikhar 2 месяца назад
How can i change link in this button?
@Mr_Web
@Mr_Web 2 месяца назад
What? The link is to add the product to the cart, why would you want to change that???
@user-ru9ut5qv1y
@user-ru9ut5qv1y 24 дня назад
I CANT FINE THE CODE IN THE COMMENT SECTION
@Wanderexmusic
@Wanderexmusic 5 месяцев назад
Not working
@pametnedrveneigrackemontes7605
Hello! Where is that code?
@Mr_Web
@Mr_Web Год назад
In the description
@pametnedrveneigrackemontes7605
@@Mr_Web but how to redict from ad to cart to checkout page? It is stil view card ?
@Mr_Web
@Mr_Web 3 года назад
Watch next 👉 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jWWB0DOD2Zs.html
@digitalluxury2033
@digitalluxury2033 Год назад
شخص رائع
@Mr_Web
@Mr_Web Год назад
I had to use Google translate 😎 Thanks
@sergiokiselov1458
@sergiokiselov1458 Год назад
Thanks so much for this!!! Great presentation, and I've been looking for this solution for a long time!!!
@Mr_Web
@Mr_Web Год назад
Glad it was helpful!
Далее
How Optimize WooCommerce Product Image Size
9:38
Просмотров 4,7 тыс.
Add Extra WooCommerce Product Options for [FREE]
10:11
Просмотров 113 тыс.
Woocommerce Pricing Rules & Dynamic Pricing for Free
12:01