> > > Use code BLACKFRIDAY20 for a 40% off everything < < <

Woocommerce, Plug-in allows you to edit the text of the Add to cart button

Are you tired of using the usual default phrase “Add to cart” for your e-commerce?

Or, for your personal needs, have you decided to change it in order to improve your customers’ shopping experience?

For the WooCommerce platform, a plug-in allows you to change the text of the Add to cart button, customizing your desire for change and creativity.

It can be used to achieve various objectives, for example launching a non-profit business or deciding not to use too commercial items, views and magazines, giving a touch of originality to your online store.

Why develop a dedicated plugin when you can edit it with a few lines of code?

The reason is simple. For one reason or another, many users, despite the numerous guides available online, are unable to change the “Add to cart” button entry by modifying the text string files of the plugin used.

The reason that most discourages users from changing text strings is this: every time the plug-in used is updated, the code changes may be canceled.

Time, patience, attempts on attempts, stress: is it convenient? No.

A friend of ours always says: time is money and I always have very little ‘time’ …

WooCommerce: dedicated plug-in to modify the text of the Add to cart button or manual modification of the text strings?

For the record, we explain how you can change the entry of the Add to cart button by intervening with the snippet.What is the snippet?

It is a manual addition to functions.php or the file of functions associated with the theme used.

About the theme: always use the child theme if you don’t want to lose the changes due to the template updates.With the snippet you can change the text of both the Add to cart button and the Buy Now button on the individual pages of each product.

Just replace the “Custom Button Text” code.Warning: always check the compatibility of the WooCommerce version, before choosing the snippet to change the wording.

The version must be fairly updated (at least 3.2.1+).

For the two examples that follow, we have chosen version 3.2.1 of WooCommerce.

Change the text of the Add to cart button of each product with the snippet

This first example of using the snippet may interest you if you intend to change the text of the Add to cart button for each product that appears in the archive pages or categories of its e-commerce site.

Always remember the first step: open the theme’s functions.php file using a text editor.

The functions.php file is located in the FTP space of the WP site (wp-content / themes / {name_of_thema} /).

In this space add the following snippet:

// Change the text of the buy button in the loop

add_filter (‘woocommerce_product_add_to_cart_text’, function ($ text, $ product) {

return __ (‘Add to cart’, ‘woocommerce’);

}, 10, 2);

Do you want to change the wording of the Add to cart button only on a single product page?

Here’s what you need to do.
After opening your theme’s functions.php file, insert the following snippet:

// Change the text of the purchase button on the individual product page

add_filter (‘woocommerce_product_single_add_to_cart_text’, function ($ text, $ product) {

return __ (‘Add to cart’, ‘woocommerce’);

}, 10, 2);

Done!

It works? If the answer is yes, we are proud of you.If, as often happens, you are unable to change, you can find out later how to solve with a plugin developed specifically to hit the target.

Do you want to change the text of the Add to cart button for each type of product?

Here’s how to do it. You may need a different text for each type of product.
In this case, to change the wording of the Add to cart button, you will have to slightly change the snippets with a different condition.

In short, you only need to change the last part of the text string (return __ (‘Add to cart’, ‘woocommerce’);}, 10, 2);

replacing ‘Add to cart!’ with the wording you prefer.With this system, you can obtain different labels for the various types of products.

Did you follow the procedure? Were you able to edit? No?

Consulates, you are not the only one making unsuccessful attempts and we explain why.

Often, adding the snippet doesn’t work, for example if you need to add an image or manage variable products.

Is there a tool to change the button text effectively, quickly and easily? Yes, you can edit quickly and effectively with the “Custom add to cart button” plug-in.

Custom add to cart button for WooCommerce: plug-in that allows you to edit the text of the Add to cart button

The solution is called “Custom add to cart button“. This plugin developed by NS Themes is the quickest and safest way to edit the “Add to cart” button entry.

“Custom add to cart button” allows you to enter a different button text for each product or for each category of products. Customize button management to the maximum (including style).

To use it you need the WordPress version 4.3 + WooCommerce 2.5.0 + PHP5.3 +.

How does it work?

In the Page option of the WP backend menu, to insert the button text you will only have to type the text and save it through a simple and clean operation.

The new button text will appear both on the single product page and on the home page of your e-commerce site.

NS Themes offers two chances:

– the test of the free version to test the functions of the plugin;

– the Pro version that allows you to customize 360 ​​degrees without problems.

The subscription includes one year of support and updates.
Every year, it renews itself automatically until canceled.

Leave a Reply

Your email address will not be published.

X

Stay in touch

Suscribe to our newsletter for reserved offers and new updates

Accept our Term and Conditions and Privacy policy