Questions tagged [overrides]

Questions about overriding core features (class rewrites, local code pool, theme overrides). For URL rewrites, use the "url-rewrite" tag instead.

0
votes
0answers
68 views

How to override Add to cart functionality in Magento 2.2

How to override Add to cart functionality in Magento 2.2 using custom extension?
0
votes
1answer
192 views

Magento 2.2: How can I override “checkout.item.price.unit” and “checkout.item.price.row” in the cart?

My goal is to switch out the .phtml files: magento_module-wee::item/price/unit.phtml as well as magento_module-wee::item/price/row.phtml with my own custom ones and change how the prices are displayed ...
2
votes
1answer
93 views

I am trying to override core interface in Vendor\magento\sales\Api\Data\OrderItemInterface.php

My di.xml code is here, is there any alternative way to override an interface for core file. <preference for="Magento\Sales\Api\Data\OrderItemInterface" type="Vendor\Name\Api\Data\...
0
votes
2answers
101 views

I am trying to override multishipping.php file in vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

so far I've experienced some complications performing this override, I had to override also PlaceOrderDefaulr, PlaceOrderFactory and PlaceOrderInferface I've added preferences tags in ../etc/di.xml ...
0
votes
1answer
87 views

Magento 2 - Issue on override of Multishipping checkout model

With this question I want to go further and to exactly know if it's possible to override: vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php so far I've experienced some ...
3
votes
1answer
152 views

Overriding template for a specific language

I would like to override a template but only for a specific language (ar_SA) The template I want to override is: Magento_Catalog/templates/product/list.phtml I have tried putting it in the following ...
1
vote
1answer
299 views

Make “Pick up at store” function in checkout layout file

I'm about to override checkout phtml file and also make a javascript file which allows the change of shipping method when a customer choose "pick up at store". Let me show you what i am supposed to ...
1
vote
1answer
207 views

Magento 2 | Override Freeshipping.php

I want to override this file: /magento/vendor/magento/module-offline-shipping/Model/Carrier/Freeshipping.php I created a module, this is the di.xml file: <?xml version="1.0"?> <config ...
1
vote
0answers
38 views

how to overwrite the renderlayer.php in magento 2

When i try to overwrite the Renderlayer.php of module-swatches I am getting error [2018-09-24 06:48:41] report.CRITICAL: Warning: Declaration of Kygo\Swatches\Block\LayeredNavigation\RenderLayered::...
1
vote
0answers
20 views

Overwrite a class extended many times

When I have to override a method of a class that is used as extends in many modules I have to copy the class path and put it under app /local/Mage/.../Core_Class_Extended_ManyTimes.php. But there is ...
0
votes
1answer
25 views

List of files those are updated in upgrade Magento 2.2.x1 to 2.2.x2

I need to list all the files which are modified as we upgrade Magento 2.2.x1 to 2.2.x2.So that I can figure out the rewrites and the other plugins which I have made are working properly after the ...
1
vote
0answers
21 views

Magento 1.9 Can I override the registration page only for one of the stores?

I have multiple stores. I need to override the existing registration page, but only for 1 store? How can I achieve that?
5
votes
3answers
228 views

Magento 2: How to Override core file [closed]

I want to override this core file vendor/magento/module-tax/Model/Sales/Total/Quote I have already followed the standard Magento2 approaches to override core file but unable to fetch tax ...
2
votes
3answers
53 views

Magento override login template only for my brazilian shop

Can I override the login template only for my brazilian shop? The template that I want to override is located here: app/design/frontend/rwd/default/template/persistent/customer/form/login.phtml
0
votes
0answers
25 views

Prevent a model from being saved

I'm trying to prevent a model from being saved by setting Mage_Core_Model_Abstract's _dataSaveAllowed property. This is going to happen inside an overriding Abstract.php file within local pool. app/...
1
vote
1answer
272 views

Overriding model file is not working in Magento 2.2.5

I tried to override model, but it is not working. I need to override: Magento\Catalog\Model\Product\Attribute\Backend\Price to Pawan\Catalog\Model\Rewrite\Product\Attribute\Backend\Price But it ...
1
vote
0answers
155 views

override getLoadedProductCollection of \Magento\Catalog\Block\Product\ListProduct

I am overriding getLoadedProductCollection() in my block where performing some custom query public function getLoadedProductCollection() { $myCategory = $this->...
0
votes
0answers
42 views

How to override part of a function for a block

I am trying to override part or all of a function for the file located here: Magento\Customer\Block\Adminhtml\Edit\Tab\Orders.php I want to change the customer_id to main_table.customer_id in the ...
0
votes
1answer
36 views

How to Override PTHML file in magento 2

I am trying to override phtml file. for that, I have changed the path in layout for phtml and block. but my changes are not working. I have made an error in the file but nothing happens. here is my ...
2
votes
1answer
710 views

Difference between Extend a layout and Override layout

In Magento2 currently, I override XML file using below way and make required changes. app/design/frontend/Vendor/Theme/Magento_Catalog/layout/default.xml But I have seen in Magento dev docs ...
0
votes
1answer
267 views

Magento 2.2.5: Error when trying to Override Widget

I'm doing override widget to my custom module. So everything was great in the backend, until i come to the frontend and see nothing at all. I mean it works perfect in backend, but not with the ...
0
votes
1answer
178 views

Override module-fedex Carrier.php constructor

I'm going to override module-fedex constructor, here is origin at \vendor\magento\module-fedex\Model\Carrier.php public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $...
4
votes
3answers
252 views

Magento2: Override default phtml file without create custom theme?

I'm trying to override customer's login.phtml file and I am able to manage the override by creating custom theme Tracks/customtheme, also I put the .phtml file in my custom theme like this /app/design/...
1
vote
3answers
407 views

Magento 2 : How to overrride catalog_product_view.xml

I am new with Magento 2. I wan't to change the page of detailed product: hide Qty box I do that with removing the label and maken an input as hidden. my problem is that I can't arrive to know how to ...
0
votes
1answer
52 views

Magento 2 getting Error override resource model

I have facing Below error when I override resource model Fatal error: Call to undefined method Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Interceptor::getAttributeId() ...
1
vote
3answers
132 views

How to override template Magento_Sales::order/items.phtml in custom module?

I have to override Magento_Sales::order/items.phtml frontend template in custom module. I have added below code to sales_order_view.xml file of my module. <?xml version="1.0"?> <page xmlns:...
1
vote
2answers
84 views

Magento 1.9 Override Model Problem

Path File i want Override app\code\community\OtherCompany\core\Model\Api\Rest\Client.php Path my file override app\code\local\MyCompany\MyModule\Model\Api\Rest\Client.php app\etc\modules\...
0
votes
0answers
33 views

Override class not working on linux server in magento2?

I want to override Magento\ImportExport\Model\Import\Adapter class i have set in di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1answer
252 views

Magento 2 | Override CustomerData-File

I want to override this file: /var/www/magento2/vendor/magento/module-checkout/CustomerData/DefaultItem.php I guess I have to do this by a module. How do you override something like this? Thanks!...
0
votes
2answers
63 views

override Magento_Catalog in 2.2

I want to override prices in catalog module. What I did was to test on actual phtml vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml It works as intended. Now, ...
0
votes
1answer
81 views

Magento 2 | Override Magento_Downloadable

I want to override this file in my module: /var/www/magento2-dev/vendor/magento/module-downloadable/Helper/Download.php to /var/www/magento2-dev/app/code/My/Module/Helper/Download.php How can ...
0
votes
0answers
205 views

Override Sales Create New Order Page

I am trying to override the create new order page so that append comments is not selected by default. This is the file I need to overwrite, vendor/magento/module-sales/view/adminhtml/templates/...
0
votes
2answers
44 views

adding a new block with overwritten class fails

I have created a new module (to extend checkout): <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
1
vote
1answer
418 views

Magento 2 Override checkout model class

I am working with Magento2, so as per my requirement I need to override the "Magento\Checkout\Model\Cart.php" class, but the cart.php class look like as follow namespace Magento\Checkout\Model; use ...
0
votes
2answers
34 views

How to override .phtml files in Magento 2 without customising theme

I just want to override the customer account and login form for adding custom fields and external link. How do I do that using custom module please avoid creating the theme or customize the theme.
1
vote
1answer
655 views

Magento 2.2.5: Overriding Admin Controller sales/order

I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override - Created My Custom Module app/code/A2bizz/Order/registration.php <?php \Magento\...
1
vote
1answer
285 views

Magento 2 - Not able to override CouponManagement Model

I am trying to override Magento\Quote\Model\CouponManagement core vendor file. What I am trying to achieve is change the default error message when the wrong coupon code is added. My di.xml <?...
0
votes
0answers
43 views

Magento 2: How to remove code from html?

I need remove from the page checkout this: The code of this html is the next: <div class="billing-address-same-as-shipping-block field choice" data-bind="visible: canUseShippingAddress()"> ...
0
votes
1answer
200 views

Can we rewrite multiple blocks of same core extension?

Can we rewrite multiple blocks of a core extension like catalog ? like this : <blocks> <catalog> <rewrite> <class_name_here>...
1
vote
1answer
24 views

Magento2: Duplicate 2 tables in an overwritten method

I'm overwriting a method to change the configuration of the table, the problem is that this column doubles it, magento adds the column of the overwritten file and the original file, if I delete the ...
0
votes
1answer
217 views

Contact Post Controller overridden in Custom Module not working

I have override contact form post controller in custom module. It is calling from my module but i am getting error as Fatal error: Uncaught Error: Call to a member function send() private function ...
1
vote
2answers
570 views

Magento 2 theme override: changes not showing

I am new to Magento 2 and theming and I'm having trouble overriding a particular template. I am running in developer mode. I have successfully installed my theme and applied it globally in the admin, ...
0
votes
0answers
204 views

Magento 2 EE : Override Layered Navigation Template

I want to override layered navigation template in my module(layer/view.phtml). I created catalog_category_view_type_layered.xml file in Companyname/Modulename/view/frontend/layout/ ...
0
votes
0answers
264 views

Magento 2 - Override Quote Model

I tried to create a custom module to override the QuoteManagement Model (/vendor/magento/module-quote/Model/QuoteManagement.php) but when I try to place an order I have an error message with "an error ...
0
votes
3answers
174 views

Show telephone number on customer dashboard

How do i display the telephonenumber on customer dashboard? I have extended the original class to add some functions, but I can't find the right way to show customer number. I read that ...
1
vote
1answer
21 views

Extends Dashboard customer for telephone number

I'm trying to extend Magento\Customer\Block\Account\Dashboard\Info.php file. I created a module, where I have my custom block, Info.php. I want to display the telephone number of the customer after. ...
0
votes
4answers
870 views

How to override contact us post action using plugin Magento 2

I want to override contact us post action using plugin as i have custom field in my contact form. I have created di.xml file, <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
0
votes
2answers
345 views

How to override block .php file?

I got this file: module-sales/Block/Adminhtml/Order/Create/Shipping/Method/Form.php I want to override this in a custom module. How can I do that? Thanks!
1
vote
1answer
256 views

Magento 2.2 Overriding template file

I'm trying to override theme files in my custom theme based on the blank theme. I managed to override the css with a custom css file. So i know my path correct. This path is: <Vendor>/<...
1
vote
1answer
167 views

Override form.phtml in own module

I want to override following file in my custom module: module-sales/view/adminhtml/templates/order/create/shipping/method What I did so far: magento/app/code/view/adminhtml/layout/...