I need to override processMediaGallery method from


I used below code in my custom module etc/di.xml.

< preference for="\Magento\Catalog\Model\ProductRepository" type="YourNamespace\YourModule\Model\ProductRepository" />

And added the ProductRepository.php file into my custom module Model folder of module-catalog from the vendor.

I am getting below error after doing this.

ProductFactory does not exist in [Bms\Shop\Model\ProductRepository\Interceptor]

Have anyone faced the same issue?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.