Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [override-block]

The tag has no usage guidance.

1
vote
1answer
40 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/...
0
votes
2answers
22 views

How To Pass A Custom Price Value To Product List Price Renderer In Magento 2?

We have come across an issue that I'm trying to solve. In order to overcome this bug https://github.com/magento/magento2/issues/10009 where discounted prices are not applied per customer group, I've ...
2
votes
3answers
86 views

interceptor not generate for \Magento\Catalog\Block\Product\ListProduct

I'm trying to create plugin for getProductPrice but \Magento\Catalog\Block\Product\ListProduct Block Class not generate Interceptor Class like Magento\Catalog\Block\Product\ListProduct\Interceptor. ...
0
votes
2answers
118 views

Override admin block file issue in magento2

I am trying to override block file of adminhtml of sales module. Below is the code of my di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1answer
44 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
0answers
26 views

How to override part of a function for a block

I am trying to override part or all of a function for the file located here: Magento\Customer\Block\Adminhtml\Edit\Tab\Orders.php I want to change the customer_id to main_table.customer_id in the ...
2
votes
1answer
184 views

Problem in overriding ListProduct on search results

We have overwritten Magento\Catalog\Block\Product\ListProduct to be able to check if displayed products match a certain category. We have set the preference in our module /etc.di.xml like this: <...
1
vote
0answers
21 views

How to override tax Block In magento2

I want to override the order of "Total Excluding Tax" and "Total Including Tax" in the order confirmation email so I tried to use preference to override, but its not working. I want to override this ...
0
votes
1answer
117 views

Can we rewrite multiple blocks of same core extension?

Can we rewrite multiple blocks of a core extension like catalog ? like this : <blocks> <catalog> <rewrite> <class_name_here>...
1
vote
1answer
30 views

Not able to rewrite another extension's block

We are trying to rewrite the 3rd party module's block. Here is my extension \app\etc\modules\XXX_GoogleTagManager.xml <?xml version="1.0"?> <config> <modules> <...
1
vote
2answers
388 views

Magento 2 theme override: changes not showing

I am new to Magento 2 and theming and I'm having trouble overriding a particular template. I am running in developer mode. I have successfully installed my theme and applied it globally in the admin, ...
0
votes
0answers
177 views

How to override layout block class for specific product

I am using "Extension #1" which has in its layout code: <block class="MagicToolbox\MagicZoomPlus\Block\Product\Renderer\Configurable" name="product.info.options.swatches" as="swatch_options" ...
1
vote
1answer
220 views

Overriding a layout file in magento2 is not working

What I want to override: vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml I copied the file to this location: app/design/frontend/[Vendor]/[MyCustomTheme]/...
0
votes
1answer
114 views

Adding new function in existing class

I want to add a new function in class Magento\CatalogWidget\Block\Product\ProductsList so, that I can use that function in template file of this block. Can I add a new function without using ...
0
votes
1answer
32 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&...
1
vote
3answers
277 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
1answer
246 views

Change header label “sign in” to “log in” in magento 2

Can anyone help how to change header's "sign-in" label to "log-in" in Magento 2.
4
votes
0answers
125 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 ...
0
votes
3answers
323 views

Magento 2 : How to Change Form encoding?

I would like add multipart-form/data to Magento2's Admin Form. Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
3answers
1k views

Magento 2 : How to get store information in specific Block

I have Override \Magento\Catalog\Block\Product\View Block in which i can not get store information. I have use \Magento\Store\Model\StoreManagerInterface $storeManager but it throws following error. ...
0
votes
1answer
207 views

how to override adminhtml block for a function?

Urapidflow has an issue which casued by a security patch and even their new version does not resolve the issue, the path for module file that I want to write an override is: app\code\community\Unirgy\...
2
votes
1answer
780 views

Magento 2 - How to remove '--Please Select--' option from Custom Option dropdown on Product page

In Magento 2 I am trying to remove first option "--Please Select--". Here is my code. After the rewrite, I am not able to see custom option dropdown itself but the page is loading. Please let me know ...
0
votes
2answers
59 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
2answers
239 views

How to override adminhtml block file in Magento 2

How to override module-customer/block/AdminHtml/Group/Edit/Form.php I have created custom module for that please find my code for that. etc/di.xml <?xml version="1.0"?> <config xmlns:xsi=...
0
votes
1answer
190 views

Magento 2 Not able to override \Magento\Directory\Block\Data Class

I am trying to override Block \Magento\Directory\Block\Data with following method getCountryHtmlSelect() with following script, but it's not executing. di.xml <?xml version="1.0"?> <...
1
vote
1answer
165 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
0answers
204 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
1answer
563 views

magento2.2 override topmenu.php: _addSubMenu()

I am trying to override the Topmenu Module Block but I can not understand why it fails. I am trying to override the following method: magento/module-theme/Block/Html/Topmenu.php:_addSubMenu(...) I ...
2
votes
0answers
99 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, ...
4
votes
1answer
290 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\...
0
votes
1answer
60 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
2answers
734 views

M2 Module to Override Login Page Title

I have written a module to override vendor/magento/module-customer/Block/Form/Login/Login.php in app/code to change the page title. My override code is below: <?php /** * Copyright © 2013-2017 ...
0
votes
0answers
56 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
1answer
189 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 ...
2
votes
1answer
1k views

Override customer sales order history template not working

I want to override sales order history for customer in frontend like this: app/code/Test/SuccessPage/view/frontend/layout/sales_order_history.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
3answers
811 views

Override Magento\Catalog\Block\Product\View\Options\Type\Select

SOLVED :: 15.9.17 (the following code works on a fresh Magento 2.1.7 installation; tested on Luma theme) I am struggling with the override of this particular core block Magento\Catalog\Block\...
1
vote
2answers
1k views

Custom module creates 'Invalid template file in module' error

I wanted to have a product's brand name shown next to it's product name, so I created a module for this. I extended the Magento\Theme\Block\Html\Title block in order to obtain the brand name and use ...
0
votes
2answers
292 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
2answers
779 views

How can I override the Vendor with Custom module in magento 2 [duplicate]

How can i override this path: vendor/magento/framework/View/Element/Html/Select.php with my custom module file?
0
votes
1answer
282 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. {...
1
vote
2answers
321 views

How do I change the main column on 2 column layout in Magento ver. 1.9.3.1

MT Ghost Theme - we had a 3rd party start the website because of time. The problem is, I am not able to change anything. There is a lot of "white space" on the product detail page that makes the ...
4
votes
2answers
624 views

Invalid template file override Magento 2 block

I want to overrid magento 2 address_book block, but I got an error like this: Invalid template file: 'address/book.phtml' in module: 'Namespace_Module' block's name: 'address_book' di.xml: <?...
0
votes
1answer
84 views

Override Minicart.php Block magento

I have try to doing override minicart.php block but unfortunately not getting success of override. you can see below code what i have implemented : <blocks> <test> ...
1
vote
1answer
262 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. ...
4
votes
2answers
226 views

Overriding template file from custom module not working

i want to override block phtml file for customer address edit, first i created the customer_account_edit.xml at Namespace/Moduke/view/frontend/layout/ : <?xml version="1.0"?> <page xmlns:xsi=...
1
vote
1answer
590 views

Override custom module adminhtml block

im working on Magento 1.9.3 i'm trying to override the admin grid of a custom module. The original module strucutre is: Miravist - Helpdesk -- Block --- Adminhtml ---- Ticket ----- Grid.php original ...
4
votes
1answer
189 views

How to override _registerJsPrice($price) function in Configurable.php Block in Magento2?

I am trying to override __registerJsPrice($price) function in configurable.php This function is work when we change swatch. Path of configurable.php is /opt/lampp/htdocs/magento/vendor/magento/...
1
vote
1answer
286 views

Magento 2 error occurs when using <preference> to override a block class

I want to override the block class Book.php of customer module,But i got Following error. Recoverable Error: Argument 2 passed to Magento\Customer\Block\Address\Book::__construct() must implement ...
1
vote
2answers
877 views

Override topmenu

1 exception(s): Exception #0 (Exception): Warning: Declaration of Vendor\Module\Block\Html\Topmenu::_addSubMenu(Magento\Framework\Data\Tree\Node $child, $childLevel, $childrenWrapClass, $limit) should ...
0
votes
1answer
490 views

Magento2.1 Override the navbar

I am trying to override the Topmenu Block. Here is what I did: Add a di.xml file to my module containing the: <?xml version="1.0"?> <!-- /** * Copyright © 2013-2017 Magento, Inc. All ...