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
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
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
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
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
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
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.. AmilcarHello Amilcar,
please edit the files as described above
regards,
Aileen