Request: More documentation on Cartfox
Closed this issue · 2 comments
Struggling to find answers for some of these questions.
-
Currently the cart content gets overwritten by the handlebars script whenever Cartfox gets triggered. So any alteration to the cart must be done twice. Why?
-
What are these selectors used for?
emptyTemplate: '[data-cart-template]',
itemsContainer: '[data-item-container]' -
Is there anyway to add/remove/update items in Javascript? similar to how its done in CartJS.
Ex. CartJS.addItem(1245112,1); -
If I had a button like below and I use the and I change the qty value using javascript to 3. It will continue to add just 1 instead of 3. So does Cartfox only look at the attributes at the time of when the page is loaded?
<button data-quick-add="1245123" data-quick-add-qty="1">Quick Add</button>
Sorry for all the questions. I really like this framework and want to use it effectively.
- Handlebars is the method that we chose for dynamically updating the content. The reason there is a liquid template for the cart too is so that the cart is ready on page load and doesn't need to wait for handlebars.
Check out the docs here: http://handlebarsjs.com/
-
emptyTemplate is used to define the element which holds the handlebars template.
itemsContainer is the element that the rendered items will be appended to. -
Yes. cart.addItem(variantid)
-
Not sure haven't tested that to be honest. Will give it a go and let you know. But usually the quick add button wouldn't be used for this sort of thing. Would recommend using name="quantity" selector in conjunction with data-add-to-cart button
Thanks for the comment. This is really helpful 👍