By default, WooCommerce includes a “Return to Shop” button on the empty cart page, directing customers back to the shop page. However, many store owners prefer redirecting users to a custom page, such as the homepage, a promotions page, or a restaurant menu.
With a simple WooCommerce filter, you can customize this button’s destination to match your store’s needs.
Why Customize the “Return to Shop” Link?
✔ Improves navigation – Redirect customers to a more relevant page, such as your homepage or menu.
✔ Enhances user experience – Avoids confusion if your WooCommerce shop page isn’t the main focus.
✔ Increases conversions – Send users to an engaging page where they’re more likely to continue shopping.
✔ Works seamlessly with WooFood – Ideal for restaurants and food delivery businesses using WooCommerce.
How to Change the “Return to Shop” URL in WooCommerce
To modify the Return to Shop button’s link, insert the following PHP snippet into your child theme’s functions.php
file:
add_filter( 'woocommerce_return_to_shop_redirect', 'wpslash_change_return_shop_url');
function wpslash_change_return_shop_url()
{
$url = home_url();
return $url;
}
How This Code Works
✅ Uses the woocommerce_return_to_shop_redirect
filter to customize the button’s destination.
✅ Sets home_url()
as the new redirect location, pointing users to the homepage.
✅ Can be easily modified to redirect customers to a different page, such as a promotions page, menu, or category page.
💡 Example: Want to send users to your restaurant’s food menu? Replace home_url();
with:
$url = site_url('/menu/');
Best Practices for Customizing the Return to Shop Button
🔹 Choose a strategic redirect – Consider sending users to a category page, featured promotions, or the homepage.
🔹 Ensure easy navigation – The new page should encourage users to continue shopping.
🔹 Test before applying to a live site – Verify the redirection works smoothly across devices.
Boost Your WooCommerce Food Ordering System with WooFood
For restaurant owners running a WooCommerce-powered food ordering system, customizing the Return to Shop button can guide customers back to your menu instead of a generic shop page.
With WooFood – The Ultimate WooCommerce Food Delivery Plugin, you can:
✅ Enhance the ordering experience – Redirect users directly to your restaurant menu instead of the default shop page.
✅ Optimize checkout flow – Improve the user journey by guiding customers to relevant sections.
✅ Support both pickup & delivery – Manage orders seamlessly through WooCommerce.
✅ Automate order processing – Streamline food order management with real-time tracking & notifications.
🚀 Upgrade Your WooCommerce Food Delivery Setup Today!
👉 Check out WooFood – The Best WooCommerce Plugin for Online Restaurants and improve your customers’ ordering experience!