Questions tagged [overrides]

Questions about overriding core features (class rewrites, local code pool, theme overrides). For URL rewrites, use the "url-rewrite" tag instead.

Filter by
Sorted by
Tagged with
1
vote
2answers
4k views

How can an extension add transactional email variables? (available in email templates)

suppose an extension that does something to an order. Special shipping. Or maybe blue ribbon packaging. How can this extension make available some new transactional email variables that are ...
12
votes
3answers
5k views

How to override Virtual Type class in Magento 2

How to override VirtualType block in Magento 2, I want to override following virtual type block with my own block, <virtualType name="Magento\CatalogSearch\Block\SearchResult\ListProduct" type="...
10
votes
1answer
874 views

Remove observer from third party extension

I have installed a blog module onto my Magento 2 platform. This blog module has an observer which automatically adds a new menu item into the primary navigation. I wish to stop this. The events.xml ...
6
votes
1answer
6k views

Magento 2 : How to Override Admin Template File

I'm developing a custom module in magento 2. I need to change the file located in Magento/Sales/view/Adminhtml/Templates/Items/Column/name.phtml. How can I override file in custom extension?
1
vote
1answer
4k views

overwriting adminhtml block from another extension doesn't work

I'm trying to find a solution since a couple hours now. Unfortunately without any luck, so I need to ask you for help. I'm trying to add a download button to a grid which will be provided by an ...
6
votes
1answer
5k views

Magento 2: Overriding Block class – not generating output

I'm trying to override the module-catalog/Block/Product/View/Options/Type/Select.php class with a new version which includes a few other bits of custom php (adding HTML classes and IDs to the ...
3
votes
0answers
307 views

No Way to Clear/delete a Selected Image using Media Browser on category edit page

With reference to this Q&A there's another question. How do I clear the image selected using the Media Browser on category edit page in the admin Panel? Here's what I tried: in app/code/...
2
votes
2answers
12k views

Override core checkout cart controller

I have already included a custom controller in my local module. The config.xml snippet for it is: <routers> <subscription> <use>standard</use> ...
2
votes
2answers
3k views

Overriding controller

I have followed few instructions found in this forum, but I must be missing something. I am trying to override Contacts controller, specifically postAction method. Here is what I have got: Magento ...
2
votes
2answers
1k views

How to get Product url and show in detail page even it is non visibility mode?

By default Magento does not allow the product which has 'not visibility in frontend' mode to avoid showing the product in listing and detail page. When user hit the previously loaded url, it redirects ...
1
vote
1answer
2k views

Overriding template not working in Magento 2

I have following code etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/...
1
vote
3answers
4k views

Magento2: How to override admin files

I need to add some modification on the following file so that i'm trying to overwrite the file in local vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml to app/design/...
1
vote
2answers
726 views

How to override customer AccountController in magento1.9

I was used below code but not work in-effect it removes my login and registration link from the top links. Config.xml <?xml version="1.0"?> <config> <modules> <...
0
votes
1answer
787 views

changing default values

In an effort to learn how to work with Magento I have set myself a number of (what i believe will be) basic tasks. The aim being to give me an idea of how to access information of the customer, ...
0
votes
1answer
283 views

Contact Post Controller overridden in Custom Module not working

I have override contact form post controller in custom module. It is calling from my module but i am getting error as Fatal error: Uncaught Error: Call to a member function send() private function ...
0
votes
1answer
1k views

Override Less file

im work on a new magento 2 page. Now i want change a css class over my custom theme.less file. But how can i override the css class? I want override the padding from the .header.content class which ...
9
votes
1answer
4k views

override a zend library

i'm trying to override a zend library (Zend_Pdf_Page) and it doesn't seem to be working. i'm putting it in app/code/local/Zend/Zend_Pdf_Page.php, but the parent class is being used instead. are there ...
8
votes
2answers
2k views

Are we forced to rewrite a template in Magento2 when rewritting a block?

This question is about following Magento2 best practices. I had to rewrite \Magento\Theme\Block\Html\Topmenu::_addSubMenu() method in order to add some wrappers around elements. Now, because it's a ...
13
votes
1answer
21k views

Magento 2 Override default header template

I have created my own theme by extending the Magento/Blank theme. Now want to override the default header template files link.phtml, topmenu.phtml, header.phtml which is located at vendor/module-...
10
votes
3answers
2k views

Magento 1 Class Rewrite in Magento 2 with Dependency Injection System

Poking around Magento 2's core code, it looks like the old class rewrite system has been ripped out and replaced with a new dependency injection system. Unfortunately, there's no documentation for ...
7
votes
6answers
5k views

How to override final_price.phtml in magento 2?

I want to override final_price.phtml, I have tried following in my module but it is not working. I have created app/code/MyVendor/MyModule/view/frontend/layout/catalog_product_prices.xml <layout ...
7
votes
2answers
1k views

Circular dependency: Magento\Customer\Model\Session depends on Company\Modulename\Plugin\Config\Share and vice versa

How to override or Use plugin for isWebsiteScope() function from Magento\Customer\Model\Config\Share.php file, I have used plugin for below function but I want to get current customer session in ...
2
votes
1answer
5k views

Magento 2 Training Overriding a core class

I'm trying to implement a basic m2 class override following the M2 Fundamentals Course and it is not working. Here is what I have in my Training/Test/etc/di.xml <?xml version="1.0"?> <!-- /*...
6
votes
1answer
1k views

Magento2 Override Contact Post Controller [duplicate]

how to Override contact controller in custom module? venoder/magento/module-contact/Controller/Index.php
4
votes
1answer
1k views

How to Override phtml file in Magento 2?

I am overwriting vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtl and I tried puting the overriden file in two locations but no chages occur First: app/code/<...
2
votes
2answers
3k views

Override Mage_Checkout_Block_Onepage with an extension [closed]

I'm aiming to override the class Mage_Checkout_Block_Onepage in order to begin a rework of the onepage checkout. Unfortunately, i fail to success at overriding it, while the onePageController override ...
1
vote
2answers
2k views

Magento 2 override core Model class with psr-4 by replacing in app/code/Magento

"autoload": { "psr-4": { "Magento\\Framework\\": "lib/internal/Magento/Framework/", "Magento\\Setup\\": "setup/src/Magento/Setup/", "Magento\\": "app/code/...
9
votes
2answers
516 views

Why use a theme when you have modules?

Inside of my custom module I have added the file Vendor/Theme/view/layout/default.xml which I am using to override a lot of the site's global templating with templates/blocks/layouts from the custom ...
9
votes
4answers
2k views

Magento 2 How to override vendor/magento/magento2-base/lib/web/css/source/lib/_navigation.less?

How Can I override vendor/magento/magento2-base/lib/web/css/source/lib/_navigation.less file in my custom theme ?
7
votes
2answers
4k views

Override Magento 2 JS file via requirejs-config.js not working

I'm trying to override the file vendor/magento/module-catalog/view/base/web/js/price-box.js in my theme using requirejs-config.js unsuccessfully. Location of my requirejs-config.js: app/design/...
4
votes
2answers
9k views

How to override product list page [duplicate]

I'm trying to override the list product page. My objective is add certain information on each product above the add to cart button for example. I already did with the single page product, just ...
4
votes
1answer
3k views

Override the frontname for a existing Magento module

I recently started working on Magento for one of my projects and stuck at something, which i see a very common use case. I tried looking at different blog post but couldn't find any which can hint ...
4
votes
3answers
8k views

Redirected to the Homepage when removed www. from URL

Say, My Website is : www.example.com I have one page : www.example.com/contactus If I remove "www." from above url, means : example.com/contactus It redirects me to the homepage. Why ?? Checkout ...
3
votes
2answers
4k views

How to modify/update cart success message in Magento 2?

I want to modify/update the success message added by cart controller (Magento\Checkout\Controller\Cart\Add). As described here and here, I can use preference to override controller to update success ...
3
votes
1answer
275 views

Overwriting controller vs overwriting action controller request

I'm busy working though Grokking Magento by Vinai Kopp, and reached a part where he explains where he explains how to rewrite requests to (eg) the checkout/cart controller, and he gives an example of ...
3
votes
2answers
3k views

Override Extension Helper

I'm trying to override a part of an helper of Help Desk MX extension. So I created a module with the following file: app/etc/modules/company.xml <?xml version="1.0" encoding="utf-8"?> <...
3
votes
1answer
4k views

How to override / extend local extension model in magento?

I got a problem in overriding magento model local extension. Here is my module config: etc/modules/Mycompany_OrderExport.xml <?xml version="1.0" encoding="UTF-8"?> <config> <...
3
votes
2answers
2k views

How to extend a core Product List Block model?

I want to extend pring a function into magento where I assemble some product data. In the end I want to call a function like $this->getAlternateTitle() within Lists and Products. This is what I ...
2
votes
1answer
36 views

How to add label to street fields in Customer registration in admin panel?

I want to add two more Labels Colony and Area after Street Address.How can I achieve this ?
2
votes
4answers
3k views

Magento 2: How to override core js module price-bundle.js

I am attempting to override the _onQtyFieldChanged event in the mage.priceBundle widget in the module-bundle/view/base/web/js/price-bundle.js file. I am referencing the Magento dev docs (http://...
2
votes
1answer
1k views

Add block on single product page

I'm trying to override how products are displayed adding some stuff. I've already done with the listing page: Created new file on app/code/vendor/module/Block/Product/ListProduct.php di.xml telling ...
2
votes
3answers
5k views

Magento add Customer Email to adminhtml order grid (Mage 1.8)

I am trying to add the Customer Email to our adminhtml order grid. We are overriding the code in Mage/core in this file: app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php In PrepareColumns we ...
2
votes
2answers
1k views

Why my overriding of the success.phtml is not working?

I have copied and pasted the file from vendor/magento/module-checkout/view/frontend/templates/success.phtml to app/design/frontend/THEME/THEMENAME/Magento_Checkout/templates/success.phtml ...
1
vote
2answers
113 views

Override template and block from a module?

I am developing a newsletter extension. I try to override the template /vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml and the block Magento\Customer\Block\...
1
vote
3answers
487 views

How do I rewrite a single element in a .phtml file?

In my custom module I want to rewrite parts of several .phtml files. For example, in app/design/frontend/base/default/template/bundle/catalog/product/price.phtml, I want to rewrite <div class="...
0
votes
2answers
2k views

Override of abstract class method not working

I'm trying to override the proccessAdditionalValidation method in the Magento\Shipping\Model\Carrier\AbstractCarrierOnline class. Below is what I have done but the function is not being called. ...
0
votes
3answers
2k views

Magento 2 : How to Override vendor files in my custom theme

How to override below admin file in my custom admin theme ? /vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml
15
votes
5answers
12k views

Magento 2: How to set custom template for core block

I'm trying to override the register.phtml in my module, but it seems there are some config problem that make Magento unable to use my custom template to override the one in core module. I've checked ...
7
votes
5answers
2k views

Changing breadcrumbs separator symbol

By default the breadcrumbs look like: homepage > category > product. I would like to change the greater than (>) symbol. The code that generates it is in vendor/magento/magento2-base/lib/web/css/...
6
votes
1answer
2k views

Why can't Simple Products with options be grouped?

Synopsis I have a store where-by I create a Grouped Product and associate a number of Simple Products. When I add custom options to the simple products it is not visible in the Grouped Products' ...