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
2 answers
20 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-...
user avatar
0 votes
1 answer
23 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\...
user avatar
0 votes
1 answer
23 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 ...
user avatar
0 votes
2 answers
30 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/...
user avatar
0 votes
1 answer
30 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.
user avatar
0 votes
1 answer
34 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/...
user avatar
  • 696
0 votes
0 answers
12 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 ...
user avatar
  • 1
0 votes
0 answers
145 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....
user avatar
  • 33
0 votes
0 answers
17 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 ...
user avatar
  • 1
0 votes
1 answer
56 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:...
user avatar
  • 68
0 votes
1 answer
24 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=&...
user avatar
  • 135
0 votes
4 answers
44 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/...
user avatar
  • 2,429
0 votes
0 answers
42 views

Failed to override getProductCollection() from Magento\Catalog\Model\Layer.php

I tried to override the Magento\Catalog\Model\Layer.php to rewrite getProductCollection() method but it didn't work for me. I have tried multiple things and end up writing here as I had no clue what ...
user avatar
0 votes
2 answers
60 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: <...
user avatar
  • 2,403
0 votes
0 answers
20 views

Override js method outside of returned object

I'm trying to override a js function initSidebar() in vendor/magento/module-checkout/view/frontend/web/js/view/minicart.js I've been trying to use a mixin to do this but because this function is ...
user avatar
  • 1,180
0 votes
1 answer
30 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 ...
user avatar
0 votes
1 answer
26 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-...
user avatar
  • 772
0 votes
0 answers
18 views

Overriding function or replacing interface (core)

Magento beginner here. Currently, I am trying to send multiple options for a product attribute via REST API. Since Magento isn't capable of doing this I am trying to override the add function in ...
user avatar
0 votes
1 answer
97 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/...
user avatar
0 votes
2 answers
55 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 ...
user avatar
  • 3,446
0 votes
0 answers
21 views

How to override API Interfaces of 3rd Party Modules

I want to override the Interface of a 3rd party Module ` app/code/Vendor/Module/Api/Data/ExampleInterface.php ` in some my custom module to add new methods. I have followed a guide but that didn't ...
user avatar
0 votes
1 answer
58 views

Magento2 : How to override /vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php

Does anyone know how to override this file?
user avatar
0 votes
1 answer
15 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 ...
user avatar
0 votes
1 answer
46 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() ...
user avatar
0 votes
0 answers
14 views

In Magento1.9 is there a way to override existing overseas customers from selecting shipping address same as billing at one page checkout?

Our client has a multisite which contains 5 individual sites selling different products. The client is based in Scotland and for years has been shipping worldwide. However, after Brexit, our client ...
user avatar
0 votes
1 answer
133 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. */ -->...
user avatar
1 vote
1 answer
38 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 ...
user avatar
0 votes
2 answers
102 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 ...
user avatar
  • 2,403
2 votes
1 answer
66 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::...
user avatar
  • 230
0 votes
0 answers
41 views

Overriding Coupon Code REST API

I would like to send an extra Header argument in the PUT V1/carts/:cartId/coupons/:couponId that is utilized by the REST API (that handles that PUT request). To do this, I would like to override that ...
user avatar
0 votes
0 answers
25 views

Function is slower when it overrides another function

I experienced the following issue and I'm wondering if anyone out there did experienced something similar: when a function that overrides another function is called, its execution is slower than when ...
user avatar
  • 146
0 votes
1 answer
34 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 ...
user avatar
0 votes
0 answers
86 views

How can Magento 2 Vendor Model file override with custom module file

Magento 2 default paypal order after IPN completed turn to order status "Processing". This is the default order status I need to change paypal order IPN completed after order status "...
user avatar
0 votes
1 answer
510 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, ...
user avatar
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> <...
user avatar
3 votes
0 answers
127 views

is mixin for library file's method possible?

I was solving one of the issues from the other stack exchange question. The fotorama library file which is located in lib/web/fotorama/fotorama.js has one method navUpdate(){...} at 2765 line. I want ...
user avatar
0 votes
3 answers
154 views

Magento 2.4 : How to override \Magento\Sales\Model\Reorder\Reorderp model?

Model\Reorder\Data\ReorderOutput must be compatible with Magento\Sales\Model\Reorder\Reorder::execute(string $orderNumber, string $storeId): Magento\Sales\Model\Reorder\Data\ReorderOutput I am ...
user avatar
0 votes
3 answers
128 views

Is it possible to override methods with arguments using preference?

I want to disable verification email sending from certain route. At first, I thought that I would create a plugin which would change the customer email to the dummy one before actually sending the ...
user avatar
  • 11
1 vote
1 answer
308 views

Overriding GetDirectoryTree.php - preference not working

Having issues overriding Magento\MediaGalleryUi\Model\Directories\GetDirectoryTree.php. It is related to a current Media Gallery bug that causes Folders not to display (https://github.com/magento/...
user avatar
0 votes
1 answer
95 views

How to override _getHtml() function form topmenu.php file in Magento 2

I want to override _getHtml() function from topmenu.php file using block. So Please help me THANKS.
user avatar
  • 3,187
1 vote
0 answers
278 views

How do I add a new JS function via mixin to the Magento checkout payment page's shipping information section?

I am trying to add a mixin in Magento 2 for the checkout/payment page shipping info section. There is an existing section in vendor/magento/module-checkout/view/frontend/web/template/shipping-...
user avatar
0 votes
0 answers
22 views

Success screen stuck in luma theme Magento 2.3.5 Community Edition

everything good? I'm trying a problem that I've never caught in these 2 years of magento, I would like to know if you've been through this for tips on how to get out. On the success screen, the layout ...
user avatar
0 votes
1 answer
174 views

How to override .phtml files in Magento 2.4

I want to customize the Invoice page, so I override .phtml file in: vendor\magento\module-sales\view\adminhtml\templates\order\invoice\create\items.phtml I tried to create many files but failed: ...
user avatar
0 votes
1 answer
122 views

Magento 2 How to add missing products in Order Invoice

Here am having some orders of bundle products, after generating Invoice am getting only 3 products getting displaying, I need to add the missing products programmatically in the invoice PDF. here is ...
user avatar
0 votes
1 answer
76 views

Magento adding .html in the middle of url after last category

I migrated all my products and categories (thousands) over from M1 to M2 and persevered all the URL writes. I have now found that if we modify a category in M2 it is adding a .html to the end of the ...
user avatar
  • 53
0 votes
1 answer
86 views

Magento 2.4.2: Overriding Carrier.php of Magento Fedex module doesn't work

I got to override Magento FedEx Carrier.php in Magento-fedex module which is seen in the screenshot below. The structure of the overriden Fedex module under app/code in the project is as below. All ...
user avatar
0 votes
3 answers
82 views

How to override stripe module?

I'm trying to override this template: vendor/stripe/module-payments/view/frontend/web/template/payment/form.html with app/design/frontend/Vendor/Theme/Magento_Checkout/web/template/payment/form.html ...
user avatar
  • 1
0 votes
1 answer
22 views

How to initialize javascript when the user scrolls?

I need the javascript to load after the user scrolls. Right now I have a .phtml file that just has this, <div id="razoyo-gtm-user-code" style="display:none;" data-mage-init='{ &...
user avatar
0 votes
1 answer
153 views

Override sales_order_grid.xml to remove print options from mass action drop down in sales orders

Hello everyone, I'm trying to override the file sales_order_grid.xml to remove some print options from the mass action drop down in sales orders. I'm using Magento 2.4.2. The original file is located ...
user avatar
  • 320
0 votes
2 answers
231 views

Magento 2 - preference override not working for method sendConfirmationRequestEmail of module-newsletter

I try to override the method sendConfirmationRequestEmail from the module-newsletter Module in vendor\magento\module-newsletter\Model\Subscriber.php. Attempt: app\code\Company\Newsletter2Go\etc\di.xml ...
user avatar
  • 2,403

1
2 3 4 5
26