Change Empty Cart redirect URL

Flux checkout offers the convenience of updating product quantities directly on the Checkout page. By default, when there is only one product in the cart and the customer reduces its quantity to zero, they are redirected to the shop page.

However, some stores feature only a single product and prefer to redirect users back to the single product page instead of the shop page. This desired behaviour can be achieved by implementing the following code snippet:

/**
 * Change shop page URL.
 *
 * @param url $shop_url Shop page URL.
 *
 * @return string
 */
function flux_change_shop_page_url( $shop_url ) {
	return 'https://site.com/product/pizza';
}
add_filter( 'flux_checkout_shop_page_url', 'flux_change_shop_page_url' );

To incorporate this customization, follow these steps:

  1. Open the functions.php file of your child theme.
  2. Insert the provided code snippet.
  3. Replace 'https://site.com/product/pizza' with the URL where you want to redirect the user.

By adhering to these instructions, you can effectively modify the redirect URL for an empty cart.

Flux Checkout for WooCommerce

Prevent abandoned carts with a slick multi-step checkout experience, designed for your customer’s device.

Was this helpful?

Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.