You're viewing the documentation of an older Simple Commerce version. Consider upgrading to the latest for new features and bug fixes.

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, we have 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 we recommend doing. We love Antlers so it's likley all we're going to be supporting for the time being.

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 }}
Last updated 1 month ago Improve this page on GitHub!