Questions tagged [overrides]
Questions about overriding core features (class rewrites, local code pool, theme overrides). For URL rewrites, use the "url-rewrite" tag instead.
1,311
questions
0
votes
0
answers
10
views
Error: Cannot instantiate interface
I am override the file sender.php this is not a normal class is abstract class may be that's the reason to display the error Could anyone suggest regarding this so i can proceed forward.
error
0
votes
1
answer
22
views
How to send the separate orderconfirmation mail for admin and customer
I created a custom module to send the separate mail for admin and customer but its not working.could you please suggest me regarding this so i can proceed forward.
0
votes
2
answers
32
views
Override Model File Magento 2
I want to override Magento\PageBuilder\Model\Catalog\Sorting\SimpleOption.php file. Please check the code below,
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
2
answers
20
views
Override Magento Module
I am trying to override authorization.phtml located in vendor/magento/module-customer/view/frontend/templates/account/link .
this file contains word "or" that appear between sign in or ...
0
votes
0
answers
10
views
Magento 2 How to write plugin for getImageHtmlDeclaration function
This is the original path - vendor/magento/module-cms/Helper/Wysiwyg/Images.php
I want to put a plugin for this function getImageHtmlDeclaration()
I want to pass different HTML tag
if (!$renderAsTag) {...
0
votes
1
answer
26
views
How to override view/base file in magento 2 like as we can override frontend file in design folder
I want to override view/base
If we override view/frontend folder then we follow this pattern
app/design/frontend/
here we create registration.php file
theme.xml
and ...
0
votes
1
answer
11
views
Magento 2 - Change value in .less file of a third party module
I need to change a value in this file of a 3rd party module from my own theme:
vendor/amasty/xsearch/view/frontend/web/css/source/module/components/_search-input.less
Am I correct that I need to make ...
0
votes
0
answers
10
views
How to override file dialog (files.phtml) from adminhtml?
Magento 2.4
I want to override /vendor/magento/module-cms/view/adminhtml/templates/browser/content/files.phtml but found no suitable way to do it. So, how can I override this adminhtml template? Do I ...
1
vote
2
answers
77
views
Magento 2 how to overwrite a trait function
How do you overwrite a trait function from vendor.
Things i did try in the di.xml
<preference for="\Vendor\Module\Traits\Model\ChangeMe"
type="\Company\Module\Traits\...
0
votes
1
answer
55
views
How can we associate a single template with multiple view models? - Magento 2
I want to associate another custom view model with a template. The template already has a view model in the core file. Can I associate an other custom view model with this template?
0
votes
1
answer
144
views
What is the best way to override constructor of a class - Magento 2.4.3
I want to make a single line change in the constructor of a core class. What would be the best recommended practice to achieve it.
Here is what my existing constructor
/**
* Download constructor.
...
0
votes
0
answers
82
views
How to override .html and .js files in app/design from my custom module in app/code
Is there any way to override .html and js files present in app/design folder from a custom module in app/code ?
I was looking to override app/design/frontend/Vendor/ThemeName/Magento_Checkout/web/...
2
votes
4
answers
454
views
Override a Vendor's module di.xml : add an argument
I have in some Vendor's Module di.xml file this entry :
<type name="Amasty\RequestQuote\Model\Pdf\PdfInformation">
<arguments>
<argument name="variables" ...
1
vote
1
answer
199
views
How to override core codes - Magento 2.4.3
I have this issue with my Magento 2.4.3, which does not sort by position.
I found this code where I need to override, but I am quite new to Magento. Is there anyone that can show me or tell me how to ...
0
votes
0
answers
18
views
Add custom method in ProductCustomOptionValuesInterface
Is any way to add custom methods in \Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface.php and \Magento\Catalog\Model\Product\Option\Value.php in default setExtensionAttributes does not ...
0
votes
2
answers
296
views
Magento 2 - override JS from third party module from own module
I successfully overrode a JS file of a third party module from my own module named Amasty/AdvancedReviewOverrides.
First I copied the file from vendor/amasty/advanced-review/view/frontend/web/js/...
0
votes
3
answers
47
views
How to override taxvat.phtml
Hi dears I want to override taxvat.phtml in vendor > magento > module-customer > view > frontend > templates > widget
Before I try to create a file Vendor > Module > etc > ...
1
vote
1
answer
37
views
overwrite 2 templates file by custom module, still loading the core files
I am using Magento 2.4.3p-1
I have 2 files
vendor/Aw/Review/view/frontend/templates/email/review/request_form.phtml
vendor/Aw/Review/view/frontend/email/review_reminder.html
Since those 2 files in ...
0
votes
1
answer
48
views
Override CatalogWidget\Block\Product\ProductsList with new dependence injection
Here is my di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<...
0
votes
1
answer
23
views
Where is the line responsible for jpeg compression level for the product page?
I'm looking to turn off compression for product pages specifically, meaning if I uploaded a 200k jpeg file, I expect to see exactly the same 200k file on a product page.
Looking to find a line that ...
0
votes
1
answer
341
views
how to override module-page-builder/view/frontend/layouts.xml
i want to override module-page-builder/view/frontend/layouts.xml. please help me. i am not able to override.
Thanks
0
votes
1
answer
154
views
Magento 2: How to override the core interface and add a new constant?
I need to extend the core interface Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface and need to add a new constant but when I override the interface via preference its not working. When I ...
0
votes
1
answer
136
views
How to override Validation.xml from module-customer
I want to override vendor/magento/module-customer/etc/validation.xml
This validation.xml in custom module.
Baically I want to change below file location with my custom module file
<rule name="...
0
votes
2
answers
153
views
Magento 2: how to specify the module name in custom theme?
I need to override success.phtml file from module vendor/magento/module-inventory-in-store-pickup-frontend/view/frontend/templates/success.phtml
I'm not sure how to get the module name from module-...
0
votes
1
answer
55
views
Overriding a .phtml file in custom theme doesn't work
I've been trying to override D:\Projects\PMM-M2\public_html\vendor\magento\module-checkout\view\frontend\templates\success.phtml by placing the file in my custom theme at location D:\Projects\PMM-M2\...
0
votes
1
answer
163
views
How to override a phtml file in vendor folder
I am trying to override a file located in
/html/vendor/mirasvit/module-search-ultimate/src/Search/view/frontend/templates/index/magefan/blog/post.phtml
I have created a path under my custom theme ...
0
votes
2
answers
276
views
Overriding catalog_product_view.xml does not work
I am trying to override app/code/Mageants/SampleProduct/view/frontend/layout/catalog_product_view.xml in my theme. I copied it to app/design/frontend/Smartwave/porto_child/Mageants_SampleProduct/...
0
votes
1
answer
353
views
How do I extend/override \Magento\Theme\Block\Html\Topmenu::_getMenuItemClasses?
I cannot find it di.xml. Any ideas?
I want to add a custom css class to specific TopMenu items. I don't know how to extend this.
0
votes
1
answer
482
views
How to override the Search.php using preference in magento 2?
I am not able to override the Search.php file by using preference in magento 2.3.4.
Below is the my di.xml file. Please anybody can check the below code.
<config xmlns:xsi="http://www.w3.org/...
0
votes
0
answers
41
views
Magento 2.4 Redirects - Bulk Import using XML?
I have almost 800 links coming up in Google 404 that I need to add redirects for. I see how to add them manually one at a time but I do not see the functionality for a bulk import unless I am missing ...
5
votes
2
answers
918
views
Magento 2.4.3 - JS mixin file not loading on each page load
I tried to overwrite Magento_Catalog/js/catalog-add-to-cart.js only to extend the submitForm method as follows:
app/code/Vendor/Module/view/frontend/requirejs-config.js
/**
* Copyright © Onectus, Inc....
0
votes
0
answers
24
views
Multiselect options are overrided after load
I modified the below file
magento2\vendor\magento\module-catalog\Block\Product\View\Options\Type\Select\Multiple.php
In order to add custom value to the text of the options in the multi-select.
The ...
0
votes
1
answer
466
views
Override Abstract class in Magento 2 not working
I'm using magento v2.4.3, i tried to override \Magento\Customer\Model\Address\AbstractAddress like this:
app/code/Vendor/Module/etc/module.xml
<?xml version="1.0" ?>
<config xmlns:...
0
votes
1
answer
39
views
Override vendor file issue in magento2
I am trying to override the below class file in my custom module.
Magento\Deploy\Service\DeployStaticContent.php
Vendor/Module/etc/di.xml
<?xml version="1.0" ?>
<config xmlns:xsi=&...
0
votes
4
answers
164
views
How to overide a html template
I want to override
vendor/magento/module-tax/view/frontend/web/template/checkout/shipping_method/price.html
So I have copied the file to my custom theme to:
app/design/frontend/Company/Theme/...
0
votes
2
answers
152
views
Magento 2 - How to disable a plugin
Problem:
I am using the extension Fooman_PdfCustomiser.
I need to disable the plugin named fooman_pdfcustomiser_paymentinfoblock.
vendor/fooman/pdfcustomiser-implementation-m2/src/etc/di.xml:
<...
1
vote
1
answer
172
views
Override product description
I need to add some things to the Magento 2 description. I can't do it via admin area since the data needs to be generated procedurally, so I tried an override, but the closest I've got is this
I need ...
0
votes
1
answer
143
views
Override native js file
Simple issue : What should I do in order to override a native js file.
In that specific case : src/vendor/magento/module-inventory-configurable-product-frontend-ui/view/frontend/web/js/configurable-...
0
votes
1
answer
532
views
Magento 2 How to Override Cart/Item/default.phtml file in my Custom module
I create Default.phtml file in Vdcstore/QuantityDropdown/View/frontend/templates/cart/item/default.phtml
Hello
I Create checkout_cart_item_renderers.xml file in Vdcstore/QuantityDropdown/View/frontend/...
0
votes
2
answers
138
views
Magento2 Override getOrderOptions() in plugin
Magento2 override this function getOrderOptions() which is in the file
vendor/magento/module-catalog/Model/Product/Type/AbstractType.php
This is a abstract class. Please guide
public function ...
0
votes
1
answer
208
views
Magento2 : How to override /vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
Does anyone know how to override this file?
0
votes
1
answer
18
views
Can't override magento contact
I seem to be missing something when it comes to overriding controllers. This is a somewhat recurring question in here, but nothing I've found in other questions worked for me, so either they might be ...
0
votes
1
answer
113
views
How to override core plugin method?
I would like to override core plugin method
Core plugin path
Magento\InventorySales\Plugin\StockState\CheckQuoteItemQtyPlugin.php
In this file I would like to override aroundCheckQuoteItemQty() ...
0
votes
1
answer
373
views
Magento 2: Problem overriding product/view/form.phtml in custom module
I tried using this in my catalog_product_view.xml:
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->...
1
vote
1
answer
147
views
How to know which file to make changes in Magento 2
I am new in Magento 2 and I m having very difficulty in finding which templates or blocks to make changes. I know how to override files. I had previously made changes in the theme but still, I can't ...
0
votes
2
answers
323
views
Magento 2 - Can't override class - must be an instance of
I created a preference override for Magento\Quote\Model\Quote\Item\CartItemPersister in my own module. But I get this error in the browser developer console:
Total: Type Error occurred when creating ...
2
votes
1
answer
101
views
Override method magento 2
I am using magento 2.4.3 EE version
Is their any way to override below method
protected function _calculate($rule, $item, $qty, $rulePercent)
for below classes
\Magento\SalesRule\Model\Rule::...
0
votes
1
answer
180
views
How to override a method of a class where the method itself is defined in its parent class, and only called in the current class?
I would like to extend the OrderSender class, located at Magento\Sales\Model\Order\Email\Sender\ and then override the method prepareTemplate($order), this method is actually defined in the Sender ...
0
votes
1
answer
2k
views
How to override a method in Magento 2
I would like to override a method of a class, but it does not work. The changes added to the method are not used.
File \Magento\Sales\Model\Order\Email\Sender.php
<?php
/**
* Copyright © Magento, ...
0
votes
1
answer
24
views
Magento 1: Can't override Enterprise/GiftCardAccount/controllers/Adminhtml/GiftcardaccountController.php
I can't override the controller inside of the Enterprise/GiftCardAccount/controllers/Adminhtml/ folder
<config>
...
<admin>
<routers>
<adminhtml>
<...