Questions tagged [override-model]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Suddenly Sitemap model stopped working after 4month

I have used the preference to override the Sitemap model. Working fine for 4 months. I have also tried to find other module is overriding the same but didn't get anything. Can somebody help me to find ...
0
votes
2answers
38 views

Overriding Model Not working : Magento2

I am Using a third party Module and going to customize a model file in it. I have tried by overriding the model class but it is not showing any effect. What i am doing is, just taking one method that ...
0
votes
1answer
35 views

How to override a class in magento 2.1 [closed]

hello everyone i am using magento 2.1 in my case i want to override a model class in my custom module , but the override didn't toke correctly
0
votes
1answer
31 views

Errors during compilation: in Magento 2.3

I am overriding Magento\Sales\Model\Order\Pdf\Items\Shipment\DefaultShipment due to some custom work in pdf shipment by using preference Below is the di.xml file <?xml version="1.0"?> &...
1
vote
5answers
2k views

Magento 2 : override model file

I tried so many ways to override the following file: vendor/magento/module-catalog/Model/Product/Gallery/CreateHandler.php but this file always runs from the core file. I also added this file in the ...
1
vote
1answer
45 views

Magento2: Failed Override Magento_Tax module Class with protected method

I am trying to override class Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector I tried everything and checked the implementation is correct in di.xml The method I am trying to override is a ...
0
votes
2answers
34 views

What is the error in this Preference?

Due to PayPal Error, i am updating the following function in app/code/Magento/Paypal/Model/Api/Nvp.php, not edit the entire code just update a single function. Function Name : function ...
0
votes
2answers
166 views

Overriding \Magento\Catalog\Model\Product\Type\Price

I'm implementing product price calculation based on a formula that uses customizible options in Magento 2 (ver. 2.3.1). I added some code to _applyOptionsPrice() to "Magento/Catalog/Model/Product/Type/...
0
votes
2answers
180 views

Magento2 : Can't Override Model File

I'm trying to override Magento\Bundle\Model\Product\Type for that i have add code indi.xml <preference for="Magento\Bundle\Model\Product\Type" type="Tecksky\Catalog\Model\Product\Type" /> ...
-1
votes
2answers
177 views

How can I override Magento/Customer/Model/AccountManagement?

I need to override below from AccountManagement: public function authenticate($username, $password) { try { $customer = $this->customerRepository->get($username); } catch (...
0
votes
2answers
157 views

Add custom locale to the allowed locale list variable in Magento\Framework\Locale\Config

I need to update the allowed locale list with my custom language in magento 2.3.3. For that, I have overridden the Magento\Framework\Locale\Config class in my custom module. di.xml: <preference ...
1
vote
2answers
132 views

how to override AbstractCarrierOnline class function in Magento 2

I want to override "proccessAdditionalValidation" function of app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php file in custom module. Please help me and thanks in advance.
1
vote
0answers
19 views

How to add extra amount to individual tax total?

I have two tax rules in my online shop. Tax 1 Tax 2 The tax calculation is based on the subtotal. But now I want to add custom amount with the above tax . i.e., Tax 1 = Tax 1 + custom amount Tax 2 =...
0
votes
1answer
126 views

How to override magento2 product tierprice?

I want to override magento2 product tier price calcualtion logic for price type 'Percentage'. I would like to calculate the percentage amount in my own way. Please let me know which file I have to ...
0
votes
0answers
22 views

Create Module to display stock status on Product listing Page

I want to develop module which is able to display custom stock status on product list page when we can enable X-threshold option from admin side and that much quantity will be displayed with the ...
0
votes
2answers
90 views

Magento 2: Model Override not working

I want to modify the code of Magento\Sales\Model\Service\PaymentFailuresService.php. So I'm overriding Model file using the below code but it's not working. etc/di.xml <?xml version="1.0"?> &...
2
votes
1answer
424 views

How to Override 3rd party module requirejs-config.js film in my custom module?

The above one is the 3rd party module's require-config.js. It contains the js file inside the adminhtml/web/js. I want to override that. So I created a custom module and made changes in the require-...
0
votes
1answer
39 views

Magento 1.9.4 Third party model override doesn't work

I've been trying for days now to get a rewritten model to function. but it doesn't work, I'm puzzled because all seems to be correct. ___Here's my config file : etek/advancednewslettercoupon/etc/...
0
votes
1answer
332 views

Magento: How to override vendor/magento/module-quote/Model/Quote.php?

How to override vendor/magento/module-quote/Model/Quote.php in Magento2. Any help would be appreciated.
0
votes
1answer
250 views

Magento 2 , After the override model file give an error

I override block file Form.phpof catalog search module all work fine, but when override model file Advanced.php give an error from Form.php Error filtering template: Type Error occurred when creating ...
1
vote
2answers
194 views

Magento 2.3 Unable to override Model: Magento\Reports\Model\ResourceModel\Report\Collection

Hello I am trying to override below function in below class using di.xml. Below is my code not working: di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
2
votes
1answer
835 views

I want to override model in the Magento 2

I want to override the Magento\Catalog\Model\Layer\Category\FilterableAttributeList model file. I have created the module. This is my di.xml file. <config xmlns:xsi="http://www.w3.org/2001/...
1
vote
1answer
570 views

Magento2: How to override customer model file?

I want to override AccountManagement.php in Magento\Customer\Model\AccountManagement.php directory. My di.xml :- <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
0
votes
1answer
699 views

Magento 2, extending sales module's Model, getting error Required type: \Magento\Framework\ObjectManagerInterface

I'm trying to override \Magento\Sales\Model\AdminOrder\Create, during the compilation I'm getting below, but I'm not making any changes, simply extending it! Incompatible argument type: Required type:...
0
votes
0answers
668 views

Magento 2 - How to call parent function inside the plugin

I have created the plugin for a particular function. That function is also calling another protected function of the core file. public function afterPopulateTaxRateData( \Magento\Tax\Model\...
0
votes
1answer
429 views

How to get Gift Message data on Invoice PDF in Backend Sales Order Grid Magento 2?

I am trying to display Gift Message for individual Item on Invoice PDF Admin Backend Sales Order Grid. Below same code is working for me if you open an order from Sales Order Grid for Individual ...
0
votes
2answers
295 views

Model file not overriden in Magento 2

I am trying to override Model file in my custom module like below. Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1answer
313 views

magento 2.3 how to override protected function in custom module

I want to override protected method _prepareProduct present in vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php in my custom module. I have overridden the Model file by adding ...
0
votes
2answers
626 views

How to override validate() of module-sales-rule/Model/Rule/Condition/Address.php?

I want to override validate() function of this file vendor/magento/module-sales-rule/Model/Rule/Condition/Address.php in my custom module file app/code/Companyname/Subtotalwithdiscount/Model/Rule/...
1
vote
1answer
568 views

Magento 2: Override di.xml in custom theme

I have a module in vendor/company/module. I have created the following folder to override files. /vendor/theme/theme-frontend-default/Company_Module. I am able to override files in view folder but I ...
2
votes
1answer
45 views

Magento2: unable to override methods in Magento\Catalog\Model\ResourceModel\Product\Collection

I want to override the model class(Magento\Catalog\Model\ResourceModel\Product\Collection.php) Flow the below process to override the addUrlRewrite method but not working. di.xml <config xmlns:...
1
vote
1answer
47 views

Why are my Magento Model and Helper overrides not being run?

I'm trying to override the core Magento class Mage_Payment_Model_Info in order to solve an error. To be clear, the override I am talking about has been entirely written by me, and is extending a ...
0
votes
1answer
224 views

Override Magento\Catalog\Model\Product

I would like to add a new function to Product Model which be accessible each time I create Product. Below, my code : src/app/code/Project/Catalog/Model/Product.php : <?php namespace Project\...
1
vote
3answers
140 views

How to override default contact form Model file in Magento 2.2.5?

I want to override default contact form Model file (ie, Mail.php and mailinterface.php) in Magento 2. Struggling to override this file since the last 2days. Any help would be appreciated. /var/www/...
0
votes
1answer
73 views

How to override Quick Order model

I'm working on a Magento 2.2.3 B2B, with the Quick Order feature enabled, and I can't find a way to extend a method of the Magento\QuickOrder\Model\Cart model. So far I tried the usual: MyCompany/...
3
votes
4answers
3k views

How to override core files into app/code/Magento folder in magento2

How do I override core files in app/code/Magento folder in Magento 2? I want to change core functionality so I need to override core files in the app/code/Magento folder instead of directly changing ...
0
votes
1answer
235 views

Magento 1.9.3 - Can we override Mage_Core_Model_Session_Abstract_Varien class?

I am trying to override Mage_Core_Model_Session_Abstract_Varien class but not getting success. My config.xml file - <models> <coreoverride> <class>...
0
votes
2answers
823 views

Override cart price rule functionality

I'm trying to override salesRule module adding a new field customer_id for creating rules based on an unique customer. I've already added the new field, but now, how this module applies the rules if ...
1
vote
2answers
866 views

Magento 2 override Third party module installed with Composer

I have installed the WebShopApps module with composer hence it is installed in the Vendor folder. Now I want to override model in my custom theme. As we know we can't directly modify in vendor folder ...
0
votes
3answers
5k views

Overriding private method of Model file in Magento 2

I am overriding private method of model file of checkout module below is my di.xml file. <preference for="Magento\Checkout\Model\DefaultConfigProvider" type="Vendor\Module\Model\...
1
vote
1answer
2k views

Magento 2 Override Private method

I am working with the Magento2, as per my requirement i want to override the private function. In Magento\Checkout\Model\DefaultConfigProvider has a method "getCustomerData()" as private one, this ...
3
votes
3answers
2k views

I want to override vendor\magento\module-email\Model\AbstractTemplate.php

I want to override method setForcedArea() because I'm using Magento 2.2.4 & whenever I tried to save Content->Configration->Design Configuration->Edit I'm getting following error:- ...
2
votes
3answers
713 views

Customer model file override issue in Magento2

I am trying to override customer model file below is the code of my di.xml <preference for = "Magento\Customer\Model\AccountManagement" type = "Vendor\Module\Model\Rewrite\Customer\...
0
votes
1answer
404 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 ...
2
votes
4answers
364 views

Magento2 override Newsletter Model showing error

I want to do some modifications inside Subscriber.php model file inside Newsletter module with mentioned below 2 methods, so i have override model with my custom module with di.xml with following code:...
0
votes
1answer
124 views

Getting product object inside defaultinvoice.php file for getting custom attribute values

I will tell what i have done till now. I have made a custom module to override the Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice file and its working fine. I am able to get sku, ...
1
vote
3answers
3k views

How to override vendor module in magento 2 via code

Following is the code - override is not working app/code/Bensupply/DisplaySupplierName/etc/module.xml <?xml version="1.0"?> <!-- <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
2answers
695 views

Magento2 : Overriding Model file not working

I want to override Magento\Payment\Model\Info::setAdditionalInformation() function my code is as below <preference for="Magento\Payment\Model\Info" type="Xxx\Yyy\Model\Payment\Info" /> and ...
0
votes
0answers
174 views

How to override ProductRepository model file in Magento2?

I need to override processMediaGallery method from \vendor\magento\module-catalog\Model\ProductRepository.php I used below code in my custom module etc/di.xml. < preference for="\Magento\...
1
vote
1answer
334 views

Overriding Product model doesn't work

I need to add a new method to the Product model, those are the files I created: app/etc/modules/Overrides_All.xml <?xml version="1.0"?> <config> <modules> <...