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
3
votes
3answers
4k 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
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
5k 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
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
1answer
193 views

Overriding template for a specific language

I would like to override a template but only for a specific language (ar_SA) The template I want to override is: Magento_Catalog/templates/product/list.phtml I have tried putting it in the following ...
3
votes
2answers
312 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
948 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
159 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
1answer
1k views

How to overide ui component form in magento 2?

I want to add a custom field in cms page form in admin side. cms_page_form is created by using ui component form. How can I override this form in my custom module?
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
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
2answers
4k 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
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
755 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
1answer
1k views

Magento 2 - How to remove '--Please Select--' option from Custom Option dropdown on Product page

In Magento 2 I am trying to remove first option "--Please Select--". Here is my code. After the rewrite, I am not able to see custom option dropdown itself but the page is loading. Please let me know ...
3
votes
2answers
446 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
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
621 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
1k 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
3k 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
285 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
73 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
2k 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
247 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
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
791 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
4k 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
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\...
3
votes
1answer
542 views

How to override Paypal Standard Model

I am trying to override the Paypal Standard Model using the following files: app/code/local/Me/Paypal/etc/Config.xml <?xml version="1.0"?> <config> <modules> <...
3
votes
2answers
137 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 ...
3
votes
1answer
339 views

M2.1.9 : How to override the magento default .phtml file under vendor\magento\module-sales\view\frontent\templates\email\items.phtml

There. After success migration work, i need to handle devlopment work,ugh. I'm a mad newbie about Magento2 so could you let me know how to overwrite the default phtml file under vendor/magento .. ...
3
votes
2answers
731 views

How the Base folder will help on Magento 2 modules or themes fallback mechanism

As from official docs : base : used for both front end and admin html. As the part of Magento Theming, how and when to use base folder and how the fallback work with base folder. As i observed in ...
3
votes
1answer
785 views

Magento 2 override Pricing\Price\ConfigurablePriceResolver how to solve?

Hi I'm using Magento 2. I'm trying to override Pricing\Price\ConfigurablePriceResolver by adding a plugin or preference in the app/code folder but I can't make it work. I need to replace the ...
3
votes
1answer
543 views

Magento2 cannot override class Magento\GroupedProduct\Model\Product\Type\Grouped?

I was trying to override the above class (Magento\GroupedProduct\Model\Product\Type\Grouped) Below is my app/code/Best/CustomGrouped/etc/adminhtml/di.xml <config xmlns:xsi="http://www.w3.org/2001/...
3
votes
1answer
940 views

Magento 2: controller preference not working after setup:di:compile

I need to rewrite a couple of adminhtml controllers in Magento 2. I am using preference and my configuration in etc/di.xml file looks like this: <?xml version="1.0"?> <config xmlns:xsi="http:...
3
votes
1answer
3k views

Payment method only admin Magento 2?

When working with Magento 2, sometimes we want to disable Payment methods on the Front page and use it only for Admin. Or, if we want to set more rules for Payment methods to check whether payment ...

1 2 3 4 5 24