Skip to content

Instantly share code, notes, and snippets.

@doozy
Last active April 27, 2023 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doozy/7e55841dcdc02b6b7961aaee32d98559 to your computer and use it in GitHub Desktop.
Save doozy/7e55841dcdc02b6b7961aaee32d98559 to your computer and use it in GitHub Desktop.
[wishlist] Modify back to shop url only for wishlist page
// Modify back to shop URL only for the wishlist page.
add_action( 'tinvwl_wishlist_is_null', 'tinvwl_apply_back_to_shop_url' );
add_action( 'tinvwl_before_wishlist', 'tinvwl_apply_back_to_shop_url', 9, 1 );
// Apply filters for the wishlist page only.
function tinvwl_apply_back_to_shop_url() {
add_filter( 'woocommerce_return_to_shop_redirect', 'tinvwl_back_to_shop_url' );
}
// Customize the back to shop URL.
function tinvwl_back_to_shop_url( $url ) {
return 'https://google.com';
}
@jamesgit32
Copy link

Hey there! is this currently updated? I tired using your code, unfortunately is still returns me to the shop page. I have no what's going on. I replaced 'https://google.com/ with my home page link. - save changes and refreshed still took me the shop page.

Any ideas/theories

Thanks for your kind responds, appreciate your time and contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment