Categories
CMS Development Magento

Extending third party extension but Class does not exist when compiling

I’m extending a third party extension, and it looks like this, with registration and module I know their right. di.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <preference for=”Invoicing\Moloni\Libraries\MoloniLibrary\Controllers\Products” type=”Custom\Moloni\Libraries\MoloniLibrary\Products” /> </config> and products.php <?php namespace Custom\Moloni\Libraries\MoloniLibrary; use Invoicing\Moloni\Libraries\MoloniLibrary\Controllers\Products as custommoloni; use Invoicing\Moloni\Libraries\MoloniLibrary\Controllers; use Invoicing\Moloni\Libraries\MoloniLibrary\Moloni; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Model\ResourceModel\Order\Tax\Item; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory; use Magento\Catalog\Model\Category […]