Dawn Theme 4.0 Add to cart and QTY selector on Collections. AJAX Add to cart on collection page

Hi all, I have tried a few solutions from this community to place add to cart buttons and qty selector to collection pages, plus tried deferring the javascript on collection pages so that add an item to the cart updates on the collection page and does not take you directly to the cart page.

None of the code snippets have worked. For example, everyone says to edit; product-card.liquid, but this file does not seem to exist anymore (or has been renamed) to; card-product.liquid and the overall code looks different.

I tried this code in; snippets > card-product.liquid


            
            

and this code in the of theme.liquid;


    {% if template == 'collection' %}
    
    {% endif %}
    

Does anyone have a solution for Dawn version 4.0.0?

Thank you.

1 Like

Hi

There is already an options in theme settings to show add to cart button on Collection page:
inside card-product.liquid file you can see code between this conditions.

{%- if show_quick_add -%}
// Add to cart code here
{% - endif -%}

Thanks
Ahir