- URL Parameters - Redirect users to checkout with pre-filled line items
- Shortcodes - Use built-in shortcodes for add-to-cart buttons
Looking to customize cart or checkout behavior? See the Cart
Hooks and Checkout
Hooks reference for available
actions and filters.
URL Parameters
The most straightforward way to add items to cart is by redirecting users to the checkout page withline_items query parameters.
Basic Example
Multiple Items
With Coupon Code
With Product Variant
Shortcodes
SureCart provides built-in shortcodes for adding products to cart.Add to Cart Button
Buy Button with Line Items
Multiple Line Items
Using Shortcodes in PHP
You can render shortcodes programmatically in PHP using WordPress’sdo_shortcode function.