Why does my 'Add to Cart' button give an error message?

When i want to add a product to my shopping cart i get this error message:

What happened?Parameter Missing or Invalid: Required parameter missing or invalid: items

i don’t know what i did wrong in my code maybe somebody can help me out, here is the code:


    {% for product in collections.frontpage.products %}
        
    {% endfor %}

@rafikdev

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

The site isn’t live yet, so i temporarily put down password protection.

It is the button you view on the homepage, you have the be on desktop to view the button i disabled the button for phone.

site: https://maravillafragrance.myshopify.com/

Hope you can help me out thanks

@rafikdev

can you try this code


Thank you very much, this is the correct solution

very exciting!!!