All things Shopify and commerce
I created a custom metafild in shopify to add a suggested product to the product page.
I have added the code to my product template and I am correctly displaying the suggested product.
I want to add the add to cart button for this suggested product so that the user can add the suggested product to the cart without entering the specific page.
<div class = "groups-btn">
{% if current_variant.available%}
<input data-btn-addToCart type = "submit" name = "add" class = "btn" id = "product-add-to-cart" value = "add" data-form-id = "# add-to- cart-form ">
{% endif%}
</div>
With this code, however, I add the main product (the one on the page) to the cart, not the suggested product.
How can I solve my problem?
Thanks
User | RANK |
---|---|
20 | |
18 | |
17 | |
14 | |
12 |
Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023