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
Solved! Go to Solution.
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
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
Thank you @sivashchenko for pointing me to the right direction. I have fixed the issue now.