Questions tagged [overrides]

Questions about overriding core features (class rewrites, local code pool, theme overrides). For URL rewrites, use the "url-rewrite" tag instead.

302 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18
votes
4answers
2k views

Adding a new method to an Abstract Class in Magento 2

Like this thread said: Override abstract class in Magento 2 in Magento 1, I can just create a full new class. In Magento 2, we need to use plugins, but plugins only allow me to modified existent ...
6
votes
0answers
637 views

How to override class Virtual Type class

I saw this, but it don't work for me. How to override Virtual Type class in Magento 2 <virtualType name="categoryFilterList" type="Magento\Catalog\Model\Layer\FilterList"> <arguments>...
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
233 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
0answers
307 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 ...
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
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
295 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
1answer
95 views

How to add label to street fields in Customer registration in admin panel?

I want to add two more Labels Colony and Area after Street Address.How can I achieve this ?
3
votes
0answers
38 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
43 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
1answer
138 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
383 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
1k 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
1k 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
334 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
3k 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
2answers
774 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
2answers
621 views

how to override any .phtml or class file in magento2 using custom module?

Well I have an idea to create custom module in magento2 but when it comes to override code functionality I stucks. for example I have to override this file default.phtml in /vendor/magento/module-...
2
votes
0answers
117 views

magento 2 how can I overwrite ar_SA.xml language symbol file?

I want to overwrite this file in my module. vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml How can I archive this ?
2
votes
3answers
2k views

How to override Magento 2 framework file?

I try to override this file : vendor/magento/framework/View/Element/Html/Link/Current.php I create a module.xml, registration.php and di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
2
votes
2answers
1k views

Magento 2 - Override template files in module

What is the correct way to override a template file ? I need to display custom text in place of In Stock and Price on the product page. I want to override the template - Magento_Catalog/view/...
2
votes
1answer
255 views

Magento 2.3 - Overide \magento\zendframework1\library\Zend\Locale\Data\xx.xml

Is there anyway to override and not change directly the \magento\zendframework1\library\Zend\Locale\Data\xx.xml ? This is so that I can change the decimal denoter from "," to "." for stores that ...
2
votes
1answer
106 views

Call to helper of module not change the Mage_ prexif by my module prefix

I have changed my etc/system.xml and my etc/config.xml with the structure which should replace the Mage_JaviNewListProductController_Helper_Data by Lecasa_JaviNewListProductController_Helper_Data. I ...
2
votes
0answers
412 views

How to override Magento_ConfigurableProduct/js/configurable.js

I'm following this instruction to override "Magento_ConfigurableProduct/js/configurable.js" but it doesn't work. I'm following this link: https://magento.stackexchange.com/a/131852/70258 After i ...
2
votes
2answers
32 views

Whats the best way to override a block class in magento2

1) Use preference in di.xml and add new methods or do changes 2) Or create a new class which extends the actual class and attach the new class to your phtml. Lets suppose you want to extend Magento\...
2
votes
0answers
57 views

ConfigurableProduct: How to get the configurable products out of stock?

I want to show all the attributes from my configurable product on my select. I followed this tutorial: Magento 2.2 How to show out of stock in configurable product, with some changes and fixes. So, I ...
2
votes
0answers
246 views

How to override Magento 2 welcome email upon new customer account creation

I need to customize default Magento welcome email template which is sending upon new customer account creation in my custom module. I'm using the following functions for sending welcome email upon ...
2
votes
0answers
130 views

Magento 2 plugin not working for CommonTaxCollector model

I want to overwrite mapItem function which is under the CommonTaxCollector class. So, I have done this but getting undefined error. Uncaught Error: Call to undefined method Magento\Tax\Api\Data\...
2
votes
2answers
774 views

Magento 2 : override phtml file issue

I faced problem with overriding a phtml file in Magento 2. I want this:- (1) Core Module of phtml Override By Custom Module called - A (2) Same phtml file of Module - A Override By Some Custom ...
2
votes
1answer
637 views

Magento 2 : AdvancedSalesRule override validate method

I need to validate custom quote item details, So I am overriding module AdvancedSalesRule "\Magento\AdvancedSalesRule\Model\Rule\Condition\Product" file. But Not getting quote item Id in model object. ...
2
votes
0answers
39 views

Override magento 2 default files

How to override default magento 2 file vendor/magento/framework/Reflection/ExtensionAttributesProcessor.php in my custom module.
2
votes
1answer
671 views

“message”: “Property \”Slots\“ does not have corresponding setter in class \”Magento\\Quote\\Api\\Data\\CartItemInterface\“.”

am using Webkul_BookingSystem extension for booking slot in magento2.1.7. The issue what I got here: While I add the product details in to cart through Rest API the Slot class showing does not have ...
2
votes
0answers
248 views

Override class in setup:upgrade command in magento2

I am trying to override the class FilePermissions (magento/framework/Setup/FilePermissions.php) but my changes are not taken in account while I use the bin/magento setup:upgrade I tried : To add a ...
2
votes
0answers
162 views

In Magento2 what is the place to override the quote?

In Magento2, I want to modify the Quote. I want to add some custom attributes to the items and change the order of the items. At what level should it be done, Model, Controller, Block? Please, ...
2
votes
1answer
761 views

How can I override magento/framework/data/structure file in magento2?

I have created custom module to override this (Magento/Framework/Data/Structure) file. I have tried this in di.xml file: <preference for="Magento/Framework/Data/Structure" type="Modulename\...
2
votes
2answers
197 views

Can't override recent order template from custom module

In customer account dashboard there's a recent orders block, i tried to override it like this: app/code/Test/SuccessPage/view/frontend/layout/customer_account_index.xml <?xml version="1.0"?> &...
2
votes
2answers
2k views

Why my overriding of the success.phtml is not working?

I have copied and pasted the file from vendor/magento/module-checkout/view/frontend/templates/success.phtml to app/design/frontend/THEME/THEMENAME/Magento_Checkout/templates/success.phtml ...
2
votes
2answers
1k views

Can not override UI Component template

app/code/namespace/module/view/adminhtml/ui-component/product_form.xml <?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright 2013-2017 Magento, Inc. All rights reserved. * See ...
2
votes
2answers
1k views

Overriding Magento\Catalog\Model\Layer class not working in Magento 2

Overriding Magento\Catalog\Model\Layer class not working in Magento 2. I'm trying to create a custom module for showing custom product collection with layered navigation. here i added di.xml file to ...
2
votes
1answer
137 views

How to override UpgradeData.php with Factory?

I need to override the UpgradeData Class from Catalog\Setup\UpgradeData But the constructor has factories in his arguments like CategorySetupFactory When I run setup:di:compile I got an error that ...
2
votes
0answers
63 views

How can I get Add products link on Backend Products Information Page

I need to add products from Backend Products Information Page, how can i get add products link on products information page.
2
votes
1answer
1k views

magento 2 how i can override the config save controller adminhtml?

magento_root\vendor\magento\module-config\Controller\Adminhtml\System\Config\Save.php how can i override this controller in the magento 2
2
votes
0answers
442 views

Magento2: Override Vendor Resource Model _afterLoad method

I am trying to override the _afterLoad methods of the vendor class Magento\Catalog\Model\ResourceModel\Product\Collection unsuccessfully. In my custom module I edited the di.xml in this way <?xml ...
2
votes
3answers
249 views

Limitations about override model entity

I thought I was quite familiar now with plugins and preferences to override built-in behavior of Magento 2. However it seems not, and I have a question, is there some particular technical limitations ...
2
votes
3answers
902 views

How can I override admin create order controller?

I am trying to override adminhtml_sales_order_create controller. I have created a small module app/code/local/Akina/Sales/etc/config.xml <?xml version="1.0"?> <config> <modules> ...
2
votes
1answer
685 views

How to Override Payment Helper Data Method Magento 2?

I am trying to override Magento Payment Helper data in my extension but it's not working. I have overriden by using the preference method. I have put below code in app/code/Demo/PaymentTest/etc/di....
2
votes
1answer
233 views

Override block function

I want to filter wishlist product collection with a unique id. I have tried to override a method _createWishlistItemCollection located at the path /vendor/magento/module-wishlist/Block/AbstractBlock....
2
votes
1answer
75 views

Overriding class Magento 2.1

I'm trying to inject \Magento\Framework\Filter\FilterManager $filterManager Object to be able to use truncate fucnction in list.phtml $this->_filter->truncate($string, ['length' => $...
2
votes
0answers
381 views

How to proper extend variables and override module style?

I am new to Magento and currently developing a child theme inherited from the Magento blank theme. I read the developer documentation and doing okay. I created my own style.less in my web directory ...

1
2 3 4 5
7