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

Override Wishlist view.phtml from custom module not working

I tried to override wishlist view.phtml which loaded at customer account page like this: app/code/Test/Salesman/view/frontend/layout/wishlist_index_index.xml <?xml version="1.0"?> <page ...
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
1answer
23 views

Magento 2.3 : How to extends Magento\Framework\Mail\Message.php?

How to extend Magento\Framework\Mail\Message.php with constructor using preference method? Tried the usual way but $charset causing an error. Any help would be appreciated
1
vote
2answers
971 views

Magento 2 How to add new method in override block

For example, I have override class Magento\Store\Block\Switcher to Vendor\Module\Block\Switcher So I need to add custom method, constructor, and protected variable in upgraded class Vendor\Module\...
3
votes
1answer
691 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 ...
0
votes
0answers
16 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
23 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
26 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
50 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
30 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
2answers
601 views

[Solved]Cannot override Pdf/Total/Default.php model

Good morning everybody! I have a problem trying to override the model app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php with app/code/local/Mycompany/Sales/Model/Order/Pdf/Total/Default.php. ...
2
votes
0answers
19 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
3answers
799 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="...
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
3answers
35 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 ...
0
votes
0answers
47 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
1answer
677 views

Extend or override blanks theme js

I have a custom theme which inherits from blank and I would like to override navigation-menu.js options how would I do that?
0
votes
0answers
17 views

Topmenu override declaration error Magento 2.3

Topmenu override declaration getting error in Magento 2.3
1
vote
0answers
23 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
14
votes
3answers
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 should use plugins instead, but plugins only allow me to modified ...
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 ...
0
votes
0answers
24 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
3answers
693 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> ...
3
votes
1answer
786 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 ...
1
vote
1answer
719 views

Magento 2: Override contact us email template using extension

I followed below answer but could not override default contact us email template. Magento 2: How to change Contact Us Email Type? I developed extension to override form.phtml to add new contact us ...
1
vote
1answer
28 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
38 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 ...
0
votes
1answer
689 views

Rewriting app/code/core/Mage/Adminhtml/contollers/Catalog/ProductController.php

I am trying to rewrite app/code/core/Mage/Adminhtml/contollers/Catalog/ProductController.php. In my config.xml I have the following: <?xml version="1.0"?> <config> <modules> ...
0
votes
1answer
859 views

Make Adjustments To final_price Render Class On Product Pages Magento2

I am trying to change the render class for the final_price renderer on the product pages in Magento2. I have found the following block inside the vendor/magento/module-catalog/view/base/layout/...
1
vote
4answers
37 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 ...
2
votes
1answer
51 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
1answer
14 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 ...
0
votes
1answer
32 views

Override function from grouped.php

I am changing the table for a grouped product. I have overridden the grouped.phtml file to make changes. But I need to override the function: getAssociatedProducts($product) // Grouped.php Because ...
4
votes
3answers
3k 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="...
0
votes
2answers
750 views

Overriding Magento Sitemap Model Class

I try to override Mage_Sitemap_Model_Resource_Catalog_Product class. Here is my files: File \magento\app\etc\modules\Own_Sitemap.xml <?xml version="1.0" encoding="UTF-8"?> <config&...
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" /> ...
2
votes
1answer
812 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 ...
11
votes
1answer
388 views

How to override a static method in Magento2

Plugin Interceptors and overriding with preference does not work on static methods. Need to override getOptionArray method in Magento\Catalog\Model\Product\Visibility to return a custom visibility ...
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
3answers
45 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($...
0
votes
0answers
11 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 ...
2
votes
2answers
834 views

Custom Contact Form - Override Controller

I am trying to add a contacts form on multiple cms/products pages. I copied the default contacts form phtml and pasted it into a new phtml file. However, submitting the form redirects to the contacts ...
2
votes
1answer
63 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 ...
7
votes
1answer
97 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&...
0
votes
3answers
1k views

Magento 2, minicart, change “Go to Checkout” text to “Checkout” only

I have been trying to change Go to Checkout text to Checkout in mini cart in Magento 2. I have new theme applied and placed override file as follows: app/design/frontend/Darkmage/newtheme/...
3
votes
1answer
29 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 ...
1
vote
1answer
27 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/...
3
votes
2answers
940 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\...
1
vote
0answers
26 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/...