Questions tagged [override-block]
The override-block tag has no usage guidance.
28 questions with no upvoted or accepted answers
5
votes
0
answers
295
views
Problem with block override in Magento 2
Note: Before marking the question as duplicate or off-topic, please read the question carefully.
Scenario:
I have to show custom column in the admin grid of a custom extension. So I used override ...
4
votes
1
answer
489
views
Layered Navigation not showing the right options after overriding product list block
I've successfully override productList block to show my custom filtered product collection like this:
di.xml
<preference for="\Magento\Catalog\Block\Product\ListProduct" type="\Vendor\Module\...
2
votes
3
answers
2k
views
Overwriting adminhtml block template for a products advanced pricing
---- EDIT #3 :
Please ignore the code in this question. The template tier.phtml is not used by Magento 2.2.x (see edit #2)
The working code can be found here: Extra column in ...
2
votes
0
answers
189
views
In Magento2 what is the place to override the quote?
In Magento2, I want to modify the Quote. I want to add some custom attributes to the items and change the order of the items.
At what level should it be done, Model, Controller, Block? Please, ...
2
votes
0
answers
582
views
Magento2 Overriding Block and Model Working Only For Direct Called Class
It seems like Overriding Block and Model in magento2 work only if the class is directly being called.
For Example i want to override model file
vendor/magento/module-catalog/Model/Layer/Filter/...
1
vote
0
answers
372
views
Overrided template renders only after reload of page
I override core template
Magento_Sales::order/view/history.phtml
to add new checkbox that will allow to send sms along side emails.
I added in this file:
Vendor_Module::order/view/history.phtml
...
1
vote
0
answers
237
views
Magento 2.2.5 Override sales order item block not working
We are working on Magento 2.2.5, override the \Magento\Sales\Block\Order\Items class method _prepareLayout but it is not working showing error.
File : etc\module.xml
<?xml version="1.0" ?>
<...
1
vote
0
answers
311
views
GoogleAnalytics Block Override
Developer view, please
app/code/YourCompany/YourModule/etc/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/...
1
vote
1
answer
583
views
Magento 2 overriding Block Class Function
I just want to override vendor/magento/module-backend/Block/Dashboard/Orders/Grid.php
I added this line $collection->addAttributeToFilter("status",["neq"=>"failed"]);
Core overriding is ...
1
vote
0
answers
293
views
Magento2 - How get all prices of all Blocks within HomePage?
I have working a website with others extensions between them the "Ultimo - Fluid Responsive" theme that overwrite much part of website, as well as my own extension.
My question friends:
I how can ...
1
vote
1
answer
833
views
Magento 2 overriding Magento\Catalog\Block\Product\View
I have made a module to override Magento\Catalog\Block\Product\View. I want to add some standard things to the MetaTitle and MetaDescription on the product page. Specifically for empty descriptions.
...
0
votes
2
answers
1k
views
How to override product details page in custom module
I create a module, then create files details.phtml under app/code/Namespace/Module/view/frontend/templates/product/view and create catalog_product_view.xml under app/code/Namespace/Module/view/...
0
votes
1
answer
131
views
override html/skip.phtml template's block file
In layout default.xml, i found this
<block class="Magento\Framework\View\Element\Template" name="skip_to_content" template="Magento_Theme::html/skip.phtml">
So ...
0
votes
1
answer
24
views
Issue with block override Magento 1
Here is what i have tried
i am trying to override Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php
block
Config.xml
<?xml version="1.0"?>
<config>
<modules>
...
0
votes
0
answers
453
views
Magento 2.3 Change product status to out-of-stock when qty is less than 'Minimum Qty Allowed in Shopping Cart'
I'm running Magento 2.3.5.
Some of my products have Minimum Qty Allowed in Shopping Cart set to greater than one.
For example, product A has Minimum Qty Allowed: 7.
Currently, the QTY of A is: 10.
Now ...
0
votes
0
answers
359
views
Magento 2 bundle block overriding not working
Hi I am trying to override bundle block but it not working created di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1
answer
962
views
Custom catalogsearch layout and template override not displaying custom block content [EDITED]
Edit: Could not having crontab and cron set up affect compiling the layout files and be related at all to the custom layout not loading? I have since moved all my logic out of the app/design/frontend/...
0
votes
2
answers
151
views
Magento 2 - overriden class extending overriden class not working
I have overriden the class Magento\Catalog\Block\Product\ProductList\Upsell with my own Company\Base\Block\Product\ProductList\Upsell.
The class Magento\Catalog\Block\Product\ProductList\Upsell ...
0
votes
1
answer
349
views
Magento 2 how to override Magento\Directory\Block\Data using preferences?
This is my code but the block is not overrided
My di file :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
0
answers
471
views
How to Filter Current Category Layer's products colletions by instock and qty greater than zero(0) condition in List Page Magento 2
Please check below Code:
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...
0
votes
1
answer
156
views
Best practice to add method to core block
Which is teh best way to extend a block with a custom method?
Should I use a preference to override the whole class or is enough to declare the extended class with the new method inside the XML layout ...
0
votes
1
answer
118
views
Can't override Mage_Catalog_Block_Product_List_Toolbar
I have a problem to rewrite/override Mage_Catalog_Block_Product_List_Toolbar.
Here is my code:
etc/modules/Codesky_CatalogProduct.xml
<?xml version="1.0"?>
<config>
<modules&...
0
votes
2
answers
92
views
Form Block Override seems to work but is Never Called
This is a very common question, but this one is a little different.
I'm trying to overwrite/rewrite a Form block from another module. I'm already rewriting other blocks from this module without ...
0
votes
1
answer
217
views
Magento 2 not able to override Block file
I tried to override block file but I unable to see the output.
my script
di.xml file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
0
answers
80
views
Block override not working
I am trying to override Magento\Catalog\Block\Widget\Link with Anshu\Custom\Block\Catalog\Widget\Link but it is not working.
Anshu/Custom/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="...
0
votes
1
answer
407
views
override wishlist block in custom theme
I want to override wishlist block in my custom theme. Whenever Customer increases the QTY on wishlist page for add to cart, I want to place the condition that QTY should be less than 5.
This function ...
0
votes
2
answers
732
views
Issue in override admin block in magento 2
I have override Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Items.php file, Its overided, When I am executing process, system calling respective _beforeToHtml() function from my file.
But at ...
0
votes
1
answer
546
views
Override protected function of block class in Magento 2.1.7
I want to override a protected function getOptionPrices() of class {root_folder}\vendor\magento\module-configurable-product\Block\Product\View\Type\Configurable.php. I have written following code.
{...