0

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

<?php

require_once 'app/bootstrap.php';

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

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

\Zend_Debug::dump(get_class($sample));

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

0
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" />
</config>
2)then create block:
<?php
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, privacy policy and cookie policy

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