Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2017 at 09:24 UTC
Updated:
23 Oct 2019 at 05:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bojanz commentedYes, if you delete data that is in use, you will break things.
There are several open issues about this in the issue queue. To be solved at a later date.
Comment #3
zenimagine commentedThis problem blocks my entire site, do I have to restore it or is there a solution? Thank you
Comment #4
bojanz commentedGo to devel/php and delete the cart order using normal Entity API methods ($order = Order::load($your_id); $order->delete())
Comment #5
zenimagine commentedI do not master devel, can I delete the order directly in the database ?
Comment #6
bojanz commentedI would not recommend it.
Comment #7
zenimagine commentedIn the database, I deleted the problematic order in the following table :
commerce_order
After I went on :
/admin/modules/uninstall
And I clicked on the following two links :
There is content for the entity type: Order item. Remove order items.
There is content for the entity type: Ordre. Remove commandes.
Now the site works and I do not see any error in the report.
Comment #9
thirstysix commentedHi,
I have an doubt. I got the same error when I am after deleting a store. I removed the order items. but, I can't able to remove the orders.
"There is content for the entity type: Order. Remove orders." How can I fix this issue?
I need to remove the existing orders
Thanks in Advance.
Comment #10
vindesh commentedI faced this error on Drupal 8.5.x with commerce order module and resolved this error.
Comment #11
sourabhbhalerao commentedHi,
I am also getting same error on drupal 8.6 when i create two stores and then create two products and assign store to each product then I delete one store other than default store then it generate error but when i go to edit product page and save it again then it is working proper....another thing i have check with another process if we delete default store and leave second store as it is then it is not assign as default auto and add to cart is not properly working.
Thanks
Comment #12
mesh commentedHere's what worked for me.
0. Check there is at least one store created (If you have accidentally deleted an existing one)
1. Temporarily apply the patch
2. Go to Extend > Uninstall
3. Find 'Commerce Order' and click these two (Make sure the patch is applied, or it will throw up the same errors)
3a. 'Remove orders'
3b. 'Remove order items'
4. Revert the patch
It would be really helpful if people mentioned the status of this patch, if it will be included in future updates or not.
Comment #13
zenimagine commentedComment #14
rituraj.gupta commentedHi @mesh,
Nothing is working. I have applied patch but same error displaying.
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\commerce_store\Entity\Store::getCustomer() in Drupal\commerce_order\OrderRefresh->refresh() (line 139 of modules\contrib\commerce\modules\order\src\OrderRefresh.php).
Comment #15
TheWinkingSkeever commentedCan confirm #7 worked for me when I deleted a store that still had somewhere some data in a users cart.
Delete the problem cart order from the database fixed my problem. I had an error when I tried to remove them from the uninstall/module list
Comment #16
FredJF commentedClearing carts works for me:
DELETE FROM `commerce_order` WHERE `cart` = 1Comment #17
Ezequiel Smith commentedI had the same problem after removing stores from my products, what I did to fix it was the following:
SELECT * FROM commerce_store;UPDATE commerce_order SET store_id=7 WHERE store_id NOT IN (8,9)(In the example i was deleted stores with id 1 to 6, and i have already orders with stores 7,8,9)
This is not "the solution", but it could help ... I'm quite paranoid about running DELETE queries (in ignorance) in the database hehe