Products
Products are defined using a <jamcart-add>
HTML tag. This implements the desired behaviour (adding an item to shopping cart) and transmits the required data to JamCart.
Examples
Simple Example
<jamcart-add name="Strawberry Jam" price="10.99"></jamcart-add>
Note: The closing tag </jamcart-add>
is required and may not be omitted or made self-closing.
Full Example
<jamcart-add id="PS00326"
include-form-data
image="/static/strawberry-jam.jpg"
open-cart
name="Strawberry Jam"
price="10.99"
quantity="3"
url="/strawberry-jam"
verify-url="/strawberry-jam"
>
<span>Click</span> Me!
</jamcart-add>
Appearance
The appearance may be fully customized. Any HTML included inside of the <jamcart-add>
tag will completely replace the default appearance.
Attributes
- image
- URL
- Path to the product's image. This will be displayed in the customer's shopping cart.
- intangible
- Boolean
- An intangible item does not require shipping. During checkout, if all items are intagible, shipping address will not be collected.
- name
- String
- Required
- The product's name. This is displayed in the customer's shopping cart and on invoices.
- open-cart
- Boolean
- If true, will automatically open the shopping cart after this item has been added.
- price
- Decimal
- Required
- Price per unit in the currency specified during installation. Must use
.
as the decimal separator. - product-id
- String
- A unique identifier for this product. This can be anything: SKU, ISBN, or another ID used by your own systems.
- quantity
- Integer
- Number of units of the product to add. Default is
1
. - url
- URL
- Location of the product's page. This is used as a link in the customer's shopping cart.
- verify-url
- URL
- Location to crawl back when verifying product price. See security for more information. Default is
window.location.href
.