Skip to main content

Questions tagged [override-block]

Filter by
Sorted by
Tagged with
4 votes
3 answers
4k 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 ...
user2447482's user avatar
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, ...
Supersonic's user avatar
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\...
Shell Suite's user avatar
  • 1,722
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:...
Ramesh's user avatar
  • 986
0 votes
2 answers
1k 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 ...
bondimedical's user avatar
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="...
Anshu Mishra's user avatar
  • 9,010
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 ...
gt06's user avatar
  • 63
2 votes
1 answer
3k 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-...
simple guy's user avatar
  • 2,494
1 vote
3 answers
3k 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\...
amdev's user avatar
  • 11
1 vote
2 answers
2k 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 ...
kyegil's user avatar
  • 21
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 ...
Atul's user avatar
  • 915
3 votes
2 answers
5k 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?
Learing_Coder's user avatar
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. {...
Pooja Mistry's user avatar
1 vote
2 answers
1k 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 ...
Jamie's user avatar
  • 11
4 votes
2 answers
2k 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: <?...
Shell Suite's user avatar
  • 1,722
0 votes
1 answer
102 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> ...
Kartik Asodariya's user avatar
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. ...
Thomas Coucke's user avatar
3 votes
2 answers
359 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=...
simple guy's user avatar
  • 2,494
2 votes
1 answer
977 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 ...
krybbio's user avatar
  • 1,258
4 votes
1 answer
276 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/...
Jaimin's user avatar
  • 2,146
1 vote
1 answer
1k 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 ...
Kamlesh Jha's user avatar
  • 1,058
1 vote
2 answers
1k 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 ...
Prakash's user avatar
  • 11
0 votes
1 answer
1k 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 ...
Binayak Ghosh's user avatar
0 votes
1 answer
4k views

Magento 2 : How to Override Block File

I need override block file in custom module. Below is block file path. vendor/magento/module-sales/Block/Adminhtml/Order/Create/Search/Grid.php How can I do that? Yes, please check this error and ...
Dhrumin's user avatar
  • 861
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/...
Minesh Patel's user avatar
  • 2,193

1
2