cancel
Showing results for 
Search instead for 
Did you mean: 

Add to Cart not working

SOLVED

Add to Cart not working

None of my products will add to cart, if you look at an example page:

 

https://mrwhitewarefoh.co.uk/cutlery/flair.html

 

and try for yourself you see it just hangs.

 

I checked the process in Google Chrome developer tools and got this error readout:

 

jquery.min.js:627 POST https://mrwhitewarefoh.co.uk/cartpro/cart/add 503 ()
send @ jquery.min.js:627
ajax @ jquery.min.js:603
_addCart @ flair.html:416
(anonymous) @ flair.html:308
dispatch @ jquery.min.js:309
elemData.handle @ jquery.min.js:282

 

I've been having some issues with some file/folder ownership and permissions recently (long story), could this be related?

 

Any help would be appreciated

4 REPLIES

Re: Add to Cart not working

There has been an error processing your request.png

 

Yes , above i have attached screenshot of it . it is permission issue. var/generation directory is not writable.

 

so kindly give writable permission to you var directory.

 

below is the command to give permission.

 

find ./var -type d -exec chmod 777 {} \;                // 777 permission for var folder    

find ./pub/media -type d -exec chmod 777 {} \;

find ./pub/static -type d -exec chmod 777 {} \

 

Then run php bin/magento setup:di:compile and php bin/magento setup:static-content:deploy -f command again !!

 

After that clear your cache by running php bin/magento cache:clean and php bin/magento cache:flush command

 

it will works !!

 

 

if issue solved,Click Kudos & Accept as Solution

Re: Add to Cart not working

Your link has an issue related to permission.

Please give below permission to your magento store using CLI,

 

find app/code pub/static var/generation var/di var/view_preprocessed vendor \( -type f -or -type d \) -exec chmod u-w {} \; && chmod o-rwx app/etc/env.php && chmod u+x bin/magento

After given permisson run cache flush command to see your changes,

php bin/magento cache:flush
If Issue Solved, Click Kudos/Accept As solutions.

Re: Add to Cart not working

This solutions was partly correct but I found a big bunch of folders/files missing from my theme file.

So I had to run:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy en_GB
php bin/magento cache:flush
chmod -R 777 pub
chmod -R 777 var
chmod -R 777 app

But I had to do it from inside the Plesk 'Scheduled Tasks > Run PHP Script' as the SSH PHP version was wrong.

All sorted now, thanks.

Re: Add to Cart not working

Glad To know that you have Resolved your issue !! Happy to help and keep helping Smiley Happy

 

 

 

if issue solved,Click Kudos & Accept as Solution