Ecommerce for Statamic

Add to cart tag

Place this single tag on a template to add products to your cart by visiting a URL.
You can add parameters to the tag, but it is more useful when passing parameters through the query string.

Parameters

product
The URL of the product to add.
quantity
How many to add?
option
The index of the product modifier.
extra
Extra data to make the cart item unique. Pipe delimited, colon separated values, eg. size:small|color:red
return
The URL to be shown after the item is added.
error_return
The URL to be shown if there is a problem adding the item.
item
The encrypted configuration for the item to be added.
This is only available as a query string parameter and can be generated using the add to cart link tag. If you use this, the other parameters can’t be used.

Example

Place {{ bison:add_to_cart }} by itself on a template and visit /cart/add?product=/products/bowie-knife&quantity=2&option=2&return=/checkout to add 2 Bowie Knives with brown handles to your cart and redirect to the checkout page.


Problem with this page? Edit it on Github.