show_quick_checkout

The show_quick_checkout shortcode is used when you want to show a checkout form for purchasing a single product on a page.

This shortcode accepts a number of attributes, including:

  • id: This is the product ID that the customer will be purchasing if they complete the checkout form. By default this is not set.
  • quantity: This is the quantity of the product that the customer will be purchasing. Default is 1.
  • variation_id: This is the ID of the variation that should be purchased for variable products. By default this is not set.
  • checkout_action: Defaults to 'onpage'.
  • clear_cart: Whether the customer's cart should be cleared before adding this product to the cart. Default is true.
  • autoload: Whether or not the checkout page should be autoloaded. Default is true.
  • checkout_text: Text to display on the checkout. Default is null.

Common examples of shortcode usage:

Display a checkout page for a single product with product ID 123.

[show_quick_checkout id="123"]

Display a checkout page for a single product with product ID 123 and variation ID 1.

[show_quick_checkout id="123" variation_id="1"]

Display a checkout page for a purchasing two of a product with product ID 123.

[show_quick_checkout id="123" quantity="2"]