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
3k views

How to override customerData folder's file in magento 2?

I want to override app/code/Magento/Checkout/CustomerData/DefaultItem.php file. Becuase i have to change in this file. So how can i override this file
4
votes
1answer
3k views

How to override adminhtml phtml in magento 2?

Does anyone know how to override the below template? vendor\magento\module-backend\view\adminhtml\templates\media\uploader.phtml.
4
votes
2answers
1k views

Rewrite single method using local class

I need to override Varien class because I need to change one method. app/code/core/Varien/Data/Collection/Db.php From what I know, the only way is to put it inside local folder. app/code/local/...
4
votes
2answers
3k views

Magento 2.0.x Remove Account Tab in Mobile Menu

Summary: I'd like to remove the entire Account tab from the Magento 2.0.x mobile menu. Our site doesn't have accounts for users, it's more like a catalog with no purchasing. I've found many examples ...
4
votes
1answer
260 views

Why isn't my (very basic) module controller being loaded?

My file structure is as follows: Reckless ContactFormSelectors controllers Contacts IndexController.php etc config.xml Helper Data.php My IndexController.php file is very simple: <?php ...
4
votes
2answers
4k views

Indexing for large database is taking so much time

I have imported more than 1M of products for two stores. I am trying to indexing those products but it is taking long time through Admin and SSH. "Catalog URL Rewrites, Product Flat Data, Catalog ...
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/<...
4
votes
1answer
2k views

Magento 2: How to override Block file Configurable.php?

In magento 2, using Preference Configurable.php file is not simply override, Is this is magento 2 bug? I have override simply using preference method inside di.xml file but its not override. I want ...
4
votes
2answers
361 views

Rewrite all log messages of a module to a different log

This might be an odd question. In my shop i have a module which writes a lot to my system.log. The developers told me to ignore it but i like my log to be clean for other things. I'm not allowed to ...
4
votes
1answer
5k views

Magento 2: How to override UI component XML grid?

I need to override sales_order_grid.xml from ui_component of Magento_Sales. I want to remove some part of it but I don't know how to override it, I know how to override phtml from the custom module ...
4
votes
1answer
3k views

Override model from community module

I would like to rewrite a model class which is in the community pool. I've looked for solution but I cannot managed to override a community module. Here's my module: app/etc/Mycompany_Mymodule.xml: &...
4
votes
1answer
2k views

Overriding third party extension modules model not working (local on local override)

I've created a small module app/code/local/Mycompany/Managa/config.xml <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Mycompany_Managa> <...
4
votes
1answer
211 views

add doctype to emails

I have created an overwrite for one of the emails using the "transactional Emails" function to customize the html and styles of the email however I cannot find a way to add the following to the top of ...
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
2answers
420 views

Approach to third party module customisation

I am trying to customize a third party module and I was wondering what is the general approach to doing so? (I'm assuming that I am not the only one who needs to modify a third party extension) ...
4
votes
1answer
903 views

Not able to override a Model in magento 2

I'm working on a module in Magento 2.1 and have to override validate function of this class Magento\Customer\Model\Address This is what my di.xml contains: <?xml version="1.0"?> <config ...
4
votes
1answer
2k views

How To override the ui-component ViewAction.php in module-sales/Ui/Component/Listing/Column

I want to add another action in the grid for the sales in Magento back end The actions are defined in modules-sales\Ui\Component\Listing\Column\ViewAction.php So i want to override this file , But ...
4
votes
1answer
1k views

Magento 2: Override gallery.html file from vendor/magento/magento2-base/lib/web/mage/gallery

How to override file from vendor/magento/magento2-base/lib/web/mage/gallery folder. I have to some changes inside gallery.html file and gallery.js file. How to override those file inside my custom ...
4
votes
2answers
1k views

Override Magento Controller and controllers Files

I am trying to override a file in Controller and another in controllers directory of the Amazon Payments module. I have followed several tutorials with no luck at overriding the controllers and I have ...
4
votes
1answer
4k views

Remove taxes from quote item programatically

For an US webshop, I need to remove taxes from a quote item for some customers. I can't use groups because there are in use for a loyalty program. I have added a customer attribute names "...
4
votes
1answer
142 views

Controller ignoring _forward when compiler is on - is that desired behaviour?

Simple example tested on magento 1.7.0.2 Created overloaded controller for Mage_Cms_IndexController <routers> <cms> <args> <modules> <My_Extension before="Mage_Cms"...
4
votes
2answers
5k views

Rewrite a local Extension Module doesn't work

I want to rewrite a model from an extension in the "local"-folder. My Extension is also in the "local"-folder but it doesn't work and i have no clue what I'm doing wrong. The relevant part of the ...
4
votes
1answer
252 views

Magento2 rewrite _prepareCollection method

I want to override the _prepareCollection method but not working I am using preference to override the method, In the same class of another method except _prepareCollection is going to successfully ...
4
votes
1answer
726 views

Override the customer account creation email template in magento2

How can I override the core email template of customer account creation in magento2 please give solution
4
votes
2answers
4k views

How to Override Module CSS in Custom Theme?

I am using Magento 2.1.3 EE and my custom theme is using Luma as it's parent. I am trying to override a third-party module's CSS in my custom theme. I am not using LESS. When I say override, I mean ...
4
votes
1answer
846 views

Magento 2: How to enable newly created admin theme & override module?

I'm using Magento 2 CE Version 2.1.2. I have followed Magento StackExchange Questions/Answer for this. Still having issues. I would like to Override Magento 2: How to override Adminhtml "...
4
votes
1answer
47 views

Overwrite of Fooman EmailAttachments works about 50%

I'm using Fooman's EmailAttachments extension on Magento CE 1.9.2.4 - or I try to. This is my config.xml: <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <...
4
votes
1answer
844 views

Add Custom Fieldset Without making a Core module Rewrite

I am wondering, is there any way to add a custom fieldset to an admin form, without overwriting Form container class of that admin-form. I will explain it little bit. Suppose we need to add a new ...
4
votes
3answers
386 views

Magento2: Override default phtml file without create custom theme?

I'm trying to override customer's login.phtml file and I am able to manage the override by creating custom theme Tracks/customtheme, also I put the .phtml file in my custom theme like this /app/design/...
4
votes
1answer
220 views

How to override _registerJsPrice($price) function in Configurable.php Block in Magento2?

I am trying to override __registerJsPrice($price) function in configurable.php This function is work when we change swatch. Path of configurable.php is /opt/lampp/htdocs/magento/vendor/magento/...
4
votes
1answer
2k views

Magento 2 preference not working in di.xml

I have a custom module where I'd like to extend the Base Handler <preference for="Magento\Framework\Logger\Handler\Base" type="Custom\Foo\Handler\DefaultHandler" /> Strangewise this does not ...
4
votes
1answer
2k views

Problem with overriding of observer

What I'm trying to do is to override one single method in Model/Observer.php of other module. I followed this tutorial: http://www.atwix.com/magento/overriding-observers/. As a result I've created my ...
4
votes
1answer
501 views

Magento2: Tier price higher than regular price

I figured out that if you set a tier price higher than the regular price, it will show the regular price anyway. Seems this is the "normal" funcionality, always show the lower price if it's possible. ...
4
votes
1answer
2k views

Override order item view phtml in Admin Section

I need to rewrite the code for sales/order item view in Admin which is located in here: app/design/adminhtml/default/default/template/sales/items/column/name.phtml i need to completely rewrite the ...
4
votes
2answers
4k views

How to override Magento 2 js using Mixins?

I want to override the js file in module-checkout/view/frontend/web/js/model/cart/totals-processor/default.js using mixins. Here is my requirejs code: var config = { config: { ...
4
votes
1answer
662 views

Magento 2 : Rewrite Method savePaymentInformationAndPlaceOrder

I'm trying to create payment module that rewrite method savePaymentInformationAndPlaceOrder in model \Magento\Checkout\Model\PaymentInformationManagement. Here is snippet code from my own module in ...
4
votes
1answer
277 views

Overwrite Mage_Paypal_Model_Api_Nvp

I want to overwrite Mage_Paypal_Model_Api_Nvp in my custom_module. For this, I have follow following steps but after that also core file is calling. config.xml <models> <paypal> ...
4
votes
2answers
2k views

How to Override Mage_Catalog_Block_Product_View with a Custom Module

I am trying to override Mage_Catalog_Block_Product_View through a custom module in order to strip html tags out of the default meta description. I'm not sure what I'm missing or if I'm making any ...
4
votes
1answer
1k views

Difference between overriding and extending or even rewrite (abstract class)

I want to change the method collect() from Mage_Sales_Model_Quote_Address_Total_Abstract By what I've read it seems I can't rewrite it since it's abstract and it is never instantiate. Looking ...
4
votes
2answers
369 views

Never rewrite for existing files, directories and links

I install my Magento CE 1.8.1 on Nginx server. My nginx conf file is like this: Configuring nginx for Magento I created a subfolder in Magento root folder, then put in it some php files. I tried to ...
4
votes
3answers
952 views

Create custom tax class based on weight

in germany there is a special Tax on coffee: 2.19 EUR per 1000 gram, and 4.78 EUR per 1000 gram for instant coffee. I'd like to solve this problem by adding a custom tax to magento. How would I do ...
4
votes
3answers
1k views

How to override crontab.xml?

I need to override a crontab.xml from: vendor/magento/module-integration/etc/crontab.xml <job name="expired_tokens_cleanup" instance="Magento\Integration\Cron\CleanExpiredTokens" method="...
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
568 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 ...
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
2answers
1k views

Magento 2: Add a Custom Import Sample File to vendor/magento/module-import-export/Files/Sample directoy

I created a custom import module from two custom models and tables. The imports works fine, and without any error or problem now. But I noticed that next to Entity Type dropdown, appears a "Dowload ...
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
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> ... &...