Black Friday 40% off yearly and lifetime plans · 18d left Ends in 18d09h24m Claim 40% off
WooCommerce50 docs

How to Enable WooCommerce Direct Checkout Links in WordPress

Create WooCommerce direct checkout links that skip the cart and go straight to checkout with a product pre-added. Set quantity from the product edit screen.

By Founder & Lead Developer

Last updated

6 minutes

Key takeaways

  • Generate a direct checkout link for any published, purchasable product
  • Links clear the customer’s cart and add the selected product with a chosen quantity
  • Set a global maximum quantity limit to control bulk orders
  • Copy or test links directly from the **Direct Checkout Link** product sidebar metabox
  • Use links in email, social, affiliate, and QR-code campaigns to reduce checkout steps
  • Forwards coupon, UTM, and affiliate query parameters to the checkout page

Why You Need It

Direct checkout links remove an entire step from the purchasing journey:

  • Email campaigns. A newsletter “Buy Now” button that lands on a product page needs a second click to add to cart. A direct checkout link skips both.
  • Affiliate and influencer links. Affiliates can send traffic straight to checkout with the right product pre-added, lifting conversion rates on shared links.
  • Landing pages. Campaign-specific landing pages can deep-link to checkout so the visitor never has to search for the product.
  • QR codes. Business cards, flyers, and packaging QR codes can point to a direct checkout link.
  • Coupon and campaign tracking. Any coupon codes, UTM parameters, or affiliate IDs appended to the link are forwarded to the checkout page, so tracking still works.

For stores running email and paid-social campaigns, this is a measurable conversion improvement: every skipped page is a skipped chance to abandon.

Configuration Options

Option Behavior Default
Enable WooCommerce Direct Checkout Links Master toggle for the whole feature. Off
Show Custom Quantity Generator Shows a quantity input in the product metabox for generating links with a custom quantity; off forces quantity 1. On
Maximum Quantity Limit Global cap on the quantity used in generated links (1-9999). The effective limit is the lower of this value and the product’s max-purchase quantity. 999

What Gets Affected

  • The product edit screen: a Direct Checkout Link sidebar metabox appears on published products
  • Checkout behavior: a URL with direct=1 clears the cart, adds the product, and redirects to checkout
  • Query parameters: direct, product_id, and quantity are consumed; all other parameters (coupons, UTM, affiliate IDs) are forwarded to checkout
  • The cart: existing contents are cleared before the direct-checkout product is added

What Does NOT Get Affected

  • The standard Add to Cart button on product and archive pages (unchanged)
  • The cart and checkout pages for normal shopping (a direct checkout only triggers when direct=1 is in the URL)
  • Product stock and inventory rules (standard WooCommerce limits and stock status still apply)
  • The SKU (the feature uses product ID, not SKU, as its identifier)

Advanced Options (Developers)

The feature registers three hooks in functions/woocommerce/one-click-checkout/direct-checkout-link.php:

add_action( 'wp_loaded', array( $this, 'process_direct_checkout' ), 5 );
add_action( 'add_meta_boxes', array( $this, 'add_direct_checkout_metabox' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
  • wp_loaded (priority 5) runs process_direct_checkout(), which reads the direct, product_id, and quantity parameters, validates the product and quantity limits, clears the cart, adds the product, and safely redirects to checkout.
  • add_meta_boxes registers the Direct Checkout Link metabox on the product edit sidebar.
  • admin_enqueue_scripts loads the metabox CSS and JS only on product edit screens for users who can edit products.

There is also a public helper for theme and plugin developers:

// Generate a direct checkout URL for product 456 with a quantity of 3
$url = cm_get_direct_checkout_url( 456, 3 );

This returns wc_get_checkout_url() with the direct, product_id, and quantity parameters appended. It is a shortcut to CM_Direct_Checkout_Link::generate_checkout_url().

Common Use Cases

Email and newsletter campaigns. Put a direct checkout link behind every “Buy Now” call-to-action in your campaigns. Users land on checkout with the featured product pre-added, eliminating clicks and drop-off between the email and the order.

Affiliate and influencer programs. Hand affiliates a stable direct checkout link per product. Because the quantity and product are baked into the URL, you can trust that every click converts the intended item without manual cart work.

QR codes on packaging and print. Link a printed QR code straight to checkout for a product. A shopper scans, lands on checkout with the item ready, and completes the order on their phone.

Flash sales and hot drops. When you need to sell a specific SKU fast, share a direct checkout link on social channels. Every visitor who taps the link is one click away from paying.

Replenishment and subscription-style purchases. Use a fixed-quantity direct checkout link (for example, quantity 6) so repeat buyers can restock a standard quantity in one tap.

Frequently asked questions

Does a direct checkout link clear the cart or add to it?

It clears the cart. When a customer clicks a direct checkout link, Classic Monks empties the existing cart and adds only the product specified in the link with the given quantity, then redirects to checkout. This is a buy-now flow, not an add-to-cart flow.

Do I need to write the URL by hand?

No. Classic Monks generates each link for you in the Direct Checkout Link sidebar metabox on the product edit screen, with a Copy Link button. The URL uses the direct=1, product_id, and quantity parameters automatically.

Will coupons and tracking parameters survive a direct checkout?

Almost all of them. The direct, product_id, and quantity parameters are consumed, but any other query parameters (coupon codes, UTM parameters, affiliate IDs) are forwarded to the checkout URL, so campaign tracking still works.

Can I make a direct checkout link for more than one item?

The link supports a single product with a quantity. Use the quantity box in the metabox (when Show Custom Quantity Generator is on) to set how many of that product to add. It is capped by Maximum Quantity Limit and the product’s own max-purchase limit.

Is direct checkout the same as a WooCommerce redirect plugin?

WooCommerce direct checkout is the same intent: skip the cart and go straight to checkout. Classic Monks implements it as a generated link per product rather than changing every Add to Cart button, so it works for buy-now campaigns and checkout links without altering the standard storefront flow.

Troubleshooting

5 problems and how to fix each one.

The direct checkout link does nothing

Cause: The feature is off, the link is missing the direct=1 parameter, or a request-caching layer is caching the checkout page.
Fix: Confirm Enable WooCommerce Direct Checkout Links is on. Verify the link contains direct=1&product_id=<id>&quantity=<n>. Purge any full-page cache or CDN cache on the checkout URL, then test with the Test Link button in the product metabox.

The customer lands on the cart page instead of checkout

Cause: Another plugin or theme callback intercepts the checkout redirect.
Fix: Test a freshly generated link from the metabox. Temporarily disable other cart- or checkout-redirect plugins to isolate the conflict. The redirect uses wp_safe_redirect, so an alternate plugin that runs after it could override the destination.

The product is not added to the cart

Cause: The product is unpurchasable or out of stock, or another plugin cleared the cart after the feature added the product.
Fix: Confirm the product is published, purchasable, and in stock. Check for a plugin that empties the cart (for example, a “delete all on X” rule) running on wp_loaded after priority 5. Test with a known in-stock product.

The quantity is capped at a number I didn’t set

Cause: The product’s own maximum purchase quantity is lower than the global Maximum Quantity Limit.
Fix: The effective cap is min(product_max_purchase_quantity, admin_max_quantity). Raise the per-product max-purchase limit in WooCommerce product data, or accept the lower cap.

I want a link for a product but the metabox is empty

Cause: The metabox only renders for published, purchasable products, and only for users who can edit products.
Fix: Publish the product and confirm it is set to a purchasable type (simple, variable, group, and so on). Confirm your user role has the edit_products capability.

Was this doc helpful?

Your answer tells us which docs to fix first.

Still stuck? Ask on the forum or email help@classicmonks.com.
Joy Chetry
Written by the person who built it

Joy Chetry

Founder & Lead Developer, Classic Monks

Joy is the founder of Classic Monks and GoodMonks Solutions, a web development agency that builds WordPress and WooCommerce sites for clients. Classic Monks grew out of the agency's own need to consolidate 20 to 30 separate plugins into one core stack.

Follow this doc on a real site.

Open a private WordPress site with Classic Monks, WooCommerce and Bricks Builder installed, and follow this doc step by step. Free for 24 hours, no card.

280 docs, written by Joy Chetry 15 day refund window