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 [overrides]

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

11
votes
0answers
342 views

How to override a static method in Magento2

Plugin Interceptors and overriding with preference does not work on static methods. Need to override getOptionArray method in Magento\Catalog\Model\Product\Visibility to return a custom visibility ...
7
votes
0answers
359 views

How to override class Virtual Type class

I saw this, but it don't work for me. How to override Virtual Type class in Magento 2 <virtualType name="categoryFilterList" type="Magento\Catalog\Model\Layer\FilterList"> <arguments>...
3
votes
0answers
652 views

Magento 2 -Override tax functionality to calculate tax on cost instead of price

I have checked below mentioned files to override tax functionality: \vendor\magento\module-tax\Model\Sales\Total\Quote\Tax.php \vendor\magento\module-tax\Model\Sales\Total\Quote\CommonTaxCollector....
3
votes
0answers
187 views

Magento 2 theme HELP

Not long ago I made my first Magento 2 custom/child theme so that my website changes won't be erased when I upgrade to another version. I now want to override some core Magento 2 files that I need ...
3
votes
0answers
258 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/...
3
votes
0answers
292 views

Magento2 : Override Admin Js file

I am working on Magento 2.1 CE. My current active Theme is the Default LUMA Theme I wish to override the CORE Modules "bundle-input-type.js" located in "vendor\magento\module-bundle\view\adminhtml\...
2
votes
0answers
81 views

How to override Magento_ConfigurableProduct/js/configurable.js

I'm following this instruction to override "Magento_ConfigurableProduct/js/configurable.js" but it doesn't work. I'm following this link: https://magento.stackexchange.com/a/131852/70258 After i ...
2
votes
0answers
101 views

How to override Magento 2 welcome email upon new customer account creation

I need to customize default Magento welcome email template which is sending upon new customer account creation in my custom module. I'm using the following functions for sending welcome email upon ...
2
votes
0answers
35 views

Override magento 2 default files

How to override default magento 2 file vendor/magento/framework/Reflection/ExtensionAttributesProcessor.php in my custom module.
2
votes
0answers
161 views

Override class in setup:upgrade command in magento2

I am trying to override the class FilePermissions (magento/framework/Setup/FilePermissions.php) but my changes are not taken in account while I use the bin/magento setup:upgrade I tried : To add a ...
2
votes
0answers
112 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
0answers
60 views

How can I get Add products link on Backend Products Information Page

I need to add products from Backend Products Information Page, how can i get add products link on products information page.
2
votes
0answers
371 views

Magento2: Override Vendor Resource Model _afterLoad method

I am trying to override the _afterLoad methods of the vendor class Magento\Catalog\Model\ResourceModel\Product\Collection unsuccessfully. In my custom module I edited the di.xml in this way <?xml ...
2
votes
0answers
114 views

Edit backend in Magento 2

I've been trying to edit my backend, but without any results, does anyone know how, step by step? I've already try How to extend backend template files in Magento 2 Maybe I'm doing something wrong, ...
2
votes
0answers
64 views

Changing type on WSI file will not allow for an override

In app/code/core/Mage/Catalog/etc/wsi.xml From the tag for this: <xsd:complexType name="catalogProductCreateEntity"> I want to delete or change type with a custom module <xsd:element ...
1
vote
0answers
14 views

Product page (Related.php) error in Magento 2.1.16

I override the page Related.php and add my extra custom function in this class it works perfectly on 2.2.X but in 2.1.16 it shows me this error Warning: Invalid argument supplied for foreach() in /...
1
vote
0answers
18 views

New to Magento 2 - Is it possible to change every product price every minute?

I work in -precious metal industry- where item prices change every minute based on markets. At the basic level, UnitPrice=MarketPrice+Premiums per tier. My questions are: If we want to import ...
1
vote
0answers
16 views

How many ways are there to create a controller and what are they?

I have been developing with Magento 1.9 for the last two weeks. I have found several problems to develop each project (probably because my first project with magento had a high level...). I come ...
1
vote
0answers
41 views

ConfigurableProduct: How to get the configurable products out of stock?

I want to show all the attributes from my configurable product on my select. I followed this tutorial: Magento 2.2 How to show out of stock in configurable product, with some changes and fixes. So, I ...
1
vote
0answers
30 views

Unable to override account creation email template

I need to modify the welcome email sent to user upon new account creation. I need to do this in my custom module. I tried to override the function sendNewAccountEmail in Magento\Customer\Model\...
1
vote
0answers
38 views

Magento 2 - How to make responsive layout using child theme css?

How to override styles-m css to set responsive layout? I just add custom blocks in footer area which are not responsive in mobile view. How to override styles-m in Luma child theme? Thanks
1
vote
0answers
119 views

Private Function rewrite in magento2

i want to override helper class method private function _getGeneralFromAttributeSets(array $attributeSetIds) i use this code and create helper in my module folder <preference for="Test\Test\...
1
vote
0answers
38 views

how to overwrite the renderlayer.php in magento 2

When i try to overwrite the Renderlayer.php of module-swatches I am getting error [2018-09-24 06:48:41] report.CRITICAL: Warning: Declaration of Kygo\Swatches\Block\LayeredNavigation\RenderLayered::...
1
vote
0answers
20 views

Overwrite a class extended many times

When I have to override a method of a class that is used as extends in many modules I have to copy the class path and put it under app /local/Mage/.../Core_Class_Extended_ManyTimes.php. But there is ...
1
vote
0answers
21 views

Magento 1.9 Can I override the registration page only for one of the stores?

I have multiple stores. I need to override the existing registration page, but only for 1 store? How can I achieve that?
1
vote
0answers
131 views

override getLoadedProductCollection of \Magento\Catalog\Block\Product\ListProduct

I am overriding getLoadedProductCollection() in my block where performing some custom query public function getLoadedProductCollection() { $myCategory = $this->...
1
vote
0answers
48 views

Magento 2 plugin not working for CommonTaxCollector model

I want to overwrite mapItem function which is under the CommonTaxCollector class. So, I have done this but getting undefined error. Uncaught Error: Call to undefined method Magento\Tax\Api\Data\...
1
vote
0answers
92 views

Magento 2 ProductInterface Override

I need to Override Default Magento 2 ProductInterface to add extra key's to Product Details API response.
1
vote
0answers
661 views

How to override minicart content.html?

How can I override the following file for Magento-2.2.2 vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html Is there something different between .html and .phtml ?? As I ...
1
vote
0answers
49 views

Overriding a magento/module-sales view

Brief I'd like to add a button on the Order Create screen. I know where the core file/line number is. Is there a way to extend this document somehow without having to override the whole file? It ...
1
vote
0answers
117 views

URL Rewrites Magento 2

I've encountered a weird issue with my Magento 2 URL Rewrites function. It seems like my 3rd party plugin (Yotpo) is pulling an /admin with the ProductURL function. So for example this is what is ...
1
vote
0answers
179 views

Override default model webapi output magento2

I've began creating a module for a rest api for creditmemos - which I intend on using as an alternative to the built in version. At the moment I've started the normal way for creating a webapi module,...
1
vote
0answers
212 views

Override Magento\Catalog\Model\Layer is not working in custom module magento2

I am trying to override layer.php file in my custom module but it is not taking override file, it is loading core file only Here is my di.xml file -> path : [namespace][module_name][etc] -> di....
1
vote
0answers
179 views

Override _colors.less in backend

I need to override _colors.less to change color on admin backend. The file is here : vendo/theme-adminhtml-backend/web/css/source/variables/_colors.less I don't find solution to do it, I need to ...
1
vote
0answers
165 views

Magento 2 : override configurable product

Can u tell me which XML file bind all files to create configurable product so, I can override that file in my custom module at front-end side. Exactly, I want to create configurable button and by ...
1
vote
0answers
278 views

How to override protected function in Magento 2

I'm trying to override one protected function in Magento 2 but I am not able to achieve it. I have edited following files: <preference for="Magento\Checkout\CustomerData\DefaultItem" type="XYZ\...
1
vote
0answers
24 views

Overridden (extended) Block function still called

I have made an extension for magento 2 (that filters the products shown depending on user). I have extended the file module-catalog/Block/Product/ListProduct.php for this and overwrittien the ...
1
vote
0answers
822 views

How to move “Place Order” button from “Review & Payments” to custom step in Magento 2 checkout?

I have create an extra step in magento 2 checkout page and put custom step after "Review & Payments" step. Now as you can see there is "Next" button on my custom step. I want here "Place Order" ...
1
vote
0answers
36 views

Magento 2.15 override PackagesData.php in setup

How can I override the class PackagesData.php in namespace Magento\Setup\Model? I created the file app/code/local/Magento/Setup/Model/PackagesData.php but this is not working.
1
vote
0answers
355 views

Magento 2 Model override does not work

I'm trying to override core Model Magento\Sitemap\Model\Sitemap with my own model My\Namespace\Model\Sitemap as follows, <preference for="Magento\Sitemap\Model\Sitemap" type="My\Namespace\Model\...
1
vote
0answers
274 views

Magento 2 Can Magento\Framework\Filesystem\File\Write be “preference” or “plugin”?

Tried to use preference to override it, but errors appear when running "magento setup:static-content:deploy". Then I tried to use plugin, but I found that the system did not go to my customized ...
1
vote
0answers
79 views

Overwrite a modules JS files with theme

I've been looking over the Magento 2 Docs for using custom JS and have been trying to add a modified version of 'configurable':'Magento_ConfigurableProduct/js/configurable' to my theme directory so ...
1
vote
0answers
358 views

Composer autoload doesn't work

This is a follow up question from this question. I want to override a Zend class using composer autoload. It used to work, but not anymore. This is content of my composer.json file: { "name": "...
1
vote
0answers
24 views

Rewriting the product resource collection doesn't take effect on tag product collection

I need to add a method to the collections of products in magento, the base model which seems to be the parent of all the collections (e.g. Mage_Tag_Model_Resource_Product_Collection) is ...
1
vote
0answers
526 views

Magento2 - Value of rewritten ListProduct::getProductDetailsHtml Method do not print out value

Magento 2.1 CE Hi, i do something like this: Create a new Module with di rewrite, etc ... Than rewrite the ListProduct Block from Mage Core: use Magento\Catalog\Block\Product\ListProduct as ...
1
vote
0answers
353 views

How to proper extend variables and override module style?

I am new to Magento and currently developing a child theme inherited from the Magento blank theme. I read the developer documentation and doing okay. I created my own style.less in my web directory ...
1
vote
0answers
76 views

Magento2 2.0.7 enterprise - Menu Override is just showing a blank page after adding a simple override

I'm just doing a simple override to modify the structure of the menu. But weird thing is after creating the module and just extending the topMenu. It just gives a blank page. Here is my current code :...
1
vote
0answers
143 views

How to override step-navigator in checkout?

I need to override/extend the step-navigator.js with the function "isProcessed" but that link How to extend js class/method of checkout model class in magento 2 doesn't work. Magento can't find the ...
1
vote
0answers
147 views

Cannot rewrite ConfigurablePriceResolver in Magento 2

I try to rewrite the ConfigurablePriceResolver in Magento 2, but without success. In my di.xml I have the following: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
0answers
119 views

Right way to override magento files

I need to have unicode urls in Magento 2. I have found this magento issue on github that has 4 commits to make it work. I know that directly editing them is a very bad practice. What is the proper ...