A man scaring a standing man as if he was a ghost.

In the past we discussed about how to change the Return to Shop button URL in the Empty Cart page. Today we will learn how to change the Continue Shopping button URL always on the cart page.

This button appears when the option Redirect to the cart page after successful addition is selected in WooCommerce > Settings > Products > General > Shop pages > Add to cart behaviour.

The necessary snippet is quite short, requiring only one line even:

You can add a layer of complexity and return a different link, maybe conditionally by using a full function instead of an anonymous one, like so:

This would allow you to add conditions to your function so that you can maybe redirect to a different page based on what product is added to the cart, or based on the user role. Use your imagination!

Contribute to Improving This Blog

Did you enjoy this article? Was it helpful? Contribute to help me writing more articles! The funds collected from this blog are reinvested directly into improving my skills or the blog so that I can provide more and better content!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

Do you prefer using cryptocurrency? I’ve got you covered! You can donate at the following wallets:

  • BTC: bc1q87nxpdpqw323ccmerrzyeffs72wnxpw93x7pzk / 17Gtc5e8yoh2LZzokoyK8P5DWbToBwztok
  • ETH: 0xA5C89Be1df2896C3942DBEf751cCeacC7929388b

1 reply

Trackbacks & Pingbacks

  1. […] If you turn on the option to redirect to the cart page after adding a product to the cart, you will have a nice little button that invites you to Continue Shopping. You can change this URL to anything you want! […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply