0

my add to cart not working, its showing nothing in cart for 2 stores and for 1 store adding a default product everytime, doesn't matter which product we added, its showing this exception....

We can't add above item to cart.Please contact administratorThe product wasn't found. Verify the product and try again.

i have checked my code is fine, its working on local setup and dev server, just issue is on production,

i have tried with cookie lifetime increase and permission settings on directories but none worked.. do it need some more cookie or session changes which can be done ?

can any body share any idea or solution with some details ??

  • try this solution /vendor/magento/zendframework1/library/Zend/Cache/Backend and edit the file.php Search for 'cache_dir' => null, and replace it with 'cache_dir' => 'var/cache'... – Mohit Patel May 29 at 18:05
  • i have already tried this but not worked – Bilal Amjad May 29 at 18:08
  • after you are this link --- magento.stackexchange.com/a/235485/85907 ??? – Mohit Patel May 29 at 18:10
  • opposite to this link issue, mine is working on product detail page, but not working on List page. and regarding ownership: all directories already have www:data ownership – Bilal Amjad May 29 at 20:00
0

This happens due to change in the domain as Magento 2 stores root URL in the third path without affecting the first version.

To resolve the issue, try to run additional SQL query:

UPDATE core_config_data
SET value = REPLACE(value, '<old root URL or domain>', '<new root URL or domain>')
WHERE path = 'design/head/includes';

and then clear the cache by using this command:

rm -rf var/cache/*

Hope it works for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.