How to add a cart button to a product (Debut)??

ermyv
Explorer
65 0 28

Hello everyone!
I added a new section to the site, this section with the best sellers. But the products do not have an add to cart button, but I really need it !!!
Please help me to make it!

Снимок экрана 2021-11-15 в 12.33.25.png

Снимок экрана 2021-11-15 в 12.33.25 — копия.png

Replies 2 (2)
KetanKumar
Shopify Partner
25061 2508 9072

@ermyv 

yes please try this code

From Shopify Admin select Online Store and click on Themes
Choose your main theme
Click the . . . on the top left-right (see below) and hit Edit code
Open Snippets -> product-card-grid.liquid File and paste below code at the end of the page.
<form method="post" action="/cart/add">
  <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
  <input type="submit" value="Add to cart" class="btn" />
</form>
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Akibhusen
Trailblazer
263 45 77

@ermyv wrote:

Hello everyone!
I added a new section to the site, this section with the best sellers. But the products do not have an add to cart button, but I really need it !!!
Please help me to make it!

Снимок экрана 2021-11-15 в 12.33.25.png

Снимок экрана 2021-11-15 в 12.33.25 — копия.png


Can you please share the URL? And I think it's needed some code changes. Needed some Liquid code knowledge for template update.

Akibhusen Shekh | Shopify Developer
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution