When the cart in Easy Digital Downloads is empty, it will show the customer a “Your cart is empty” message and keep them on the checkout page.

We can redirect the customer when they remove the last item in their cart, or when they visit the checkout page and have no items in their cart. For example, you might like to redirect the customer to your shop page, so they can continue shopping.

Copy and paste the following function (mind the opening PHP tag) into your child theme’s functions.php or custom plugin and adjust the redirect variable as required.


Comments are closed.