This topic has 6 replies, 3 voices, and was last updated 4 years, 7 months ago ago by Rose Tyler
HOw do I change the link “Return to shop” on the cart page? I have tried this in hte functions of the child theme and it does not seem to work.
add_filter( ‘woocommerce_return_to_shop_redirect’, “custom_woocommerce_return_to_shop_redirect” ,20 );
function custom_woocommerce_return_to_shop_redirect(){
return $_SERVER[‘HTTP_REFERER’];
}
Hello,
“Return to Shop” is written in the files wp-content/themes/xstore/woocommerce/cart/cart-empty.php and xstore/woocommerce/cart/cart.php , so you can rewrite these files via the child theme.
Regards
Thanks very much for this. Muchly appreciated
You’re welcome!
Regards
Hi!
If the theme is updated, the code of cart.php or cart-empty.php will be erased right?
Is there a permanent way to change this hardcoded URL?
Thanks
Hi,
As was mentioned, you need to edit files via child theme, and your changes won’t disappear after the parent theme update.
Create woocommerce and cart folders in xstore-child theme https://www.8theme.com/documentation/docs/child-theme/ > copy cart-empty.php and cart.php , and edit code in files of the child theme.
Regards
The issue related to '‘Return to shop on cart page’' has been successfully resolved, and the topic is now closed for further responses