All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
1answer
238 views

Magento 2.2.4 - Couldn't override block class

I am trying to override the Magento\ConfigurableProduct\Block\Product\View\Type\Configurable class. I have added a preference in app/code/vendor/module/etc/di.xml file. <config xmlns:xsi="http://...
0
votes
1answer
778 views

Class not found even exist on Magento 2

I have a custom module and i tried to extend this class in my Image.php file: Magento\Framework\Data\Form\Element\Image namespace Vendor\Namespace\Block\Adminhtml\Form\Element; class Image extends ...
0
votes
4answers
116 views

Magento 2 Class

i'm trying to convert a module from Prestashop to Magento 2 but i have a problem with the class. I'm following several tutorial and my whole module is based on the administration part of the website. ...
0
votes
1answer
952 views

Include custom module block within phtml file?

I've created a custom module for a distributor search with a php class/block inside. Module Structure: - /Distributor Search - /Block - DistributorSearch.php - /etc - module....
0
votes
1answer
122 views

static block (created via admin panel) the same as a php Block class in a module?

Magento 2 related Question. Is a block(CMS Static Block) which I create via the Admin Panl, the same as a block which I created programatically in a module (app/code/Vendor/Module1/Block/Bla.php) ? ...
6
votes
2answers
5k views

\Magento\Framework\Registry already exists in context object on compile

when I do compile I do get the following error which is referencing my custom module Blocks, class Incorrect dependency in class ... \Magento\Framework\Registry already exists in context ...
1
vote
3answers
2k views

problems overriding 3rd party extension block class

the extension in question has the following structure: app code local MST Menupro Block Base.php Base.php has: class MST_Menupro_Block_Base extends Mage_Core_Block_Template { my custom ...
0
votes
1answer
204 views

Including a custom module model / block into template

I'm trying to follow this guide. But I want to add the template directly into the homepage using cms.xml, something like: <block type="trendingproducts/data" name="trending.products" template="...
15
votes
1answer
8k views

DI & Extending a Block on Magento 2

I seem to be struggling to grasp Magento 2 dependency injection with blocks, every time I try to extend a block that isn't \Magento\Framework\View\Element\Template I end up with errors. I want to ...
2
votes
1answer
179 views

Identical Code in Block Class Overload has Different Results

The following code samples are long, but here is the issue: If I create a custom file /app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php and add two new columns to the product grid, it ...