Liquid, JavaScript, themes, sales channels
Good day everyone.
I am working with the Dawn theme. While making some customizations I have added the rendering of "accessories" (products marked as relevant in a new metafield on the relevant product settings page). This is similar to the relevant or recommended products fields that were already present.
My goal is to have an small "add to cart" button beneath every "accessory" thumbnail image, which can add said product to the cart without leaving the product page. So far, I managed to send the relevant ID to the add-to-cart functionality which adds the accessory product to the cart correctly, but the page is then redirected to the shopping cart page (which throws a 302 redirect response).
I tried some Googling and looking through this forum, but I came up blank. Can anyone push me in the right direction as to how I can add a product without redirecting to the shopping cart? Maybe some Ajax code to make adding the product a background process? Although I have very little Ajax experience.
Thanks in advance for any tips or advise!
User | RANK |
---|---|
38 | |
28 | |
13 | |
13 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023