Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Go straight to checkout

Add to cart takes customers straight to the checkout instead of the cart. Suits shops that mostly sell one product at a time.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Needs WooCommerce
  • Tested with WordPress 7.1, WooCommerce 11.1
PHP
<?php

// Shop lists use normal links instead of adding in the background, so every
// add-to-cart button can go on to the checkout.
add_filter( 'option_woocommerce_enable_ajax_add_to_cart', static fn() => 'no' );
add_filter( 'option_woocommerce_cart_redirect_after_add', static fn() => 'yes' );
add_filter( 'woocommerce_add_to_cart_redirect', static fn() => wc_get_checkout_url(), 20 );

Good to know

Applies to classic product pages and shop lists. Product blocks with their own add-to-cart button keep adding in the background.

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.