Why isn't my add to cart button functioning?

Solved

Why isn't my add to cart button functioning?

Danieln0
New Member
5 0 0

Hi 

can any one help me out, my add to cart button is not working 

dawn them 

Accepted Solution (1)
Moira
Shopify Staff
2118 231 339

This is an accepted solution.

@Danieln0,

Shopify knows that errors are just human nature, so we have provided a way to undo changes made to a code file in your theme over time. Rather than trying to re-implement your product code, my first suggestion is to try rolling back your .liquid files individually to a time and date before you made the changes.

  • From your Shopify admin, go to Online Store > Themes.

  • Find the theme you want to edit, and then click Actions > Edit code.

  • Click on one of the files under the relevant folder in which you want to undo changes.

  • Click Older versions next to the file name

21-10-4f7cd-5bw8x

  • Click the drop-down menu to select an older version. Clicking a date stamp will roll the code back to that saved version. If you remember when you made the changes, you can return to the state of the file before your changes.

21-10-3umra-1c9af

  • If you remember when you made the changes, you can return to the state of the file before your changes. Finally, don't forget to hit that green save button!

TIP: We always suggest you first duplicate the theme and work in the duplicate. That way you can always go back to your previous version.

Once you have managed to roll back to a previously saved version of your theme, we can then work on implementing the correct code needed to arrange your product description to full- width.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 58 (58)

Moira
Shopify Staff
2118 231 339

Hey @Danieln0,

I'd love to understand a bit more about this in order to help you out!

Any added context that you can provide will greatly help us pinpoint where the issue is stemming from and what steps we can take next:

  • Has the "Add to cart" button worked at all whilst using the Dawn theme or has it stopped working recently?

  • Have you made any adjustments to your website? Such as edited your theme code or installed/uninstalled any apps?

  • Do you mind sharing your website URL?

Since we're not currently experiencing any known issues impacting product pages or the checkout, I'd be curious to know if we can isolate the issue to your device or browser. Would you mind testing a few things for me?

  • Clear your cache and cookies - When you use a browser, like Chrome, it saves some information from websites in its cache and cookies. Clearing them fixes certain problems, like loading or formatting issues on sites.

  • Ensure your browser is up to date.

  • Try an Incognito window.

  • Try another browser (e.g. Safari).

  • Log in to your Shopify mobile app and try adding a product to your cart.

  • Try completing the same steps on your phone, using data rather than WiFi.

Looking forward to hearing how that goes!

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Danieln0
New Member
5 0 0

HI @Moira 

yes the add to cart was walking okay but I change some code because I was try to arrange my product description to full- width after that my add to cart stopped to working 

https://carecoddle.com

password : prowhi 

 

Moira
Shopify Staff
2118 231 339

This is an accepted solution.

@Danieln0,

Shopify knows that errors are just human nature, so we have provided a way to undo changes made to a code file in your theme over time. Rather than trying to re-implement your product code, my first suggestion is to try rolling back your .liquid files individually to a time and date before you made the changes.

  • From your Shopify admin, go to Online Store > Themes.

  • Find the theme you want to edit, and then click Actions > Edit code.

  • Click on one of the files under the relevant folder in which you want to undo changes.

  • Click Older versions next to the file name

21-10-4f7cd-5bw8x

  • Click the drop-down menu to select an older version. Clicking a date stamp will roll the code back to that saved version. If you remember when you made the changes, you can return to the state of the file before your changes.

21-10-3umra-1c9af

  • If you remember when you made the changes, you can return to the state of the file before your changes. Finally, don't forget to hit that green save button!

TIP: We always suggest you first duplicate the theme and work in the duplicate. That way you can always go back to your previous version.

Once you have managed to roll back to a previously saved version of your theme, we can then work on implementing the correct code needed to arrange your product description to full- width.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Danieln0
New Member
5 0 0

Hi @Moira 

Thanks I reversed the process place can you help me to make my product description full-width 

Moira
Shopify Staff
2118 231 339

@Danieln0,

Head to Online Store -> Themes -> Edit code -> Assets -> theme.scss.liquid and paste this code at the end of the file:

@media screen and (min-width: 990px) {
.product:not(.product--no-media):not(.featured-product) .product__info-wrapper {
    max-width: 70% !important;
    width: 70% !important;
}
}

As I do not have access to your theme editor, I highly suggest posting your request on the following community thread:

A Shopify Expert will be able to access your store directly and implement the code for you.

All the best,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

mike1231
Shopify Partner
9 0 0

what folder or template or file do I need to undone I can't see on the screenshot

Moira
Shopify Staff
2118 231 339

Hey @mike1231, this depends on which section you made adjustments to. Are you wanting to revert the changes you made to your product description? 

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Blastiffy
Visitor
1 0 0

THANK YOU

Moira
Shopify Staff
2118 231 339

Glad you found this thread helpful @Blastiffy! Don't hesitate to reach back out if you require any further assistance as you continue to work on your store. 

All the best,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Guarazez
New Member
4 0 0

I am currently having this same issue but I have not make any changes to the codes. I have try all the above as well like using other browsers, clear cache but the cart page keep refreshing only.

Moira
Shopify Staff
2118 231 339

Hey @Guarazez,

 

Sorry to hear you are facing this issue, would you mind sharing your store URL so I can take a closer look?

 

Look forward to hearing from you!

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Bill40
Visitor
1 0 0

Would you be able to look at my URL...Divide theme. I can't get my add to cart button to work. It can add additional numbers of items, but then just stays on that section, and will not move to added to cart section, etc. Please help and thank you.

https://www.hipsterpugs.com

 

SilenceSpeaks
New Member
4 0 0

my add to cart button isn't working 

https://silencespeaks.shop/

keele
Visitor
1 0 0

hey im having the same issue with my website the add to cart button not working i have not changed anything 

thezerowastepeople.com.au

 

Sophia
Shopify Staff
1786 118 237

Hey, there! If you haven't made any coding changes that you can undo, please contact Shopify Support via the Help Center so we can investigate.

Sophia | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

LANORABAGS
Visitor
3 0 0

I am having an issue with my add to cart . Using zeexo theme.  1) doesnt add products to the store 2) when i click on The cart icon nothing opens up... i did change pictures on the website but mot sure of that also has effect on this. 

Moira
Shopify Staff
2118 231 339

Hey @LANORABAGS,

 

Without being able to see your store, it's difficult for me to establish what is happening. Would you mind sharing your website URL with me so I can take a closer look?

 

Look forward to hearing from you!

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

LANORABAGS
Visitor
3 0 0
Moira
Shopify Staff
2118 231 339

@LANORABAGS 

I just took a look at your website and am able to successfully add products to my cart and reach checkout, are you still having trouble with this on your end? What browser are you currently operating on?


Cart.gif

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

in56
Visitor
1 0 0

Hi add to cart button not working, have not changed any code, please help

Moira
Shopify Staff
2118 231 339

Hey @in56, would you mind sharing your website URL so I can take a closer look? Thanks,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Shariesa_Taylor
Shopify Partner
8 0 0

Hi, I’m not sure if you’re still available but I’m working on a site (with the craft theme) for a client and encountered the add to cart button issue too. I’ve tried about everything in the book but nothing has worked. Would you be able to help? 

https://aromatics-by-j-renee.myshopify.com/products/wickless-candle-bundle

PW: giaste 

Moira
Shopify Staff
2118 231 339

Hey @Shariesa_Taylor!

 

Are you still running into trouble with this issue? I just had a look at your store and managed to successfully add multiple products to the cart:22-11-mykpf-uf391

 

Let me know if you found a solution to your query,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

YoanRincon
Shopify Partner
2 0 0

Hello, i have the same problem, my shop is https://gorettymedinac.com/

Moira
Shopify Staff
2118 231 339

Hey @YoanRincon,

 

Were you able to resolve this issue? I just had a look at your website and was able to successfully add items to my cart: 

 

22-12-6xa6d-d51jj

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Annette7
Visitor
1 0 0

Hi Moira,

 

I seem to have the same problem. All of a sudden the add to cart button doesn’t work anymore. Could you please help me?

 

www.mylittlepuggles.co.uk

 

Thank you! 

Annette 

Moira
Shopify Staff
2118 231 339

Hey @Annette7,

 

I just had a look at your website and was able to successfully add items to my cart: 

 

22-12-kxajh-t63ld

 

What browser are you using? It's possible you may need the cache clearedWhen you use a browser, like Chrome, it saves some information from websites in its cache and cookies. Clearing them fixes certain problems, like loading or formatting issues on sites.  

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

NoorahGifts
Visitor
3 0 0

Hi Moira, I am also encountering the same issue with my website. The add to cart button does not seem to be working. 

This is my website URL 

 

https://www.noorahgifts.com/

 

Moira
Shopify Staff
2118 231 339

Hey @NoorahGifts,

 

I just had a look at your website and was able to successfully add items to my cart: 

 

23-01-cynaq-mdwik

 

Were you able to resolve this issue?

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Pramish37
Visitor
1 0 0

Hi @Moira, I am facing a similar issue in the Dawn theme. When I click on "Add to cart", the item gets added but it won't update to "Item added to cart". I check the setting and it's okay. Website url: https://cryptofashion.us

Also, when I click on Size in same page, both the buttons "Add to cart", and "Buy with Paypal" blink.

Moira
Shopify Staff
2118 231 339

Hey @Pramish37,

 

Do you have any third-party product apps installed within your store? These can sometimes affect the functionality of the cart.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

maximira
Visitor
2 0 0

I have the same problem.

My website is maximiramontezuma.com would you mind taking a look?

Greta
Shopify Staff
1242 132 164

Hi, @maximira!

 

Thanks for reaching out. I checked out your store and it looks like I am able to add a product to the cart, however the button seems to be the same color as the background, as shown here:

 

 

I recommend adjusting your theme colors by following the instructions in this help document

 

Please let me know if you have any other questions! 

Greta | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ShirtHappens
Visitor
1 0 0

Hi,can you help me too?..the add to cart button just keeps loading and nothing happens

 

I use Sense theme

 

shirthappensbm.com 

psw: baychu

Erin
Shopify Staff
1116 138 179

Hi, @ShirtHappens. I took a look at your store and your 'add to cart' button was working correctly for me. Is this still happening on your end? If so, I'd recommend testing this out using a different browser, device, and/or internet connection to pinpoint the cause of this. You can also contact our support team here and we'd be happy to take a look at it with you in more detail.

Erin | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

bbd95a
Visitor
2 0 0

Hi

I am also facing the same issue where my Add To Cart button is not working in DAWN theme

 

I have not made any changes to the code and have tried the above mentioned solutions (different browser, switching wifi) but it is still not working

 

desperately need help

 

My store name is peachyboo.in

NoorahGifts
Visitor
3 0 0
I just clicked your store. It is working for me. I tried to add things to
the cart and it was successful.
Moira
Shopify Staff
2118 231 339

Hey @bbd95a,

 

I just took a look at your store peachyboo.in and have no trouble adding items to my cart via Google Chrome. Are you still facing issues on your end?

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

bbd95a
Visitor
2 0 0
Hey

Its fixed now
Thanks
Moira
Shopify Staff
2118 231 339

Don't hesitate to reach back out if you require any further assistance as you continue to work on your store. 

All the best,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

3Patch
New Member
5 0 0

Hi Moria,

 

I cannot see my "Add to Cart" button because it is solid white. I've tried changing it's color in the theme color settings but it hasn't worked. I believe it only affects the "Shop Pay" button.

 

Here's an example page from my site: https://flowera.art/products/mushrooms-are-down-to-earth-black-bleached-hoodie

 

 

Seamossfactory
New Member
5 0 0

Hi can you help me?

 

The add to cart button doesnt work suddenly after years.

I didnt changed the code.

This problem is going on for a month i think.

My website is www.theseamosslab.com.

Theme is minimal and i have a pagebuilder: LayoutHub.

Moira
Shopify Staff
2118 231 339

Hey @Seamossfactory,

 

Have you tried disabling your page builder? I have seen many cases where this has interfered with the cart and checkout pages. 

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

zikria
Visitor
1 0 0

Hi There,

 

I am also facing the same issue. Here is an error log from Google Console:

 

TypeError: Cannot read properties of null (reading 'cart-notification-product')
    at cart-notification.js?v=110464945634282900951684607898:53:56
    at Array.forEach (<anonymous>)
    at HTMLElement.renderContents (cart-notification.js?v=110464945634282900951684607898:51:34)
    at product-form.js?v=154520108827843999331684607899:54:33
(anonymous) @ product-form.js?v=154520108827843999331684607899:58
Promise.catch (async)
onSubmitHandler @ product-form.js?v=154520108827843999331684607899:57

 

And here is the link to the site as well:

 

Best baby product store 

 

Please have a look.

 

Thanks,

Zikria

 

 

Moira
Shopify Staff
2118 231 339

To fix this issue, you need to ensure that the object being accessed is not null before trying to access its properties. You can do this by checking if the object exists before using it in the code. It is likely related to the cart or notifications functionality on your website.

 

You should review the cart-notification.js file and check if there is a variable named 'cart-notification-product' that might be null. Add a condition to check if this variable is not null before accessing its properties, and handle any null cases appropriately.

 

Additionally, take a look at the product-form.js file on line 54, as it seems to be related to the error. Ensure that it doesn't interfere with the cart-notification logic.

Remember to examine the surrounding code and make the necessary changes to fix the issue.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Born-2B-Free
Visitor
2 0 0

Hello - I am also having this issue.

I've tried different browsers, incognito, mobile etc.

When you click the add to cart button, nothing happens. 

It is most prints, it seems occasionally it will work on an item, but mostly it doesn't.

 

Also using Dawn

 

www.born2bfreeapparel.com

GamerHouseMx
Visitor
1 0 0

Hi there, same problem over here, add to cart button randomly works, then not. Have not move any coding, my actual theme is Dawn 9.0. Tried all the solutions in this post, and randomly working sometimes, not sure of what depends. Store at: https://gamerhouse.com.mx

 

Note: I have Bundle Builder Shopify App installed from quite sometime, and never happened something like this. But, I noticed when adding a bundle created with this app the cart functionality is recovered. To try it out reach here: https://gamerhouse.com.mx/apps/bundles/bundle/128893

KanishkT
Shopify Partner
32 0 11

Hey @Danieln0

I am glad that you found the solution for your add-to-cart button not working problem. Even though this question was posted a way back, there are still many store owners that are facing this issue on a regular basis. I am just commenting to help anyone who's facing the same issue with their stores.

To troubleshoot and fix this issue, you should know a few things:

  1. What is 'add-to-cart not working' error and why is it displayed in your store?
  2. Types of add-to-cart issues
  3. It's impact on your store and on your customers
  4. How to prevent it 
  5. and How to fix it with the proper steps.

I have written this detailed article addressing all these points and providing a solution:
How To Fix ‘Add-To-Cart Not Working’ issue in Shopify?


Do check and let me know if you find it helpful. I hope this helps!

Warm Regards,
Kanishk

Marketing Manager at Wholesale Helper
App Store - https://apps.shopify.com/partners/goldj
Website - https://wholesalehelper.io/
Seamossfactory
New Member
5 0 0

Hi can you help me please.

 

The add to cart button doesnt work suddenly after years. I didnt changed the code.

This problem is going on for a month i think.

My website is www.theseamosslab.com.

Theme is minimal and i have a pagebuilder: LayoutHub.