Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shop:onAddToCart does not work on cart page. #26

Open
marc-schroth opened this issue Dec 10, 2017 · 0 comments
Open

shop:onAddToCart does not work on cart page. #26

marc-schroth opened this issue Dec 10, 2017 · 0 comments

Comments

@marc-schroth
Copy link

Trying to make cross-sells and upsells addable to the cart while viewing the cart.

Documentation and other existing themes I've found only show how to do so while on a product page, using shop:onAddToCart.

Having initially tried that, I was finding that trying to reload the cart-page partial afterwards would result in nothing at all being shown in the cart until the user reloads the page. I contacted support and received this response:

Hey Marc,
I changed the data-ajax-handler from shop:onAddToCart  to shop:cart.

Reasons for this:
It also handles upsell card adds, given the upsellId and productId  parameters.
It yields cart variables, which are rendered in the temlaplates you specified.
shop:onAddToCart  does not offer these variables in rendering the requested templates.

This should now work - please test to confirm, and let me know if you have any questions.Thanks,Andy
--

This does indeed work, but at the time I was only trying to provide upsells on the cart page. Now that I'm also trying to provide cross-sells, I'm finding that sending the request with shop:cart doesn't seem to work on either the product page OR the cart page. The product simply isn't added to the cart.

Suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant