SimpleCart SimpleCart 2.x Snippets scAddProduct

The scAddProduct snippet is used for the cart. It handles a form submission from a product page or category page.

Standard Usage



The following properties are available.


Default: addcart

The name of a POST parameter that triggers the snippet to process the cart.


Default: productid

The name of a POST parameter that holds the product ID that needs to be added to the cart.


Default: quantity

The name of a POST parameter that holds the quantity to be added.


Default: products

The name of a POST parameter for when multiple products are added in the same submit.


Default: none

Contains the ID of a resource to redirect the user to. Typically, this would be your cart page so the user is redirected to the cart after adding a product to it.


Default: http

The scheme for generating the URL to a resource in &redirectTo.


Default: 0

When set to 1, the cart will be emptied before adding the product. This way only a single product is in the cart at one time.


Default: simplecart_option_

The prefix for product options submitted with the product.