Remove "add to cart" when sold out

Hi everyone!

I was wondering if one of you could help me with the dawn theme…

I wanted the "add to card " bottom so edited the code on section “product-card.liquid” and added at the bottom the following text:

My problem now is that the “add to card” bottom still shows for items that are not available anymore… is there a way to solve this?

Thanks a lot

Hi [email removed]Olimpia27,

This is Victor from PageFly - Landing Page Builder App

you can add new code


Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

Thanks for your help Victor!

The add to card button disappeared for sold out items, but instead I have now the text

"style="margin-top:10px; margin-left:25%; margin-right:25%; border-radius:20px; “/>”

I have now edited your code and it actually worked! Thank you

The for I used is:

{% if product_card_product.available %}

<input type=“submit” value=“Add to cart” class=“button”
{% endif %}

<style= “hidden” name= "margin-top:10px;

margin-left:25%;

margin-right:25%;

border-radius:20px;

"/>

you can try it


It works just fine!!! :slightly_smiling_face:

you are welcome. I am glad when can help you :heart_eyes:

1 Like