mbr_quick_checkout
Usage
This shortcode adds one or more products to a WooCommerce shopping cart and sends the user directly to the checkout page.
Parameters
Parameters | Description |
---|---|
p{product_id}=quantity | Product IDs to add to the cart. Product ID’s are defined by using the letter 'p' followed by the WooCommerce product ID. If provided without specifying a quantity, quantity will default to 1. If a product ID refers to a nonexistent product, it will be ignored. Defaults: none. Required: yes. |
autorun | If set to yes the shortcode will execute without waiting for user input. Otherwise it will generate a form and a submit button or link_style and wait for user input. If set to yes the following parameters will be ignored; link_text , link_style , button_text , button_image , button_style .Permissible Values: yes Defaults: none. Required: no. |
link_text | The text to display for the link. Defaults: Add to cart Required: no. |
link_style | The CSS style to apply for the link. Defaults: none. Required: no. |
button_text | The text to display on the button. Defaults: Add to cart Required: no. |
button_image | The URL of the image to use for the button. Defaults: none. Required: no. |
button_style | The CSS style to apply for the button. Defaults: none. Required: no. |
This shortcode is only processed when the ActiveMember360 WooCommerce Extension is enabled as detailed within ActiveMember360 WooCommerce Extension Activation.
The shortcode checks the ActiveMember360 settings for each product and ensures that only those products that a user or visitor is allowed to purchase are processed. If none of the given products are allowed, the shortcode does not execute.
WooCommerce product variations are not supported.
Validity
This shortcode is evaluated for any type of visitor.
Conditional Branching
This shortcode does NOT support conditional branching with [ELSE_quick_checkout].
Nesting
Shortcode nesting is NOT supported.
Examples
- Example 1
- Example 2
- Example 3
- Example 4
- Example 5
- Example 6
- Example 7
- Example 8
Adds the WooCommerce product ID 345 to the cart and redirects to the checkout when the link labelled 'Add to cart' is clicked:
[mbr_quick_checkout p345]
Adds the WooCommerce product ID 345 with a quantity of 3 to the cart and redirects to the checkout when the link labelled 'Add to cart' is clicked:
[mbr_quick_checkout p345='3']
Adds the WooCommerce product IDs 345 and 456 to the cart and redirects to the checkout when the link labelled 'Add to cart' is clicked:
[mbr_quick_checkout p345 p456]
Adds the WooCommerce product IDs 345 with a quantity of 1 and 456 with a quantity of 3 to the cart and redirects to the checkout when the link labelled 'Add to cart' is clicked:
[mbr_quick_checkout p345 p456='3']
Adds the WooCommerce product ID 345 to the cart and redirects to the checkout when the link labelled 'Buy Now' is clicked:
[mbr_quick_checkout p345 link_text='Buy Now']
Adds the WooCommerce product ID 345 to the cart and redirects to the checkout when the button labelled 'Buy Now' is clicked:
[mbr_quick_checkout p345 button_text='Buy Now']
Adds the WooCommerce product ID 345 to the cart and redirects to the checkout when the button displaying the image at URL "https://example.com/buy_now.png" is clicked:
[mbr_quick_checkout p345 button_image='https://example.com/buy_now.png']
Adds the WooCommerce product ID 345 to the cart and redirects to the checkout automatically when the visiotr lands on the page/post where the shortcode is placed:
[mbr_quick_checkout p345 autorun='yes']
API
There is currently no ActiveMember360 API function equivalent for this shortcode.