How can I change the text in "add to cart" button ?

ddebruce
3 Posts
ddebruce posted this 05 November 2015

How can I change the text in "add to cart" button ?

I tested it with the description from woocommerce:
Add the following code in my functions.php file like attached picture. But it doesn't work!?

I hope you can help me?
best regards

How can I change the text in "add to cart" button ? I tested it with the description from woocommerce: Add the following code in my functions.php file like attached picture. But it doesn't work!? I hope you can help me? best regards
Vote to pay developers attention to this features or issue.
7 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 09 November 2015

Hello,
I'm sorry for delay in response.
In Themler theme edit the files

..\ThemeName\preview\ThemeName_preview\functions.php 

and

..\ThemeName\functions.php 

And translate the 'Add to cart' text in the code lines

   switch ( $product->product_type ) {
        case "variable" :
            $link   = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) );
            $label  = apply_filters( 'variable_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('Select options', 'woocommerce') );
            break;
        case "grouped" :
            $link   = apply_filters( 'grouped_add_to_cart_url', get_permalink( $product->id ) );
            $label  = apply_filters( 'grouped_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('View options', 'woocommerce') );
            break;
        case "external" :
            $link   = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) );
            $label  = apply_filters( 'external_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('Read More', 'woocommerce') );
            break;
        default :
            $link   = apply_filters( 'add_to_cart_url', esc_url(add_query_arg(array('_wp_http_referer' => urlencode($woocommerce->cart->get_cart_url())), $product->add_to_cart_url())));
            $label  = apply_filters( 'add_to_cart_text', __('Add to cart', 'woocommerce') );
            break;
    }

Regards,
Aileen

Hello, I'm sorry for delay in response. In Themler theme edit the files ..\ThemeName\preview\ThemeName_preview\functions.php and ..\ThemeName\functions.php And translate the 'Add to cart' text in the code lines switch ( $product->product_type ) { case "variable" : $link = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) ); $label = apply_filters( 'variable_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('Select options', 'woocommerce') ); break; case "grouped" : $link = apply_filters( 'grouped_add_to_cart_url', get_permalink( $product->id ) ); $label = apply_filters( 'grouped_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('View options', 'woocommerce') ); break; case "external" : $link = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) ); $label = apply_filters( 'external_add_to_cart_text', $context ? __('Add to cart', 'woocommerce') : __('Read More', 'woocommerce') ); break; default : $link = apply_filters( 'add_to_cart_url', esc_url(add_query_arg(array('_wp_http_referer' => urlencode($woocommerce->cart->get_cart_url())), $product->add_to_cart_url()))); $label = apply_filters( 'add_to_cart_text', __('Add to cart', 'woocommerce') ); break; } Regards, Aileen
ddebruce
3 Posts
ddebruce posted this 16 November 2015

Dear Alieen,

a lot of thanks for your support.

This Part works :-)

And now I have an another question?

How can I change the text from the "View Cart" to "Inquiry" like attached Photo,
when I add a product!? (Picture "ViewCart.JPG")

And also I will change the text in the Cart self to "Inquiry! and will hide the price and total price? Look at the attached photo "CART.JPG"- I marked this parts!

I hope you can help me once again :-)

Thank you and best regards
Josef

Dear Alieen, a lot of thanks for your support. This Part works :-) And now I have an another question? How can I change the text from the "View Cart" to "Inquiry" like attached Photo, when I add a product!? (Picture "ViewCart.JPG") And also I will change the **text** in the Cart self to "Inquiry! and will hide the **price** and **total price**? Look at the attached photo "CART.JPG"- I marked this parts! I hope you can help me once again :-) Thank you and best regards Josef
Support Team
Support Team posted this 18 November 2015

Hello,
actually the text from the ViewCart.JPG is WooCommerce plugin text, you may find it in the files:

  ..\wordpressFolder\wp-content\plugins\woocommerce\includes\class-wc-cart.php 
    ..\wordpressFolder\wp-content\plugins\woocommerce\includes\wc-cart-functions.php 

The text from the CART.JPG

C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart.php 

I'm not sure about 'Cart Totals' but you may try to change it here

C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart-totals.php 

You may hide prices from Shopping cart by just hiding it with the custom CSS code

.product-price, .product-subtotal{
  display:none;
}

regards,
Aileen

Hello, actually the text from the ViewCart.JPG is WooCommerce plugin text, you may find it in the files: ..\wordpressFolder\wp-content\plugins\woocommerce\includes\class-wc-cart.php ..\wordpressFolder\wp-content\plugins\woocommerce\includes\wc-cart-functions.php The text from the CART.JPG C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart.php I'm not sure about 'Cart Totals' but you may try to change it here C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart-totals.php You may hide prices from Shopping cart by just hiding it with the custom CSS code .product-price, .product-subtotal{ display:none; } regards, Aileen
ddebruce
3 Posts
ddebruce posted this 26 November 2015

HI Aileen,

thank's for your last answer and also for your support. I tested some parts and this works :-)

I have an question again:

How can I change the text from the "PROCEED TO CHECKOUT" Button in the Cart?
Look at my attached Picture.

regards,
Josef

HI Aileen, thank's for your last answer and also for your support. I tested some parts and this works :-) I have an question again: How can I change the text from the "PROCEED TO CHECKOUT" Button in the Cart? Look at my attached Picture. regards, Josef
Support Team
Support Team posted this 27 November 2015

Hello,
the "Proceed to Checkout" text could be changed in the file

C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart.php

regards,
Aileen

Hello, the "Proceed to Checkout" text could be changed in the file C:\xampp\htdocs\wordpress4_1\wp-content\plugins\woocommerce\templates\cart\cart.php regards, Aileen
Amilcar Botelho Rubim Junior
117 Posts
Amilcar Botelho Rubim Junior posted this 09 November 2016

Is this modification still done this way or do you already have functions ready in Themler?
How to change the text in the "add to cart" button?

Att..

Amilcar

Is this modification still done this way or do you already have functions ready in Themler? How to change the text in the "add to cart" button? Att.. Amilcar
Support Team
Support Team posted this 14 November 2016

Hello Amilcar,
please edit the files as described above

regards,
Aileen

Hello Amilcar, please edit the files as described above regards, Aileen
You must log in or register to leave comments