I created a preference, if I try to exit the extended class nothing happens. But if I try it with the following code:


require_once 'app/bootstrap.php';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$sample = $bootstrap->getObjectManager()->create('MyParcelNL\Sdk\src\Helper\MyParcelCollection');


The code is exited??? Anybody an idea why it does not work when using the extended class via the backend in Magento?

1 Answer 1

1)create di.xml file:
<?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="Magento\CatalogWidget\Block\Product\ProductsList" type="vendor\module\Block\Product\ProductsList" />
2)then create block:
namespace vendor\module\Block\Product;

class ProductsList extends \Magento\CatalogWidget\Block\Product\ProductsList


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.