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
4
votes
2answers
1k views

Override method in LayoutProcessor

I want to make changes(PHP code) to the method processPaymentConfiguration, but I don't know how I can override the method so my changes have a higher priority. I can alter the LayoutProcessor file ...
4
votes
1answer
760 views

How do I get a list of all class rewrites in Magento 2? [duplicate]

We use plugin/preference to extend/rewrite core class functionality. How I can print list of all custom module classes which has rewritten core classes in custom extensions?
4
votes
1answer
1k views

Magento2.1: How to override the template in custom module?

I want to create an extension that will give shop owners ability to edit their product image. So I understand I need this template Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml I ...
4
votes
1answer
327 views

How to avoid duplicate code error while upload extension on Magento marketplace

I have developed a module which extends customer registration feature. In this module, I have overridden two controllers 1. \Magento\Customer\Controller\Account\EditPost I have added custom method ...
3
votes
3answers
8k views

Magento2 - override 3rd party module layout file in custom theme

We have a custom theme with some layout / template overrides Now we have installed a 3rd party module, which is overriding one of layout files in our custom theme. So, only module's override is being ...
3
votes
1answer
8k views

How to Override core customer model In Magento 2?

I have to override customer ResourceModel's customer.php file in my custom module. I have tried but its not working.so what is correct way to override Model? I follow below steps to override Model. ...
3
votes
1answer
4k views

How to overwrite lib template file - Magento 2

How can the HTML files from the library be overwritten? I need to overwrite this template: lib/web/mage/gallery/gallery.html I have tried placing the file in my own theme in the below locations, I'...
3
votes
3answers
5k views

Override model function Magento 2

I want to override one of the function in Magento core model which is located in vendor\magento\module-sales\Model\Order\Email\Sender\OrderSender.php <?php /** * Copyright © 2016 Magento. All ...
3
votes
1answer
6k views

Want to rewrite core Helper class (Mage::helper('core'))

i want rewrite magento helper core class Mage_Core_Helper_Data. I have try below code, but it is not working <?xml version="1.0" ?> <config> <global> ... &...
3
votes
2answers
5k views

How to override a phtml file from a custom module in magento 2?

I need to override /vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml. For this, in app/code/namespace/Customtab/view/frontend/layout/catalog_product_view.xml <?...
3
votes
2answers
3k views

Trying to rewrite Catalog Product Collection

I'm trying to rewrite the Magento Catalog Product Collection - basically I have a specific filtering rule that must be applied every time a product collection is loaded, so I'm figuring that putting ...
3
votes
2answers
6k views

Wrong tab configuration. error?

I am trying to extend Mage_Adminhtml_Block_Customer_Edit_Tab_View class in order to pass in some functions and display them using a layout update in adminhtml/default/default/template/namespace/...
3
votes
1answer
3k views

rewrite a controller that is already rewriting another

Is it possible to rewrite a controller in a community module that is already rewriting a core controller? I have the syntax correct as it is working in other rewrites but in this specific case the ...
3
votes
2answers
135 views

Question of previous developers use of <rewrite>'s

I'm not only new to Magento, but also inheriting a project from a previous developer. The developer has a module called Adminhtml, which he used to customize the Adminhtml section, and inside the ...
3
votes
2answers
317 views

Magento 1: use of observers and missing native core setter?

Yet another best practice question. So here's the thing, I have several modules that deal with setting different data on the core Magento block. I don't like to rewrite entire blocks and I tend to ...
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 ...
3
votes
1answer
2k views

Custom canonical tags

I am trying to override Magento's addLinkRel method to set custom canonical tags: I want my shop's canonical tags to point to the main shop's pages. So I created code/local/Fkoessler/MyProduct/etc/...
3
votes
2answers
961 views

What is the proper way to extend the Enterprise_PageCache_Model_Processor

I am trying to extend Enterprise_PageCache_Model_Processor and found that I can do it by making sure that I either modify the enterprise.xml in the app/etc global configs but I wanted to do it in a ...
3
votes
3answers
4k views

Magento/Apache internal redirects hang the server

I've asked a similar question on StackOverflow, but to no avail. Here is the issue I've been facing for the last few weeks: Once in a while our Apache server hangs, to bring everything back up I'm ...
3
votes
2answers
584 views

Override vendor/magento/module-ui/view/base/web/js/modal/confirm.js Magento2

Can anyone help how to over ride vendor/magento/module-ui/view/base/web/js/modal/confirm.js file in theme. Thanks
3
votes
2answers
164 views

Replacing Magento 1 Controller Rewrites in Magento 2

Is there any general consensus on the best way to replace M1 style controller rewrites in M2? That is, in Magento 1, you could rewrite a URL path to point to controllers from your own module <...
3
votes
2answers
5k 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
2k views

Magento 2 : Overide Magento\Catalog\Block\Product\View\Gallery Block

I am working on custom extension and need to override Magento\Catalog\Block\Product\View\Gallery block. I have followed this method. In di.xml, <preference for="Magento\Catalog\Block\Product\...
3
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://...
3
votes
2answers
5k views

Changing main navigation?

I would like to change the dropdown behaviour of navigation. Which files need to be changed? I try to give the dropdown 100% width and place items inline I see this file /vendor/magento/module-...
3
votes
2answers
3k views

Magento2: Checkout cart total block class is not override

Try to Override Checkout cart total block \Magento\Checkout\Block\Cart\Totals#L11 but is not override.Getting the error: Recoverable Error: Argument 4 passed to Magento\Checkout\Block\Cart\Totals::...
3
votes
2answers
713 views

magento 2 override a functionality compared with magento 1

In magento 1 we have local - community - core areas inside app->code folder. When you want to override a functionality placing code with same names in local or community will do the job. working in ...
3
votes
2answers
4k views

Overriding Block in Magento 2

I'm playing overriding the blocks in magento 2, extended block constructor is calling but inside method is not working? my code is di.xml <?xml version="1.0"?> <config xmlns:xsi="http://...
3
votes
2answers
233 views

Overriding local modules from community pool

I have an extension in the local pool. I would need to override the Block in the module. Can I do it from the community pool. (yes, I know this is not how it should be done, but I'm making a small ...
3
votes
3answers
797 views

Config.xml override not working

I have been trying to override Mage_Adminhtml config.xml, so that Grouped Products do not appear while creating an order from admin. I have checked line by line, don't know why its not working. The ...
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
2answers
942 views

Magento 2 module not working. Override fails

I am trying to write a module that filters products in a product collection. For that I have tried to override Magento\Catalog\Model\Layer. These are the files in the module: /Viking/FilterProducts/...
3
votes
2answers
2k views

Model Override issue in magento 2

I have issue in Override the Newsletter Queue Model to sent Newsletter Based on Specific Customer group. But, It throw PHP Fatal error: Uncaught TypeError: Argument 2 passed to Magento\...
3
votes
2answers
4k views

How to override html file in magento 2.1

I need to customize Magento_Checkout module. I have tried to copied that html files into my theme path but the override is not working Override path mentioned in below /app/design/frontend/Vendor/...
3
votes
3answers
3k views

Magento resource Collection override

I have been trying to override Magento resource collection class. I have found few solutions but it seems can't get it to work. The class is located in: App/code/core/Mage/Reports/Model/Resource/...
3
votes
1answer
333 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
75 views

Trying to add XSRF validation to contact form

I am trying to block a recent "Contact Us" form spammer. I figured the best way to do this is by adding a form key and validating it in the controller. This works when I modify core files, which is ...
3
votes
1answer
1k views

Possibilities in local.xml configuration

I'm rather new to Magento and read in this article that it is possible to configure the base_url values in app/etc/local.xml. Would be nice to have this functionality for running multiple environments,...
3
votes
2answers
3k views

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

I'm trying to override a model class Customer.php, maybe I've configure it wrongly, this error occurs: a:4:{i:0;s:316:"Recoverable Error: Argument 21 passed to Magento\Customer\Model\...
3
votes
1answer
265 views

Rewrite Mage_Core_Controller_Varien_Front

How can I rewrite Mage_Core_Controller_Varien_Front? I have already tried the way we rewrite controllers but it is not working. ADDED CODE <frontend> <routers> <...
3
votes
2answers
2k views

How to override grouped.phtml file in my own module in magento 1.9.1.0?

I want to overwrite grouped.phtml file located at app\design\frontend\rwd\default\template\catalog\product\view\type\ path in my own module. My magento version is 1.9.1.0. Please guide me.
3
votes
1answer
2k views

Extending a controller doesn't appear to work

I'm trying to externd a controller. The customer controller to be exact. I found a example on Inchoo But I can't get it to work. I tried turning off all othermodules. I've checked everything ...
3
votes
1answer
1k views

Rewrite in custom module to non existing core class model

I found it is possible to do a rewrite on a core class that does not actually exist.... Usage case example: I am creating a reCaptcha module that integrates google recaptcha into magento's core ...
3
votes
2answers
1k views

How to override magento default search result

I want to override magento default search result, what I want to do is if products are not assign to any category then those products are not display on frontend in search result, by default magento ...
3
votes
1answer
99 views

Is it possible to override vendor/magento/module-sales/Api/Data/OrderAddressInterface.php

Is it possible to override vendor/magento/module-sales/Api/Data/OrderAddressInterface.php as I want to get sales order address custom column value in order REST API.
3
votes
1answer
1k views

Difference between Extend a layout and Override layout

In Magento2 currently, I override XML file using below way and make required changes. app/design/frontend/Vendor/Theme/Magento_Catalog/layout/default.xml But I have seen in Magento dev docs ...
3
votes
4answers
1k views

Magento 2 override block not work properly

I am overriding the Catalog Search result block but it is only showing title not product listing. Can anyone tell what i missed here? di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
3
votes
1answer
5k views

Magento2: Override layered navigation template

I am trying to override layered navigation template in a Magento2 app. Here is my code: Layout configuration: <!-- app/code/MyVendor/MyModule/view/frontend/layout/default.xml --> <page ...
3
votes
2answers
2k views

Magento 2 Fail to override template

I want to override the register.phtml in Magento_Customer module. But the setTemplate method fails to override the original register.phtml because the register.phtml was overridden in ...
3
votes
1answer
6k views

How to Override or Extend protected or parent function in Magento 2 using Plugin

I need to override protected function or parent function ex Magento\Checkout\Controller\Cart\Add is extended from Magento\Checkout\Controller\Cart and getBackUrl() is a Magento\Checkout\Controller\...

1 2 3
4
5
25