Snippets

Visser Labs Skipping Cart and sending buyers direct to Checkout

Created by Michael Visser

File functions.php Added

  • Ignore whitespace
  • Hide word diff
+<?php
+
+// Redirect customer to Checkout instead of Cart page
+function custom_woocommerce_redirect_to_checkout() {
+
+	return WC()->cart->get_checkout_url();
+
+}
+add_filter( 'add_to_cart_redirect', 'custom_woocommerce_redirect_to_checkout' );
+
+?>
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.