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
2answers
2k views

Magento 2 : Override layout.xml File Within Custom Module

Looking at the Magento 2 docs, you can override a base/core layout.xml file - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html Is it possible, to overide within ...
0
votes
2answers
421 views

Magento2 product review captcha

I want to rewrite Magento-review layout catalog_product_view.xml to show Recaptcha on a product review. How can I achieve this?
3
votes
1answer
417 views

Magento2: Tier price higher than regular price

I figured out that if you set a tier price higher than the regular price, it will show the regular price anyway. Seems this is the "normal" funcionality, always show the lower price if it's possible. ...
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/...
0
votes
3answers
2k views

Magento 2 : How to Override vendor files in my custom theme

How to override below admin file in my custom admin theme ? /vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml
3
votes
3answers
855 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="...
-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 ...
5
votes
3answers
6k views

Magento 2 : Override core Interface and Model

I am trying to override core interface of Customer Group. I add my custom get and set methods to core Api interface. Vendor\magento\customer-module\Api\Data\GroupInterface.php Where its working ...
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
1answer
678 views

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

magento\vendor\magento\module-config\Controller\Adminhtml\System\Config\Save.php how can i override this controller in the magento 2
5
votes
1answer
753 views

How can I override server-side form validation?

I want to provide additional server-side validation of the address forms in Magento, both in Checkout and Customer. I can override Mage_Checkout_OnepageController, ...
1
vote
2answers
1k views

Magento 2 How to add new method in override block

For example, I've to override class Magento\Store\Block\Switcher to Vendor\Module\Block\Switcher Now I need to add custom method, constructor, and protected variable in upgraded class Vendor\Module\...
1
vote
0answers
28 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
577 views

How to override admin template with layout, how to get reference block

I want to override below templates. I tried with placing core layout in my custom module and place template in same directory structure. Can any one please tell me where I am making mistakes. ...
0
votes
1answer
582 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\...
7
votes
6answers
4k views

How to override final_price.phtml in magento 2?

I want to override final_price.phtml, I have tried following in my module but it is not working. I have created app/code/MyVendor/MyModule/view/frontend/layout/catalog_product_prices.xml <layout ...
0
votes
1answer
49 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
25 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
1answer
600 views

Override Magento 2 Adminhtml Template File

I'm trying to override this file: /vendor/magento/module-import-export/view/adminhtml/templates/export/form/filter/after.phtml This template file has been declared in: /vendor/magento/module-...
1
vote
2answers
42 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': '...
0
votes
3answers
768 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&...
1
vote
3answers
71 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/...
2
votes
2answers
2k views

How to override a phtml file from a custom module in magento 2?

I need to override /vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml. For this, in app/code/namespace/Customtab/view/frontend/layout/catalog_product_view.xml <?...
0
votes
1answer
646 views

Rewrite customer API not working

I can't get this small extension for rewriting Mage_Customer_Model_Customer_Api to work. My files: /app/etc/modules/EnaDva_CustomerInfoApi.xml <?xml version="1.0"?> <config> <...
4
votes
1answer
698 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.
3
votes
1answer
715 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
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
2answers
606 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
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 ...
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
42 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
59 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
689 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
19 views

Topmenu override declaration error Magento 2.3

Topmenu override declaration getting error in Magento 2.3
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
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
30 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
704 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
811 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 ...