6

Create a child theme which inherits from your main theme. Add the template you want to override to your child theme. See dev docs on Theme Inheritance. Change theme for your ar_SA store view to the child theme you created.


4

You have put your file in the wrong place. Instead of: app/design/frontend/Vendor/theme/Magento_Catalog/product/view/addto.phtml you should put the file in: app/design/frontend/Vendor/theme/Magento_Catalog/templates/product/view/addto.phtml Notice the templates in the file path.


4

To change only error message you should use translations instead of file overriding. You can add translations by creating csv file at following location app/design/frontend/{Vendorname}/{themename}/i18n/en_US.csv and change the message as you want. "You did not sign in correctly or your account is temporarily disabled.","Your custom message."


4

Based on @Arshad M comment, you can add a di.xml with: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\RequireJs\Config" type="<Vendor>\<ModuleName>\RequireJs\...


4

You can change grid.js in 2 ways: Override via requirejs-config.js : It will replace the grid.js file in whole Magento. Create a file at MyVendor/MyModule/view/adminhtml/requirejs-config.js with the following content: var config = { map: { "*": { "mage/adminhtml/grid": "MyVendor_MyModule/js/grid" } } } For a specific ...


3

Create this file in your theme at app/design/frontend/{Vendor}/{themename}/Ibnab_MegaMenu/templates/html/top-mega.phtml Copy content of top-mega.phtml file to your theme's top-mega.phtml file you have just created. Now you can make modification to this top-mega.phtml file and your changes should reflect.


3

Hey you can do it by making changes in di.xml file you need to do changes in your shipping module.You can also override core blocks and helper if you want go through this link it might help. Override Magento 2 files


3

First of all, your method should be compatible with the original method. So you should make it protected instead of public. Now the problem.. The original _getProductCollection calls initializeProductCollection from the same class. This method dispatches an event that can be used to alter the collection. $this->_eventManager->dispatch( ...


3

When you override a model, helper or controller. The parent constructor has to be used within the overridden object (as per your suggestion number 1) essentially, the hurdle you have managed to avoid is to put your dependency injection above optional parameters (parameters that can be null) now, what you seem to face is that Magento will need the generated ...


3

In order to override First create di.xml in your module Namespace/Module/etc/di.xml <type name="Magento\Catalog\Model\ResourceModel\Product\Collection"> <plugin name="product-collection-sorting" type="Namespace\Module\Plugin\Product\Collection" sortOrder="1"/> </type> Create Namespace\Module\Plugin\Product\Collection.php and pasted ...


2

In your custom module [Namespace]/[Module]/view/frontend/requirejs-config.js add this var config = { map: { '*': { 'Magento_Ui/Magento_Ui/js/view/messages.js':'[Namespace]_[Module]/js/view/messages.js' } } }; your overridden js file should be here [Namespace]_[Module]/view/frontend/web/js/view/messages.js run below ...


2

Briefly : I use override if this is a Magento Core Bug correction. I copy/paste the file in the local pool and just add a comment in top of the file to explain the bug and his correction (most of times there is a link to a stackoverflow question ...) I use rewrite if I have to add or modify a feature (and when this is not possible to do this with an event/...


2

You can achieve this using below code. di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Api\ShipmentEstimationInterface"> <plugin name="table_rate_check" type="Vendor\Module\...


2

You can remove column using componentDisabled <item name="componentDisabled" xsi:type="boolean">true</item> Example remove "Date of Birth" field in customer grid. you can remove any field as you want. You can Override the grid of the customer create your own module. Follow below steps. Follow below steps: File path: magento/app/code/Vendor/...


2

Magento\Sales\Api\Data\OrderItemInterface Is a service provider data interface which already rewritten it by Magento\Sales\Model\Order\Item, as per as Magento 2 service contact <preference for="Magento\Sales\Api\Data\OrderItemInterface" type="Magento\Sales\Model\Order\Item"/> Please take look at di.xml of Sales module, You can understand. It ...


2

Try to this way... vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml to app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml" Or open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml and add below code <referenceBlock name="sidebar....


2

If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is ...


2

How to override with XML Using layout xml <referenceBlock name="block-name"> <action method="setTemplate"> <argument name="template" xsi:type="string">MyCustom_Module::path/to/my/file.phtml </argument> </action> </referenceBlock> How to override with PLUGIN Declare your plugin either in etc/di.xml or ...


2

You can easily override these file in your theme as: app/design/frontend/{PackageName}/{ThemeName}/Amasty_Faq/layout/catalog_product_view.xml app/design/frontend/{PackageName}/{ThemeName}/Amasty_Faq/templates/pages/question_view.phtml


2

Instead of using update tag in menu.xml, what you can do is create a plugin of menu file in your custom module. So in your custom module, make following changes. [Vendor]/[Module]/etc/di.xml <type name="Magento\Backend\Model\Menu\Config"> <plugin name="custom_override_meu_action" type="[Vendor]\[Module]\Plugin\Config" /> </type> ...


2

Hey You can override helper using di.xml you need to pass preference in di.xml file like: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Helper\Product" type="FME\Test\Helper\Rewrite\Product" /> Where in ...


2

Its not recommended to use preference until you have no option left. Using preference would override the core file class which may cause issue when Magento is upgraded. It is not stopped just here. In case there are two module rewriting the same class the functionality may not work as expected due to confection. Plugin appears as the clever choice to ...


2

Try this, you can extend using preference Add di.xml in the below folder app/code/Vendor/ModuleName/etc/di.xml then add the below code to it <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\...


2

Please create a static block with the following code {{widget type="Magento\Catalog\Block\Widget\RecentlyViewed" uiComponent="widget_recently_viewed" page_size="5" show_attributes="name,image,price,learn_more" show_buttons="add_to_cart,add_to_compare,add_to_wishlist" template="product/widget/viewed/grid.phtml" type_name="Recently Viewed Products"}} Now, ...


2

Define This in module.xml <sequence> <module name="Magento_Theme"/> </sequence> Component load order


2

1.Lucent\SocialLogin\view\frontend\layout\customer_account_login.xml <?xml version="1.0"?> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <...


2

Instead of overriding the Product collection you can create a plugin on the public function of ProductCollection.php. It is a recommended way for doing any modification to core files.


2

I don't prefer to use <preference></preference> for this work. If you want some modification at any public method of any class then I suggest use Plugin instead of preference. <preference> means class override where <plugin> means method function/method override. Step 1: Create di.xml at{YourVendorNAME}/{ModuleName}/etc/di.xml....


2

The folder path is given wrong in your overide,It should be inside Web folder not templates theme/Magento_Ui/web/templates/modal/modal-popup.html


1

This has been asked before and even something I had to iron out. This link should help: Override Magento Class Community Code Pool. This is a nice tutorial that covers what to do as well: https://sherocommerce.com/how-to-override-rewrite-classes-in-magento/


Only top voted, non community-wiki answers of a minimum length are eligible