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
5
votes
2answers
152 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="...
5
votes
1answer
2k views

How to override template files in a module

I have two template files that I need to override in a custom module. Those files are app/design/frontend/<current-theme>/template/catalogue/category/view.phtml app/design/frontend/<your-...
5
votes
1answer
1k 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. ...
5
votes
1answer
641 views

Override Available shipping method template from custom module not working

I tried to override the core template file which located in app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml like this: app/code/local/Test/...
5
votes
1answer
4k views

Override and extension class which in turn overrides a magento core class

I have a requirement which would need me to write an extension that overrides a class from another extension which in turn uses the rewrite to override a core module. Whilst I have the feeling that ...
5
votes
0answers
1k 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....
5
votes
1answer
290 views

Overriding Magento 2 core js function

I need to override the 'loadArea' and 'loadAreaResponseHandler' magento core js functions in the file module-sales/view/adminhtml/web/order/create/scripts.js. I tried to use mixin property. Following ...
4
votes
3answers
8k views

Redirected to the Homepage when removed www. from URL

Say, My Website is : www.example.com I have one page : www.example.com/contactus If I remove "www." from above url, means : example.com/contactus It redirects me to the homepage. Why ?? Checkout ...
4
votes
3answers
5k views

Magento 2: How to add Custom CSS/JS that will load last among other CSS/JS files

I need to override CSS/JS that will override the styling and I need it to load the last part among other CSS files link like: <head> <title>Home page</title> <link rel="...
4
votes
2answers
11k views

How to override product list page [duplicate]

I'm trying to override the list product page. My objective is add certain information on each product above the add to cart button for example. I already did with the single page product, just ...
4
votes
2answers
937 views

Magento 2.1: <preference> doesn't work with block

I try to override getSelectionTitlePrice() - function. (vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle/Option.php) if i have understood right the best way to do it is use ...
4
votes
2answers
3k views

Copy core file to app/code/local/Mage can't overload!

I have 2 files need to be overload core/Mage/Admin/Model/Session.php and core/Mage/Adminhtml/controllers/IndexController.php I already copy it to local with same structure, but the bad news is it ...
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
1answer
261 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
5k 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
236 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 ...
4
votes
1answer
2k 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?
4
votes
1answer
3k 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
388 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
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
1answer
2k 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 ...
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
233 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
2answers
499 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
987 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
144 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
2k views

Override js core function in Magento 2 [duplicate]

in backend there is module-sales/view/adminhtml/web/order/create/scripts.js, and inside that js there is a function like this : loadShippingRates : function(){ this....
4
votes
1answer
952 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
54 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
856 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
608 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
242 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
4k 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 ...
4
votes
1answer
3k 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
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
8k 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
843 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
309 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
401 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
988 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
0answers
336 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 ...

1 2
3
4 5
25