cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 cannot add item to cart after php upgrade

SOLVED

Magento 2 cannot add item to cart after php upgrade

Cannot add item to cart but no error msg after the php upgarde.

And the console network showed that magento/ajaxcartpro/cart/ 404 not found when I add item to cart.

Many thanks!

  1. Request URL:
  2. Request Method:
    GET
  3. Status Code:
    404 Not Found
  4. Remote Address:
    222.222.222.22:22
  5. Referrer Policy:
    no-referrer-when-downgrade
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 cannot add item to cart after php upgrade

Hello @cheung_hoi ching2 

 

 

seems like form key issue check that controller is that checking formkey and then is your code passing formkey or not.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

6 REPLIES 6

Re: Magento 2 cannot add item to cart after php upgrade

Hi @cheung_hoi ching2 

 

Can you please confirm that, have you migrated this site from another server?

 

Thanks

Re: Magento 2 cannot add item to cart after php upgrade

Hello @cheung_hoi ching2 

 

 

seems like form key issue check that controller is that checking formkey and then is your code passing formkey or not.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento 2 cannot add item to cart after php upgrade

No, but the apache also upgraded.

 

Re: Magento 2 cannot add item to cart after php upgrade

The first time of add to cart is fine in a incognito window.

But cannot add to cart after that.

Maybe the cart form problem.

 

The error showed in console:

jquery.js:10254 GET https://www.xxxxx/magento/ajaxcartpro/cart/ 404 (Not Found)

 

and in line 10254:   xhr.send( ( options.hasContent && options.data ) || null );

 

Many thanks!

 

 

Re: Magento 2 cannot add item to cart after php upgrade

@PankajS_Magento I am also facing the same issue when migrated from one server to other,Please suggest me what could be cause

Re: Magento 2 cannot add item to cart after php upgrade

Did you find a solution for this? I am facing same issue