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
0
votes
1answer
23 views

Magento2 : How to override FinalPrice.php file in Magento2

I want to override vendor/magento/module-catalog/Pricing/Price/FinalPrice.php with constructor argument. Note : File overriding is working fine but when I create constructor in the overridden ...
0
votes
1answer
31 views

override coupon management and guestcoupon management core vendor files magento 2

I want to override Couponmanagement.php of Magento\quote\Model\CouponManagement and guestcouponmanagemet.php of Magento\quote\Model\GuestCart\GuestCouponManagement but my plugins are not working....
0
votes
0answers
13 views

Customer account wishlist block replacement removes content

I have replaced the vendor/magento/module-wishlist/Block/Customer/Wishlist.php for my own app/code/myVendor/myModule/Block/Customer/Wishlist.php I have written in the app/code/myVendor/myModule/etc/...
-1
votes
0answers
18 views

How to override Controller file [duplicate]

i want to make changes in vendor/magento/module-contact/Controller/Index/Post.php . How can I override Post.php in-app folder? I am using Magento 2.3
0
votes
0answers
20 views

Magento 2 : Add a custom attributes to quote

I have a custom quote module, that i would like to modify and add 2 custom fields, The admin quote module is similar to sales order admin pages, so i want override the admin templates and layouts to ...
0
votes
2answers
44 views

Magento 2 What we can do when two modules override same block?

I have two modules which are using the same block function. i.e. module 1-> ABC, module 2-> XYZ both modules are using preference method to override core module's block file. => Let say in core ...
0
votes
1answer
22 views

Magento 2: Override admin layout didn't work

I would like to override this quotation_quote_view.xml file layout (from a custom module) and add a block below this block reminder_date <block class="Cart2Quote\Quotation\Block\Adminhtml\Quote\...
1
vote
0answers
32 views

How to rewrite store view code in Nginx?

I have some trouble to fix this issue. I have a Magento 2 installation with two websites and several store views: https://www.websiteone.com/onenl https://www.websiteone.com/oneen https://www....
0
votes
1answer
54 views

How to override module-newsletter in magento 2?

How to override the subscribe.phtml form which is in vendor / magento / module-newsletter to add my input data and save it in my database table ?
0
votes
1answer
26 views

Override Customer Account Edit on Frontend

Magento 2 newbie. I am trying to override the default 'Customer Account Edit' form on the Frontend. I'm not able to get my template to "override", its always loading the default template [/html/...
0
votes
0answers
14 views

Magento 2: How to override new_grid.phtml in Custom Module?

I need to override product/widget/new/content/new_grid.phtml file in my custom module. Please tell me the possible ways to do it.
0
votes
2answers
14 views

How zend libs file(Rewrite Zend_Pdf_Resource_ImageFactory) class in Magento 2

i am trying to override Zend libs class like magento2 using preference My di.xml code is <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
2answers
32 views

How to override productcollection.php from vendor?

I have to override the file ProductCollection.php from vendor/magento/module-catalog/Ui/DataProvider/Product. I have read many posts but still not getting to override the file. Can anyone please ...
1
vote
2answers
43 views

how to override core JS file in module

I am trying to override Magento_Braintree/js/view/payment/method-renderer/cc-form But i am not getting any progress. I have tried map 'Magento_Braintree/js/view/payment/method-renderer/cc-form': '...
1
vote
3answers
73 views

Magento 2 - Override phtml files not working

I am working on Magento 2 and I override few PHTML files from vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml to app/design/frontend/vendor/module/Magento_Catalog/...
0
votes
0answers
10 views

How can I create a file that will override the core file containing the header section design of the frontend from my own module in app/code

How can I override the header section of the file containing the name of the default message and sign in options from my own module under app/code.
0
votes
0answers
21 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 ?
1
vote
0answers
26 views

Override module's model with another Magento 2 module

I tried to override a custom module model with creating a new module, i got class not found error etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
2answers
37 views

I am overriding a controller and want to use a custom helper in the overrided controller,how can i?

I've overridden following controller:- Magento\Customer\Controller\Account\CreatePost.php And the constructor method of this class is:- public function __construct( Context $context, ...
0
votes
1answer
65 views

Moving a vendor module to new cron group in magento 2

We are utilizing the Firebear module to import product and pricing data which run in the default cron group. The import takes quite a bit of time/resources so it was recommended to move the Firebear ...
0
votes
1answer
33 views

Magento 2: How we can add construct into overridden class

If There are no parent::__construct from parent class then How we can add construct into overridden class?
2
votes
0answers
21 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 ...
0
votes
3answers
43 views

How to override customer login.phtml and customer_account_login.xml file in custom module Magento 2?

I need to customize a customer login form. I need to add social media button in that page as well as register page. So please give me a solution with customer_account_login.xml and Login.php update ...
2
votes
0answers
34 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. ...
0
votes
0answers
20 views

Topmenu override declaration error Magento 2.3

Topmenu override declaration getting error in Magento 2.3
0
votes
0answers
31 views

How to override core vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml

I want to override vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml because for my Arabic store currency symbol was not working. By referring to this URL I got the solution. But ...
1
vote
0answers
25 views

Override Api xml Magento1

i made changes in app/code/core/Mage/Customer/etc/api2.xml now i want to override this xml in my local module how i do
0
votes
1answer
12 views

Extend/Override Javascript Included from Layout (head->link)

I want to extend: vendor/magento/module-catalog/view/adminhtml/web/js/edit-tree.js Which is loaded by layout: vendor/magento/module-catalog/view/adminhtml/layout/catalog_category_edit.xml:12 Why I ...
1
vote
1answer
32 views

How to override Product details Page controller magento 2

hi all, i want to override Magento\Catalog\Controller\Product\View.php file i tried to override but it's not loading the product page. <?php /** * * Copyright © Magento, Inc. All rights ...
0
votes
3answers
45 views

Overwrite magento_theme adminhtml ui_component xml file

I am trying to overwrite following file: vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml The changes work when editing the file directly in vendor dir, however, I am ...
1
vote
4answers
38 views

Help with overwriting .phtml file in Magento 2.2.7

I need some advice on how to overwrite category description 'block?' from file /app/design/frontend/Mgs/mgsblank/Magento_Catalog/templates/category/description.phtml I want to use my own module ...
0
votes
1answer
26 views

handle conflicts when override Order Sender class in magento 2

I am overriding OrderSender class for add custom variable in order confirmation mail. This variable's value is dynamic. but this file conflicts and give an error like "Type Error occurred when ...
2
votes
1answer
55 views

How to show Recently Searched Products without using Widget on HomePage (Luma). Magento2

I want to show recently searched products on homepage without using Recently Viewed Products Widget I want to get this in my custom block and also want to show this in my custom .phtml file how it ...
0
votes
0answers
18 views

Edit a phtml file exists in adminhtml

I want to edit the invoice from adminhtml, so what is the best way to edit a phtml file in adminhtml folder?
3
votes
1answer
32 views

Magento 2 - Argument 2 missing error on overriding file

I am trying to override Magento\Catalog\Block\Category\View added this code in di.xml <preference for="Magento\Catalog\Block\Category\View" type="Naheed\AllProducts\Block\Category\View" /> ...
1
vote
1answer
30 views

Magento 2: Overriding a protected function that implements another interface

I want to override the addDefaultAttributes function in /vendor/magento/framework/View/Page/Config/Renderer.php to remove the type="text/javascript" it inserts into the js meta tags. I have tried to ...
0
votes
0answers
12 views

How do I override an html file located in the admin seccion? [duplicate]

I'm using the new Magento 2.3 pagebuilder and i'm trying to add a "span" tag inside a button of the banner/poster of the pagebuilder. I found out where I can change the pagabuilder view on my ...
0
votes
3answers
48 views

How to override protected function Magento 2?

i want to edit this function in Magento\Eav\Model\ResourceModel\Entity\Attribute.php protected function _updateDefaultValue($object, $optionId, $intOptionId, &$defaultValue) { if (in_array($...
2
votes
1answer
70 views

Override abstract class

I have to override Sender.php which path is Magento\Sales\Model\Order\Email I try but its not work my code is : di.xml <type name="Magento\Sales\Model\Order\Email\Sender"> <plugin ...
3
votes
1answer
32 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 ...
7
votes
1answer
108 views

Magento 2.3.1 override view.xsd Using Plugin Not working before 2.3.1 it's Working

I am trying to override view.xsd using Plugin and it's working on magento 2.1.x and 2.2.x but not working in 2.3.1. I Add Same code To describe Here. Extending the complexType named "imageType&...
1
vote
1answer
30 views

Captcha Helper method override not working in Magento2

Need to override method getImgUrl() from vendor\magento\module-captcha\Helper\Data.php but not success app/code/YourCompany/YourModule/etc/di.xml <config xmlns:xsi="http://www.w3.org/2001/...
1
vote
1answer
75 views

Magento 2 Seo title product override not working

I overrided the Magento\Catalog\Block\Product\View.php adding this code protected function _prepareLayout() { parent::_prepareLayout(); $this->pageConfig->getTitle()->set($title . '- ...
0
votes
0answers
20 views

How to add custom method in product interface.And how to overide productinterface and product model

I want to add custom method in product interface and override product interface and product model.
1
vote
0answers
32 views

Incompatible argument type: Required type: \Magento\Framework\Stdlib\StringUtils

I want to override below block file /var/www/html/dg/vendor/magento/module-gift-card/Block/Sales/Order/Item/Renderer.php I made this file /var/www/html/dg/app/code/Drummondgolf/Orderemail/Block/...
0
votes
0answers
61 views

Magento2.3.0 How to overrite Customer this file Magento\Customer\Controller\Account

Please if anyone know how to override this file in our theme please reply me "Magento\Customer\Controller\Account" creatPost.php file This is my Mageplaza/HelloWorld/etc/di.xml <config xmlns:...
1
vote
2answers
46 views

Declaration of overridden method should be compatible with parent class

This is my custom class: class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Search\Collection { public function _getSelectCountSql($select = null, $resetLeftJoins = true) { $...
0
votes
1answer
38 views

In magento 2 how to override stock availability in product detail page in custom module

In magento 2 how to override stock availability in product detail page in custom module app/code/Vendor/Module/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"?> <page ...
1
vote
3answers
82 views

Magento 2: How to override theme LESS styles within custom module

I am running Magento 2.3 on Ubuntu 18.04 server with Apache 2.4, MariaDB and PHP 7.2. Magento is running in developer mode. I have created a custom theme which inherits from the Magento/blank theme. ...
1
vote
1answer
20 views

Are there any restrictions on classes you can override with preference in di.xml

When overriding a class with a custom one using the di.xml, are there any restrictions on what class you can override? I have tried overriding a class of a third party module, but it does not appear ...