cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 cannot remove item form cart after upgrade php version

SOLVED

Magento 2 cannot remove item form cart after upgrade php version

I cannot remove the item form shopping cart after I upgrade the php version form 7.1.24 to 7.1.28.

The shopping cart didn't have any problem before the php upgrade.

Any idea?

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 cannot remove item form cart after upgrade php version

Hello @cheung_hoi ching2 

 

seems like form key issue

 

if you go to https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Checkout/Controller/Sidebar/Re...

and 

if (!$this->getFormKeyValidator()->validate($this->getRequest())) {
            return $this->resultRedirectFactory->create()->setPath('*/cart/');
        }

remove this code and check it.

if works then form key issue

 

if works then mark as solution,


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

View solution in original post

12 REPLIES 12

Re: Magento 2 cannot remove item form cart after upgrade php version

Hello @cheung_hoi ching2 

 

can you please check log file for same?

 

 


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

Re: Magento 2 cannot remove item form cart after upgrade php version

There are no error msg when I click the delete button.

The problem is the item cannot remove after I click the delete button.

Also the "remove all ite in cart" is not work too.

And there is no log about those problem.

Many thanks!

Re: Magento 2 cannot remove item form cart after upgrade php version

Hello @cheung_hoi ching2 

 

can you check with luma theme, may be your theme does not contain form key so that's why happen

 

 


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

Re: Magento 2 cannot remove item form cart after upgrade php version

Thanks.

But how to check the theme form key.

Also, why the problem happen after the php upgrade.

Many thanks!

Re: Magento 2 cannot remove item form cart after upgrade php version

Something like JSON.stringify(error) in Console

Re: Magento 2 cannot remove item form cart after upgrade php version

Below msg showed in console when I click delete item which is not find before php upgrade

https://imgur.com/a/kEIBHMW

Re: Magento 2 cannot remove item form cart after upgrade php version

Hello @cheung_hoi ching2 

 

have you did any customize into minicart.js?

 

try to enable luma theme and check it

 

 


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

Re: Magento 2 cannot remove item form cart after upgrade php version

I'm trying to use luma

but there another error when I add item to cart

Many thanks!!

https://imgur.com/a/Ephm8xV

Re: Magento 2 cannot remove item form cart after upgrade php version

I have find below error when I click delete.

The 302 not found of remove item.

Any solve idea?

Many thanks!!!

https://imgur.com/a/Cv7uWTQ