- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I get " Class Magento\Sales\Model\Resource\Order\Collection does not exist" error whenever I run the setup:di:compile command. Is there a quick fix for this?
I deleted Var/di, generation, cache and view_preproccessed directories before running this command.
Any help is highly appreciated.
Thanks
Shoaib
If this response was helpful to you, consider giving kudos to this post
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ShoaibRehman89,
Looks like your installation contains a very old extensions, as the correct class name is:
\Magento\Sales\Model\ResourceModel\Order\Collection
In order to support PHP 7, where "Resource" is a reserved word, Resource namespace was renamed to ResourceModel long time ago.
Hopefully, you will be able to apply quick fix by replacing all occurrences of Magento\Sales\Model\Resource\Order to Magento\Sales\Model\ResourceModel\Order
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ShoaibRehman89,
Looks like your installation contains a very old extensions, as the correct class name is:
\Magento\Sales\Model\ResourceModel\Order\Collection
In order to support PHP 7, where "Resource" is a reserved word, Resource namespace was renamed to ResourceModel long time ago.
Hopefully, you will be able to apply quick fix by replacing all occurrences of Magento\Sales\Model\Resource\Order to Magento\Sales\Model\ResourceModel\Order
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Class Magento\Sales\Model\Resource\Order\Collection does not exist
Thank you @sivashchenko for pointing me to the right direction. I have fixed the issue now.
If this response was helpful to you, consider giving kudos to this post