Prints a form with which a product is added to the shopping cart.

Description

There is just one visible element in the form for adding products to the shopping cart: the Add to cart button. Pressing this button sends a POST request to the online store's address /cart shopping cart.

If the product has variations, the purchase button printed by the tag redirects the customer to the product page.

If the product's selling period isn't in force, the tag does not print anything. The selling period can be set in the product form's item Set purchasable from.

The {ProductAddToCart} tag should mainly be used in product lists (product list's helper attribute). Diverse purchase tools can be printed by using the {ProductBuy} tag, which also contains fields for quantity and variation selection.

Syntax

{ProductAddToCart}

Scope

Required scope: tuote, tuotevariaatio

You can use the tag also in the {ProductVariations} tag's helper attribute.

The required scope is always set in the following templates:

Templates
Single product template
Product images

Attribuutit

after/before:

By using the after and before attributes you can define content that is output either after or before the tag's output.

Allowed values:The HTML and Interface markup

E.g.

  • before: '<p>Tämä merkkaus näkyy ennen tagin omaa sisältöä.</p>'
  • after: '<p>Tämä taas näkyy tagin oman sisällön jälkeen.</p>'

If the tag does not produce any content, neither the content of the after and before attributes will be output.

escape:

Adds an escape character before quotation marks in the output.

The attribute makes it easier to process the tag-produced content when using JavaScript.

Allowed values:true/false. The default value is false.

or:

Defines alternative content that is displayed if the tag itself does not produce any content.

Allowed values:The HTML and Interface markup

E.g. or:'Sisältöä ei löytynyt.'