Ecommerce for Statamic

Add to cart link

Outputs an encrypted link to add a product to the cart.

This is useful when you want to add a product with an on-the-fly price to the cart. It is encrypted because you don’t want to be able to let your customers change the price of any product on your site.

Parameters

product
The URL of the product to add.
quantity
How many to add?
price
What should it cost?
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.

Example

You probably would want to link to a template with an add to cart tag on it.

{{ bison:add_to_cart_link url="/cart/add" product="/donation" quantity="1" price="10" return="/cart" }}
Outputs: /cart/add?item=encryptedstring


Problem with this page? Edit it on Github.