I’m trying to change text of the update cart button. Please I need the code in functions.php file which can change/edit ‘update cart’ text in the cart page in Woocommerce.
thanks,
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
4
Answers
Find: >> cart.php
Then Find:
Try changing the second ‘Update cart’ and tell me what happens.
You can copy and paste the below function to your functions.php and change the text. This works. Tested
Another way to get at this text is to copy the
wp-content/plugins/woocommerce/templates/cart/cart.php
file to your theme atwp-content/themes/YOUR_RAD_THEME/woocommerce/cart/cart.php
From there you can search that file for "Update cart". You should find it in two places inside a button tag.
<button type="submit" class="button" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Update cart', 'woocommerce' ); ?></button>
Update the second one
<?php esc_html_e( 'Update cart', 'woocommerce' ); ?>
to whatever text you need. Bonus is that you can also edit other parts of the cart using that file.I would avoid using
gettext
because that’s a global WordPress filter. In other words, it’s going to replace your string anyplace on the site, not just that button.Thanks @melvin i tried this code for Turkish. Worked 🙂
if you should paste your functions.php. Don’t forget change here ‘Sepeti Güncelle’