verbb / snipcart

A Craft CMS plugin to integrate with Snipcart.
Other
21 stars 9 forks source link

Template Tags 'Cart Button' doesn't work with named arguments #16

Closed handplant closed 4 years ago

handplant commented 4 years ago

When I use the following template tag as described in the documentation, I get an error in Twig.

Tag {{ craft.snipcart.cartLink(text='Shopping Cart', showCount=true) }}

Error Arguments must be separated by a comma. Unexpected token "operator" of value "=" ("punctuation" expected with value ",").

Craft Version Craft Pro 3.4.27

Snipcart Plugin Version 1.3.4

Twig version 2.12.5

mattstein commented 4 years ago

Thanks for the issue, @handplant!

You probably already know, but you can use that tag without named arguments and it will work as expected:

{{ craft.snipcart.cartLink("Shopping Cart", true) }}

I’ll get that fixed so named arguments are still an option.

handplant commented 4 years ago

Works! Thx

mattstein commented 4 years ago

Happy to help! I’m going to leave this open until I can fix the named argument functionality as documented.

mattstein commented 4 years ago

It turns out that’s not possible without changing the API, so I’ve fixed the docs instead. Sorry for the confusion!