Liquid, JavaScript, themes, sales channels
Hello all,
I am using the Prestige theme for my store and I am curious what the best way to go about adding an "Add to Cart" button to a custom page template and retaining the ajax add to cart functionality. Currently, when you click the "Add to Cart" button you are taken to /cart even though my theme setting is set to cart type: drawer.
The cart is empty and the cart icon does not display the red notification dot that signifies an item is in your cart.
When you navigate anywhere else on the site the cart is not updated with the item you added from this custom page template. BUT if you were to navigate back to the page using this custom template the cart shows the item you added.
What I have is a custom page template with a number of sections.
Like so: page.custom-template.liquid
{% section 'page-hero' %}
{% section 'page-intro' %}
{% section 'page-featured-product' %}
...
Within the "page-featured-product section", I am using a "form" liquid tag.
Solved! Go to the solution
This is an accepted solution.
Hello,
In Prestige theme check custom.js under Assets there you will find the hint to implement ajax cart in collection/custom page.
Thanks
This is an accepted solution.
Hello,
In Prestige theme check custom.js under Assets there you will find the hint to implement ajax cart in collection/custom page.
Thanks
@Guleria , you are correct. I completely forgot about the comments in that file. Thank you
User | RANK |
---|---|
38 | |
29 | |
13 | |
12 | |
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