Debut Theme: Add to Cart button on homepage/collection pages

Solved
cdanielc
Tourist
16 0 1

Hi,

This question has been raised a few times, but I can't get it up and working (outdated posts?) and I have an additional question regarding the design. 

As I am using Debut theme there is by default no "add to cart" button below the products on the homepage/collection pages. I would like to add an "add to cart" button in the same style as if you would create a Buy button for an external site  (Sales Channels > Buy button > Create a buy button). Please find an image below.

Can anyone help me out? Thanks in advance!

Buy buttonBuy button




Accepted Solution (1)
KetanKumar
Shopify Partner
36688 3633 11881

This is an accepted solution.

@cdanielc 

can you please try this 

Just follow the steps for Debut theme for Add to cart button on collection pages.

  • 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 min="1" type="number" id="quantity" name="quantity" value="1"/>
      <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

View solution in original post

Replies 110 (110)
KetanKumar
Shopify Partner
36688 3633 11881

@moonrise 

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

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

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

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
moonrise
Excursionist
12 0 4

@KetanKumar 

On Desktop add to cart buttons are ok but on mobile look big. I want smaller or maybe thinner

https://www.onthologie.com/

KetanKumar
Shopify Partner
36688 3633 11881

@moonrise 

can you please confirm this look

KetanKumar_0-1625902404096.png

 

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
moonrise
Excursionist
12 0 4

I like the add to cart section like that but is there any way to remove quantity? @KetanKumar 

moonrise
Excursionist
12 0 4

Hi @KetanKumar 

I have been trying to find some solutions but couldn't find any. Would you help me, please?

pinkdiva22
Tourist
3 0 2

Hi,

Is there a way to get the add to cart button and quantity to be inactive when the product is sold out?

 

KetanKumar
Shopify Partner
36688 3633 11881

@pinkdiva22 

yes, please sent  store url?

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
KetanKumar
Shopify Partner
36688 3633 11881

@pinkdiva22 

can you please show me issue images

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
SaraAkil
Tourist
4 0 4

Hello,

 

I want to REMOVE the add to cart button from my collections and homepage. I want the button to appear only on each product page. Ive searched for the answer and couldnt find the solution please help

KetanKumar
Shopify Partner
36688 3633 11881

@SaraAkil 

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

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

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

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
SaraAkil
Tourist
4 0 4
KetanKumar
Shopify Partner
36688 3633 11881

@SaraAkil 

thanks for URL

can you try this code

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.scss.liquid->paste below code at the bottom of the file.

.product-card form {
    display: none;
}

 

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
SaraAkil
Tourist
4 0 4

It worked! Finally! been going at it for 10 days! Thank you!

KetanKumar
Shopify Partner
36688 3633 11881

@SaraAkil 

its my pleasure to help us

 

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
schwaberin
Not applicable
1 0 1

Hello, 

I have also added this code but it doesn't seem to be aligning my add to cart buttons. Currently, the buttons are not aligned because my product titles are different lengths and some take up more lines than others. Could you please help me align my buttons? My site is schwabies.myshopify.com. I appreciate your help.

Thank you, 

Erin

KetanKumar
Shopify Partner
36688 3633 11881

@schwaberin 

yes, please try this code

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.css ->paste below code at the bottom of the file.

 

.product-card__title {
min-height: 50px;
    display: inline-block;
}

 

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
qaiser1
Tourist
5 0 1

can you share the code? @KetanKumar 

KetanKumar
Shopify Partner
36688 3633 11881

@qaiser1 

do you have try

https://community.shopify.com/c/shopify-design/narrative-theme-add-to-cart-on-collection-template/td...

 

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
qaiser1
Tourist
5 0 1

hi ketan, man you are really doing a great job here. helping people. can you help me in the below issue. I have added add to cart button on my homepage and collection pages but its alignment is not right. can you let me know what is the code and where should i put to make it right. so, they all look at the same heidht/width. 

 

 

Capture.jpg

qaiser1
Tourist
5 0 1

@KetanKumar can you help me with this?

 

Shishabuzz
Tourist
4 0 3
##- Hi there. Download an app on your apps page called BUY ME - STICKY BUY BUTTON and follow their steps to do so. Its super easy and there is a LIVE chat support available if you have any questions. -##
KetanKumar
Shopify Partner
36688 3633 11881

@qaiser1 @RamezMehio 

yes, please share store url

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
qaiser1
Tourist
5 0 1

Hi, can you share how did you do this?

 

ginnyst
Tourist
7 0 3

Hello there, I have done this, but on mobile, i have very weird spacing on my buttons. (see photo) Can you advise how to correct that?

 

Thanks

KetanKumar
Shopify Partner
36688 3633 11881

@ginnyst 

sorry for this issue 'bt  i can't see any photos also please share store url

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
ginnyst
Tourist
7 0 3
It is on mobile - ginnystlawrenceart.com thank you!
KetanKumar
Shopify Partner
36688 3633 11881

@ginnyst 

sorry i can't see your attachment bt can you please try this code

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.scss.liquid->paste below code at the bottom of the file.

@media only screen and (max-width: 749px) {
.btn, .shopify-payment-button .shopify-payment-button__button--unbranded {font-size: 12px;}
}

 

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
ginnyst
Tourist
7 0 3
Hi that didn't work unfortunately. If you go to my homescreen on mobile -
ginnystlawrenceart.com you will see all the "add to cart" buttons I
manually added.

When you look at the "view all" it is smudged up against all the other add
to cart buttons, but only on mobile
ginnyst
Tourist
7 0 3

Here is what I am referring to. 

KetanKumar
Shopify Partner
36688 3633 11881

@ginnyst 

do you have like this?

KetanKumar_0-1623392335020.png

 

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
tjacobofficial
Not applicable
2 0 1

Hi there, I'm hoping you can help me with a similar issue. I've followed your instructions to add the cart button, but the buttons are laying right on top of the next row like pictured. Could you help with this? Jacob University Store password: awtsoh

 

Screenshot 2021-06-17 165226.png

KetanKumar
Shopify Partner
36688 3633 11881

@tjacobofficial 

sorry for that issue can you please try this 

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.css ->paste below code at the bottom of the file.
this code apply for after 5 - 6 second

.product-card {margin-bottom: 10px;}
.product-card+form {margin-bottom: 30px;}
.product-card+form input {width: 100%;}

 

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
tjacobofficial
Not applicable
2 0 1

Wonderful, that's perfect! Thank you so much!