To help you integrate Simple Commerce into your Antlers templates, Simple Commerce provides various tags:
#Form Tags
Some Simple Commerce tags output <form>
elements that submit to Simple Commerce endpoints. There's a couple of optional parameters you can add to form tags.
-
redirect
- the URL where you'd like to redirect the user after a successful form submission.
{{ sc:cart:addItem redirect="/cart" }}
<input type="hidden" name="product" value="{{ id }}">
<input type="hidden" name="quantity" value="1">
<button class="button-primary">Add to Cart</button>
{{ /sc:cart:addItem }}
#Support for Blade & Twig
At the moment, I've got no plans to introduce first-party support for using Laravel Blade or Twig as templating languages with Simple Commerce.
While I'm sure it can be done, it's not something that I'd recommend doing. Personally, I'm a huge fan of Antlers, so it's not something I'm planning on supporting any time soon.
#Alias
If you'd prefer not to use the shorthand of sc
in your tags, you can also use simple-commerce
which will work the same way.
This could be used to give more context of the tag in use to make it clear it's dealing with Simple Commerce.
{{ simple-commerce:countries }}