Return to shop on cart page - by john - on WordPress WooCommerce support

This topic has 6 replies, 3 voices, and was last updated 4 years, 6 months ago ago by Rose Tyler

  • Avatar: john
    john
    Participant
    April 4, 2020 at 08:08

    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’];
    }

    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 4, 2020 at 08:44

    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

    Avatar: john
    john
    Participant
    April 4, 2020 at 22:17

    Thanks very much for this. Muchly appreciated

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 5, 2020 at 06:58

    You’re welcome!

    Regards

    Avatar: chiche.solene
    Chiche Solene
    Participant
    May 14, 2020 at 08:56

    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

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 14, 2020 at 09:51

    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

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Return to shop on cart page’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.