2

When I add a product to my cart I get the following error:

No such entity with id = 0

This happens with every product in the store, can anyone help point me in the right direction?

  • Seems Session/Cookie Issue – Ankit Shah Apr 25 '17 at 9:57
  • Please check my answer, it will help you in the right direction. @Tom – Dhaduk Mitesh Mar 26 '18 at 10:25
3

Please check customer_group table for "NOT LOGGED IN" group.

If its customer_group_id is not zero, truncate table

  1. catalog_product_index_price and
  2. catalog_product_index_tier_price.

Then run following query.

UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
2

Please check customer_group table in Magento2 database.

Check NOT LOGGED IN value in customer_group_code field. If it's not available in that field, that means the customer cannot add to cart product without sign-in.

And if 'NOT LOGGED IN' value available in that field then set itscustomer_group_id '0'.

First, you need to sign-in and then Add to Cart.

This work for me properly. I hope this will help you.

1

"This worked for me, after trying everything:

Assuming your site is in Developer Mode, you can change it to Production Mode, clear/flush cache and then switch back to Developer Mode."

THIS WORKED FOR ME IT'S LIFE SAVER! THANK YOU!!

0

I had missing General group with id = 1 in the customer_group table. After adding of the group, products started to get added and no error message anymore.

0

This worked for me, after trying everything:

Assuming your site is in Developer Mode, you can change it to Production Mode, clear/flush cache and then switch back to Developer Mode.

I had this issue in the front end, as I recently moved the database from one server to another. I managed to solve it by doing this.

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.