# Template Tags
# Cart Snippet
{# include Snipcart JS #}
{{ craft.snipcart.cartSnippet }}
There are three optional arguments:
includejQuery
istrue
by default and will also render a<script>
tag for loading jQuery. Disable to include it yourself, just be sure it’s compatible with Snipcart (opens new window).onload
can be a value to set for the Snipcart tag’sonload
property.includeStyles
istrue
by default, and iffalse
will not render the<link>
tag that loads Snipcart’s base stylesheet.
{# include Snipcart JS + optional arguments #}
{{ craft.snipcart.cartSnippet(true, '', true) }}
# Cart Button
{# View Cart #}
{{ craft.snipcart.cartLink }}
There are two optional arguments:
text
can be used to change the button's inner text, which defaults to “Shopping Cart”.showCount
istrue
by default and includes a<span>
element classed withsnipcart-total-items
which Snipcart will populate with the number of items in the shopping cart.
{# View Cart + optional arguments #}
{{ craft.snipcart.cartLink('Shopping Cart', true) }}