Adding item to cart with BigCommerce Stencil

ⅰ亾dé卋堺 提交于 2020-01-06 19:56:53

问题


This question is specific to BigCommerce Stencil. Is it possible to use 'cart-item-add' hook outside of product context?

Right now when user adds product from 'product card' they get sent to cart. I'd like to change that behaviour.


回答1:


I was able to get it working with utils.api.cart.itemAdd()

The issue was my add to cart form action. In the product card I needed to use {{add_to_cart_url}}" instead of {{product.cart_url}}



来源:https://stackoverflow.com/questions/35165847/adding-item-to-cart-with-bigcommerce-stencil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!