Find in cart
This works much like the in_cart
tag, except this is a tag pair.
Use this if you’d like to be able to modify the matched product in the cart. The {{ cart_key }}
variable becomes available to you.
This could be useful if you want to toggle the item in the cart from the product’s page.
Example
{{ bison:find_in_cart product="/products/t-shirt" price="5" extra="size:small|color:blue" }}
{{ if in_cart }}
You have one in your cart.
<a href="/cart/remove?item={{ cart_key }}">Remove it</a>
{{ else }}
You don't have one.
<a href="{{ bison:add_to_cart_link url="/cart/add" product="{{ url }}" price="5" extra="size:small|color:blue" }}">Add one</a>
{{ endif }}
{{ /bison:find_in_cart }}
Note that there is no parameter issue when using this tag. You can use price and separate keys in extra
with :
s.
Problem with this page? Edit it on Github.