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.

2
votes
3answers
43 views

How to override Magento 2 framework file?

I try to override this file : vendor/magento/framework/View/Element/Html/Link/Current.php I create a module.xml, registration.php and di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
0
votes
0answers
25 views

Magento2: unable to call catalog_product_view_type_downloadable.xml in magento2?

I have override the catalog_product_view_type_downloadable.xml in my module as MyVendor/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml But unable to call the changes ...
0
votes
0answers
30 views

How to override app/code/core/Mage/Core/Controller/Varien/Router/Admin.php?

I want to override core class of Magento 1: app/code/core/Mage/Core/Controller/Varien/Router/Admin.php How I can do that?
0
votes
0answers
25 views

Unable to override model class, only this file has problem

I am overriding Worldpay Model class that create xml request file. <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
2answers
46 views

How to remove the action of a menu.xml item?

I have a menu.xml like this: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu....
1
vote
1answer
73 views

Magento 2 - Override template files in module

What is the correct way to override a template file ? I need to display custom text in place of In Stock and Price on the product page. I want to override the template - Magento_Catalog/view/...
0
votes
0answers
29 views

Override __construct Magento\Catalog\Model\Product

I have overrided the Magento\Catalog\Model\Product. When I create a new function, I can access it with $this->_currentProduct->myNewFunction() in my code. But, in my new function, I need to ...
1
vote
0answers
11 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 /...
0
votes
2answers
68 views

How to rename the product detail tab title, and display as the last tab?

How to rename the product detail tab title, and display as the last tab? This is what i added, but didn't make any effect. the file is at the following location: /app/design/frontend/Infortis/...
1
vote
1answer
26 views

How to override or extend template and layout files for an extension downloaded by composer?

I have an extension that is downloaded through composer, there are two files i would like to update. How to I override/extend the files? what is the correct paths i need to create in app/design/...
0
votes
1answer
36 views

What happen when two module override same file?

I am coming from Wordpress development & now I started Magento module development. I am following this tutorial. I am just trying to add social sharing buttons to the product edit page. ...
2
votes
2answers
40 views

Magento 2 : How to override a custom module which install via composer?

I have installed one custom module using composer as usually that module was installed in vendor directory is there any way to override phtml file in the same module like name but on app/code module ...
1
vote
2answers
95 views

Magento 2: Override XML file from vendor folder to app folder doesn't work/update

I tried to override the XML file by copying the file from vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml to app/design/frontend/Infortis/base/...
1
vote
1answer
50 views

Magento 2.3 - extending layouts in custom theme

In Magento 2.* we could extend core layouts using custom theme, for instance, (assuming our custom theme is named Custom/our_theme) if we want to remove header & footer in customer login page we ...
0
votes
0answers
24 views

Magento 2 : How to override a Abstract Class? [duplicate]

I made some modification related to magento2 order pdf. I want to know how to override a abstract class AbstractPdf extends \Magento\Framework\DataObject
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
1answer
105 views

How to override Customer registration fields to custom module in magento 2

I want to override Customer registration Fields to my custom module i copied the /public_html/vendor/magento/module-customer/view/frontend/templates/ and Layout to app/design/vendor/child_theme/...
2
votes
1answer
64 views

Magento 2.3 - Overide \magento\zendframework1\library\Zend\Locale\Data\xx.xml

Is there anyway to override and not change directly the \magento\zendframework1\library\Zend\Locale\Data\xx.xml ? This is so that I can change the decimal denoter from "," to "." for stores that ...
2
votes
1answer
41 views

Call to helper of module not change the Mage_ prexif by my module prefix

I have changed my etc/system.xml and my etc/config.xml with the structure which should replace the Mage_JaviNewListProductController_Helper_Data by Lecasa_JaviNewListProductController_Helper_Data. I ...
2
votes
0answers
63 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 ...
1
vote
1answer
27 views

Magento 2 in SEO Checker - “The Accessible Index Page is Configured wrong”

So I run our site (on Magento 2.2.3) thru an SEO checker and it flagged up an interesting issue: The Accessible Index Page is Configured wrong. Search engines see your https://www.xyz.co and https://...
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 ...
0
votes
0answers
36 views

Payment Method Overwrite [duplicate]

I want to add new field in my payment method. I have added the field in phtml file in module but now I want to rewrite the file in my module. How can I achieve that?? Also let me know how to rewrite ...
1
vote
1answer
29 views

Rewrite phtml file and js file in Magento 2

Currently, I have cc card HTML in MyModule/Testing/view/frontend/web/template/form.html I want to rewrite this to phtml file with my module and js in web/js folder. How can I achieve that?
3
votes
1answer
42 views

Override OnepageController.php Not Working

I'm trying to override the successAction in the app/code/core/Mage/Checkout/controllers/OnepageController.php. I have done the following: I've created my override folder here: app/code/...
2
votes
2answers
26 views

Whats the best way to override a block class in magento2

1) Use preference in di.xml and add new methods or do changes 2) Or create a new class which extends the actual class and attach the new class to your phtml. Lets suppose you want to extend Magento\...
1
vote
1answer
18 views

Magento override Catalog Compare controller doesn't work

for some reason the Compare controller override doesn't work for me, I tried about everything I could find, but it just doesn't happen and I am running out of ideas. Do you see anything I am doing ...
0
votes
2answers
53 views

Modify product collection in M2

I am overriding Magento\Catalog\Block\Product\ListProduct In function _getProductCollection I have added some extra code. public function _getProductCollection() { $collection = parent::...
1
vote
4answers
78 views

Need to override edit.phtml on cart page to add new button near it

I need to add new button near edit button on cart page. I want o override edit.phtml in my custom module. Can someone guide me how to achieve this? vendor/magento/module-checkout/view/frontend/...
0
votes
0answers
41 views

Magento 2. How to Override Search (CatalogSearch)

I want to hide the specific product which I select from Configuration using Categories in the Search. e.g if I select Gear Category in configuration then If I search the Product of the Gear I want to ...
4
votes
2answers
58 views

Magento 2 : How to override files from Magento core framework?

Actually I'm refering to #19247 for PHP 7.2 specific issue. that partially solved my issue but can't able to override that file. I tried using preference here's what I tried. <preference for="...
0
votes
1answer
20 views

Override javascript with self-minified versions

We tried enabling the built-in minification and javascript merge functions, but some functionality of third-party modules/plugins stopped working. So something is in conflict between how magento is ...
0
votes
1answer
46 views

Override core files in Magento 1.9.4 (Varien.php)

What would be the most appropriate structure of the module in order to rewrite function validate() at app/code/core/Mage/Core/Model/Session/Abstract/Varien.php The idea is to rewrite that block ...
1
vote
2answers
43 views

Magento 2: Layout override sequence custom theme vs extensions

I created a custom storefront theme and override the catalog_product_view.xml file in my custom theme. Below is the path. app\design\frontend\Akhilg\custom\Magento_Catalog\layout\catalog_product_view....
0
votes
1answer
19 views

Magento 1.9 overwrite core

Is it possible to overwrite Magento core functionality in this way? - Mage_Sales_Block_Order_Total { protected function _initTotals(){ //this is core } } and overwrite it with this - ...
0
votes
0answers
11 views

Magento 2 Override Unit.phtml and Row.phtml in Magento_Checkout

I am trying to override both unit.phtml and row.phtml within my Magento_Checkout module. I am doing everything that I would normally do but it doesn't seem to be overriding like the other phtml files. ...
1
vote
1answer
96 views

Magento 2 Override Gallery.php file

I would like to override /vendor/magento/module-catalog/Block/Product/View/Gallery.php file getGalleryImagesJson function In result I would like to get - public function getGalleryImagesJson() { ...
1
vote
1answer
55 views

How to add sub-menus to Magento admin dashboard in Magento2.2.5?

How to add sub-menu to Magento admin dashboard in Magento 2.2.5? I need to override the vendor file. Refer my Screenshot. Any help would be appreciated.
1
vote
0answers
40 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
1answer
32 views

third party module controller overriding not working in magento 1

my config.xml <?xml version="1.0"?> <config> <modules> <Mindtwo_Formbuildercrfprotection> <version>0.0.1</version> <depends&...
2
votes
0answers
69 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 ...
1
vote
0answers
29 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\...
0
votes
2answers
39 views

How to override getAvailableMethods method in Magento\Payment\Model\MethodList

anyone have idea how to override getAvailableMethods method from Magento\Payment\Model\MethodList class.
0
votes
1answer
21 views

Consequent overrides of core class

I have two modules: Vendor_Module1 Vendor_Module2 In either module I'm going to extend \Magento\Directory\Model\Currency to override different methods I noticed that only one module can override ...
0
votes
1answer
66 views

Magento 1.9.3 - Can we override Mage_Core_Model_Session_Abstract_Varien class?

I am trying to override Mage_Core_Model_Session_Abstract_Varien class but not getting success. My config.xml file - <models> <coreoverride> <class>...
0
votes
0answers
52 views

Magento 1.9.x - How can rewrite Mage_Core_Model_Session_Abstract_Varien class

I am trying to re-write Mage_Core_Model_Session_Abstract_Varien class in my custom module but getting error : Recoverable Error: Argument 1 passed to Mage_Core_Block_Messages::addMessages() must be ...
0
votes
2answers
162 views

Magento 2 How to override adminhtml Js components

Basically I want to override grid.js component file in Magento 2 Require config view/adminhtml/require-config.js Require config code. var config = { map: { '*': { ...
0
votes
2answers
28 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 ...
1
vote
1answer
20 views

How to add new tab to any custom extension?

I have one previously installed extension which have 3 tabs already added , Now I want to add new tab below it , How can I achieve this . I want to add new tab regions . <adminhtml> <...
0
votes
0answers
21 views

Override function from grouped.php

I am changing the table for a grouped product. I have overridden the grouped.phtml file to make changes. But I need to override the function: getAssociatedProducts($product) // Grouped.php Because ...