Home Forums WoodMart support forum Empty cart – return to home.

Empty cart – return to home.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #686271

    shweta
    Participant

    Hello team,

    On our site, in both the empty cart page and the empty mini cart drawer, the button currently shows “Return to shop” and links to the Shop page.

    We would like to:

    Change the button label to “Return to home”
    Change the button link to point to the home page

    Kindly furnish a patcher or a hotfix. You are a amazing theme. We love you.

    #686369

    Hello,

    To change this button text, try to use the Loco Translate plugin for this.

    Please follow this guide: https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    For the button URL, please add below Custom Code to the function.php of the theme.

    add_filter( 'woocommerce_return_to_shop_redirect', 'pk_change_return_shop_url' );
     function pk_change_return_shop_url() {
    return home_url();
    }

    Best Regards,

    #686623

    shweta
    Participant

    Hello Team,

    Thank you for your suggestion. Unfortunately, the code provided does not work on our setup.

    The empty cart page button still links to the Shop page instead of Home.

    The empty mini cart drawer button also links to the Shop page.

    It seems that in Woodmart, the default WooCommerce filter woocommerce_return_to_shop_redirect is not being applied, since both buttons are rendered through the theme’s custom template.

    Could you please provide a theme-compatible patch or hotfix so that both the empty cart page and the empty mini cart drawer button link to the homepage?

    Best Regards,

    #686651

    Hello,

    Please try to find the redirection plugin, as our theme does not have such an option, WooCommerce does not provide the option either.

    Best Regards,

    #686808

    shweta
    Participant

    Com’on sir, we do not have 18+ licenses for this. You always have furnished exact php. Or at least suggest a reliable hotfix.

    #686812

    shweta
    Participant

    Do I change the priority order of snippet to make this work? would that help?

    #686826

    shweta
    Participant

    Patcher 685012 was applied. It was to do with cart and checkout. Do you think that any other file is governing the cart and checkout now? and could it be the reason the code snippet is not working?

    #686832

    Hello,

    Sorry to say, it requires customization and is beyond our support policy. Additional code customizations are out of our theme support scope.

    Please follow this Guide and implement this on your site.
    https://woolentor.com/doc/how-to-change-return-to-shop-link-in-woocommerce/
    https://aovup.com/woocommerce/change-return-to-shop-link/
    https://www.businessbloomer.com/woocommerce-change-return-shop-url/

    Hope this Helps!

    Best Regards,

    #686893

    shweta
    Participant

    Thank you so much. So So much.

    
    function aovup_custom_woocommerce_return_to_shop_redirect() {
        return home_url(); // You can change this with the URL to which you want to redirect the customers. Make sure you add the URL within the quotes like 'https://mywebsitesite.com'
    }
    
    add_filter('woocommerce_return_to_shop_redirect', 'aovup_custom_woocommerce_return_to_shop_redirect');
    
    // Change the text of the "Return to Shop" button
    function aovup_custom_woocommerce_return_to_shop_text( $translation, $text, $domain ) {
        if ( 'woocommerce' === $domain && 'Return to shop' === $text ) {
            $translation = 'Go Back to the Home Page'; // Change 'Go Back to the Product Page' to your desired text
        }
        return $translation;
    }
    add_filter( 'gettext', 'aovup_custom_woocommerce_return_to_shop_text', 30, 3 );

    The code you shared works perfectly on the Empty Cart page. Thank you for that.

    However, it does not affect the button in the Empty Mini Cart drawer (widget). Could you please guide us on which hook/filter applies to the mini cart empty button in Woodmart?

    This will help us apply the same “Return to home” link for the empty mini cart as well.

    Best Regards,

    #686978

    Hello,

    You can find it in the file woocommerce/cart/mini-cart.php

    Best Regards,

Viewing 10 posts - 1 through 10 (of 10 total)