SO i have Created a section that renders products, but when i click add to cart it redirects to cart page. I want to create a ajax add to cart button, that when clicked will show the products in the cart and update the cart count total.
Pretty much dawns quick add for the collections but in my own custom section.
Thank you in advance.
Section
{% if section.settings.product_display_collection %}
{% assign product_limit = section.settings.product_display_limit | default: 4 %}
{% assign collection_handle = section.settings.product_display_collection.handle %}
{% assign collection = collections[collection_handle] %}
{% if collection.products.size > 0 %}
{% for product in collection.products limit: product_limit %}
### {{ product.title }}
{{ product.price | money }}
{% endfor %}
{% else %}
No products in the selected collection.
{% endif %}
{% else %}
No collection selected.
{% endif %}
{% if section.settings.product_display_image %}
{% else %}
No image selected.
{% endif %}