1. Home
  2. Knowledge Base
  3. WooCommerce Fast Cart
  4. Advanced Usage

How to disable the order confirmation page

When you're using the WooCommerce Fast Cart plugin and a customer completes a purchase in the popup checkout, by default they will be redirected to the usual WooCommerce order confirmation page.

The following code snippets allow you to keep the user on the same page or redirect them to another page after the order is placed. This custom code is aimed at developers and if you don't know how to use it then you should ask a developer or post a job on Codeable, where one of their pre-approved developers will send you a quote.

We've partnered with Codeable to provide our customers with expert help if required.

Code snippet: Redirect user to the same page

add_filter( 'wfc_script_params', function( $script_data ) {
global $wp;
$current_url = home_url( add_query_arg( array(), $_SERVER['REQUEST_URI'] ) );
$script_data['options']['redirectReceipt'] = esc_url( $current_url );
return $script_data;
} );

Code snippet: Redirect to a specific page:

add_filter( 'wfc_script_params', function( $script_data ) {
$script_data['options']['redirectReceipt'] = esc_url( 'https://site.com/my-page' );
return $script_data;
} );

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.