Change Url Woocommerce "Return to Shop"

for some reason I get this when i hit return to shop:

This site can’t be reached

xn--%20%20%20-zyhgadab9cq9cg1a6brlgdd9aqmj4akrf8l9b8c’s server DNS address could not be found.
Try:
Checking the connection
Checking the proxy, firewall, and DNS configuration
Running Windows Network Diagnostics
ERR_NAME_NOT_RESOLVED

I would like to change the URL to get back to the shop page:

Here is what i have on line:

<p class="return-to-shop">
    <a class="button wc-backward" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink ('shop') ) ); ?>"><?php _e( 'Return to shop', 'xclean' ) ?></a>
</p>

2 Answers

Try this code

function your_theme_prefix_continue_shopping_redirect_url($url) {
$url = ' // Add your custom link here
return $url;
}
add_filter('woocommerce_return_to_shop_redirect', 'your_theme_prefix_continue_shopping_redirect_url');

Change the URL value according to your need.

10

There is not rocket science just add this function in the function.php

 // cart page return to shop link
  add_filter( 'woocommerce_return_to_shop_redirect', 'tm_get_shop_link' );
  // continue shopping redirect
  add_filter( 'woocommerce_continue_shopping_redirect', 'tm_get_shop_link' );
  function tm_get_shop_link() {
    return get_site_url();
  } // end function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest