Build an Antlers storefront
List products, render an add-to-cart form, and keep buyer-specific content out of cached pages.
List products and add an item#
Place the following in an Antlers template on the store. Publish an entry with a SKU and a price for the current site first.
{{ nocache }}
{{ sellissimo:products }}
<h2>{{ title }}</h2>
<p>{{ price | sellissimo_money }}</p>
{{ sellissimo:add_item :sku="sku" }}
<label>Quantity <input name="quantity" type="number" min="1" value="1"></label>
<button>Add to cart</button>
{{ /sellissimo:add_item }}
{{ /sellissimo:products }}
{{ /nocache }}
The form tag generates its action and CSRF field. Add the product in a browser, then inspect the cart below. The form tags work independently of the optional /shop frontend.
Display or update the cart#
{{ nocache }}
{{ sellissimo:cart }}
{{ lines }}
<p>{{ title }} · {{ total | sellissimo_money }}</p>
{{ sellissimo:update_item :sku="sku" :line_key="key" }}
<label>Quantity <input name="quantity" type="number" min="0" value="{{ qty }}"></label>
<button>Update</button>
{{ /sellissimo:update_item }}
{{ /lines }}
{{ /sellissimo:cart }}
{{ /nocache }}
Adding increments the quantity. Updating sets it exactly, and zero removes the line. Keep the line key for personalized items. On a multisite store, pass the same site handle on the cart, forms, and order history.
For account history use sellissimo:orders and the returned receipt_url. For the built-in checkout enable SELLISSIMO_STOREFRONT=true and link to the configured shop prefix. Override individual package views in resources/views/vendor/sellissimo. For a separate frontend, follow the JSON API guide.