5

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?

2
  • Seems Session/Cookie Issue
    – Jackson
    Commented Apr 25, 2017 at 9:57
  • Please check my answer, it will help you in the right direction. @Tom Commented Mar 26, 2018 at 10:25

5 Answers 5

7

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.

2

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.

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

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 and acknowledge you have read our privacy policy.

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