Skip to content

How to remove 1 item from the cart #1192

Closed Answered by Oleafeon
Oleafeon asked this question in Help
Discussion options

You must be logged in to vote

Okay i made the following to get it working thanks @duncanmcclean

{{ if quantity > 1 }}
{{ sc:cart:updateItem :item="id" }}
<input type="hidden" name="quantity" value="{{ quantity - 1 }}">
<button class="btn btn-custom change-quantity">-</button>
{{ /sc:cart:updateItem }}
{{ else }}
{{ sc:cart:removeItem :item="id" }}
<input type="hidden" name="quantity" value="{{ quantity - 1 }}">
<button class="btn btn-custom change-quantity">
    <i class="fas fa-trash text-white"></i>
</button>
{{ /sc:cart:removeItem }}
{{ /if }}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Oleafeon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants