We’re rewarding the question askers & reputations are being recalculated! Read more.

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
1answer
38 views

Magento 2 override /lib html file [duplicate]

I am trying to override an html file in the lib folder, but I cant get it to work. Here is what I have so far: Path to file I want to override: /lib/web/mage/gallery/gallery.html Path to file I want ...
3
votes
1answer
51 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/...
3
votes
1answer
62 views

Overriding magento core scripts.js file: Magento 2

In our custom module, we have pages similar to the order page. We need some changes in the scripts.js file only in those custom module pages. Following is the core file we are using is module-...
3
votes
1answer
296 views

Magento 2 Override image problem (static image of parent theme)

Having a parent theme, I have created a child theme. (Magento 2.2) Parent theme: Mgs/claue Child theme: Bee/elag In the web there is a Title of page with a background css: .page-title-wrapper { ...
3
votes
1answer
626 views

How to override/extend base layout file via Module in magento2?

How can we override/ extend a base layout file via Module in Magento2? For example, I need to override the "catalog_product_prices.xml" from module-catalog/view/base/layout/catalog_product_prices....
3
votes
4answers
474 views

Can not override Magento/Checkout/Model/DefaultConfigProvider.php file

I want to change a file in Magento\Checkout\Model\DefaultConfigProvider file I am trying to change data in function but I can not override funciton Where I am going to Wrong. I have Created a File ...
3
votes
1answer
617 views

Magento 2 : How to override core js in Extension?

In magento 1.X we can check my exention is enabled or not in xml via below kind of code. <action method="removeItem" ifconfig="easylife_switcher/settings/enabled"> <type>skin_js&...
3
votes
1answer
751 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
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 ...
3
votes
2answers
212 views

Need to override Mage_Core_Block_Abstract function _toHtml()

I have 4 different stores in the same Magento system, so I have 4 different themes. One of them is overriding on /code/community/mage/cms/block/block.php the function _toHtml() like this: protected ...
3
votes
0answers
26 views

I want to rewrite phtml file in module-grouped-product

I am trying to rewrite the phtml file but it's not working my code is : a main file path is public_html/vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml ...
3
votes
0answers
40 views

Magento 2 Can We override **Add New Product** Page ? in custom_module on frontend area?

I want to make a custom page where vendor can add New Product with all text fields which Magento provide from the backend. I want to override this same page on my custom module on the frontend side. ...
3
votes
0answers
222 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 ...
3
votes
1answer
66 views

Overriding Magento 2 file causes fatal error

I've created an override by copying the original file here and then making my changes: app/code/Vendor/Module/view/adminhtml/templates/order/create/items/grid.phtml I have created a layout XML to ...
3
votes
1answer
111 views

How to Override custom module Model in custom module Magento 2?

I have two Modules in app/code. Xyz_Xyz - Module that already exists. I can't change its file. Abc_Abc - Module that I creating to override Xyz_Xyz Model. The code I try is here. app/code/Abc/Abc/...
3
votes
0answers
296 views

No Way to Clear/delete a Selected Image using Media Browser on category edit page

With reference to this Q&A there's another question. How do I clear the image selected using the Media Browser on category edit page in the admin Panel? Here's what I tried: in app/code/...
3
votes
1answer
881 views

Magento2 rewrite: product resource collection class does not effect on functions

I have rewrite catalog product resource collection Magento\Catalog\Model\ResourceModel\Product\Collection. Class override successfully but functions override is not working. Suppose, i want ...
3
votes
2answers
997 views

How to override layout file, which is already override by other theme - layout\override\base\somel_ayout.xml

How to override layout file, which is already override by other theme. For example, we have existing theme. app\design\frontend\<Vendor>\<themeone>\Module_Vendor\layout\override\base\...
3
votes
0answers
313 views

Magento2 : Override Admin Js file

I am working on Magento 2.1 CE. My current active Theme is the Default LUMA Theme I wish to override the CORE Modules "bundle-input-type.js" located in "vendor\magento\module-bundle\view\adminhtml\...
3
votes
2answers
2k views

How to override cart\addcontroller in magento 2?

I want this function in \code \StwBuyXGetY \BuyXGetY \Controller\Checkout\Cart\Add.php(this is written in magento 1.9, I want to convert it into magento 2). But I cant add any new function in add ...
3
votes
1answer
3k views

Magento 2 : Getting an error “syntax error, unexpected 'Abstract' (T_ABSTRACT)”

I have create 2 files as below : Namespace/Module/Model/Test.php <?php namespace Namespace\Module\Model; use Namespace\Module\Model\Payment\Method\Abstract; class Test extends Abstract { } ?> ...
3
votes
2answers
611 views

How to rearrange the links available in header in magento 2.0.2?

To Rearrange the Header links(ie to bring the My Wishlist link at last)in magento 2.0.2 (parent-theme:blank) I just overrided the default.xml file in vendor/Magento/module_wishlist/view/frontend/...
3
votes
0answers
992 views

layout.xml : change item renderer in checkout_onepage_review [closed]

I would like to change the item listing presentation in the checkout page. I then made a custom checkout/onepage/review/item.phtml file and in my module layout file I defined it based on the original ...
3
votes
3answers
2k views

override admin product information page

I was created admin module for manage supplier information, next I want to add supplier list drop down to product details ( catalog > manage product > Inventory >) How to do it ?
3
votes
1answer
230 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 ...
2
votes
2answers
12k views

Override core checkout cart controller

I have already included a custom controller in my local module. The config.xml snippet for it is: <routers> <subscription> <use>standard</use> ...
2
votes
2answers
2k views

Override AbstractPdf class in magento2

It is not good way to override core class of Magento. But I have to do this because I am in way that class is abstract and method is protected so I think preference and pluginshould not work. I found ...
2
votes
4answers
279 views

Trying to override Mage_Core_Model_Domainpolicy

I'm trying to override the model Mage_Core_Model_Domainpolicy. Everything should work by now, but, obviously, it doesn't. This is my config.xml: <?xml version="1.0" encoding="UTF-8"?> <...
2
votes
4answers
5k views

how to override Catalog\Category\Abstract.php

I want to override Catalog\Category\Abstract.php page. I have modified following things config.xml <global> <blocks> <adminhtml> <rewrite> ...
2
votes
3answers
4k views

Best Practice: How to add a column to a backend grid ?

Usually we need to add to the Order Grid some column, so let take this as example. There are 3 ways to do that: Rewrite the grid block in our custom module Use an observer on the event ...
2
votes
1answer
5k views

Magento 2 Training Overriding a core class

I'm trying to implement a basic m2 class override following the M2 Fundamentals Course and it is not working. Here is what I have in my Training/Test/etc/di.xml <?xml version="1.0"?> <!-- /*...
2
votes
1answer
2k views

Custom ajax loader gif in Magento 2

How can I override the default ajax loader gif in Magento 2? I can only find answers to do this in Magento 1
2
votes
2answers
466 views

Block override for new order creation not working

I have created a simple module which adds an indicator to the store selection form when creating a new order from the backend. Example As you can see it works, the problem is that it only works when ...
2
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 ...
2
votes
2answers
3k views

Magento 2 : override resource model that is called by factory method

I am trying to override \Magento\Sales\Model\ResourceModel\Report\Order\Createdat by using <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1answer
253 views

Add files to core or to local? (Not override)

I am installing the RedSys module http://www.redsys.es following their guide. At some point of their guide they say the following: 4.Se deben colocar los ficheros de la carpeta “Source”, incluido ...
2
votes
1answer
1k views

rewrite model not working

ihave problem again with my rewrite, i tried create rewrite model on my lesson app/code/local/Lesson/Test/etc/config.xml <?xml version="1.0"?> <config> <modules> <...
2
votes
1answer
3k views

How to override magento-checkout CustomerData/Cart.php?

I need some changes in CustomerData/Cart.php to have child products added to cart displayed in minicart. Can I make this overrides inside my Theme Folder. I would not like to have my changes smashed ...
2
votes
4answers
3k views

Override adminhtml form

I must rewrite the Sitemap form in the adminhtml. I must add a new field but I can't display that. I've checked on Google and the results haven't help me. <?xml version="1.0"?> <config> ...
2
votes
2answers
211 views

When to use model rewrites in Magento

I want to know when we should use model rewrites ? What's the down-sides of it ? I mean when we rewrite a core model class, we should know that no extension can rewrite the core class from now on, so ...
2
votes
1answer
2k views

Can not override Sales Resource Model Collection class

I am trying to override Mage_Sales_Model_Resource_Order_Collection My custom module's config: <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <...
2
votes
1answer
153 views

How do extensions override non-rewritable classes

I was going to put together a tiny extension to enable Template hints under global scope, but got stuck trying to rewrite core/template. Class rewrites only work for classes instantiated via one of ...
2
votes
3answers
649 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-...
2
votes
1answer
3k views

How to override cartcontroller in magento 2?

I want to override cartcontroller(checkout/controller/cart.php) by my module controller. Can anyone help me please? Any help will be appreciated. I just tried, But it is not working. My files are, \...
2
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://...
2
votes
1answer
1k views

Overwrite a already overwritten template(.phtml) file

The product listing page is already overwritten by a module from local codepool provided by theme. [Module name : shopby] Inside the active theme in design area, layout > shopby.xml i can see this ...
2
votes
2answers
498 views

How to add .phtml file in another .phtml file in magento?

I want to show the contents file: frontend\RWD\default\template\customer/address/edit.phtml inside the file: frontend\RWD\default\template\customer/account/dashboard.phtml. I insert this code ...
2
votes
1answer
1k views

Rewrite Adminhtml Model doesn't work

I need to rewrite app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php my config.xml : ... <global> <models> <mymodule> <class>...
2
votes
1answer
612 views

model overriding not working

I am overriding Usa\Model\Shipping\Carrier\Ups.php but its not working. i want update this function collectRates() code below what's the problem app/etc/modules/TechnikExpert_Usa.xml <?xml ...
2
votes
1answer
4k views

Rewrite core classes or override?

I have made a bunch of changes in my local folder to override core classes. But I'd like to group some of them into modules so i can turn them on and off. I am new to the module creation process. I'...