Questions tagged [override-model]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
19 views

Override PHP-sdk file in vendor

I want to override the (PHP sdk)file which is found in the vendor path the path is vendor/tamara-solution/php-sdk/src/Tamara/Model/Order/Order.php I am attaching my that specific php sdk composer....
0
votes
1answer
18 views

How to override Model file ConvertToCsv in custom module

Here am trying to override a vendor file that is vendor/magento/module-ui/Model/Export/ConvertToCsv.php etc/di.xml file <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
0answers
18 views

Magento 2 : How to Override \Magento\NegotiableQuote\Model\CompanyQuoteConfigRepository.php

di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...
0
votes
3answers
47 views

How to override class Magento\Sales\Model\Order\Pdf\Total\DefaultTotal?

I am trying to override getFullTaxInfo() of class Magento\Sales\Model\Order\Pdf\Total\DefaultTotal using preference but this is not working. Can anyone help to do it? di.xml <?xml version="1....
0
votes
1answer
17 views

How to override OrderRepositry - save function | API

I need to add some custom functionalities in the Order save function when some API request comes. To be exact need to override the core OrderRepository class vendor/magento/module-sales/Model/...
0
votes
0answers
42 views

Magento 2.4 : override product collection filter not work in layered navigation

I am using magento 2.4 version. I wanna user custom filter in product collection so I override getProductCollection() function in \Magento\Catalog\Model\Layer.php but it filters the product but not ...
0
votes
1answer
80 views

_initSelect override with Plugin in Magento2.4.1

Need a help in this issue. I am trying to remove a MySQL condition from _initSelect from this Collection "Magento\SalesRule\Model\ResourceModel\Rule\Collection". This Collection has the ...
1
vote
1answer
72 views

Magento 2 : Prevent "payment method" based on country ID

I have override "Magento\Checkout\Model\PaymentInformationManagement" file in custom module I want to prevent some "afterpay" payment method to be displayed for some country. So i ...
0
votes
2answers
122 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 ...
0
votes
0answers
17 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
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
2answers
109 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
34 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
1answer
70 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
42 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 ...
-1
votes
2answers
555 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 (...
1
vote
2answers
190 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
20 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
242 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
2answers
130 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"?> &...
0
votes
2answers
292 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/...
2
votes
1answer
708 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
2answers
274 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 ...
0
votes
1answer
569 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
359 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
3answers
311 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-...
0
votes
1answer
45 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/...
1
vote
1answer
746 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
0answers
941 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
594 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 ...
1
vote
1answer
452 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
413 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:...
0
votes
2answers
797 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
752 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
76 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:...
0
votes
1answer
298 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
208 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
104 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/...
0
votes
1answer
261 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>...
1
vote
2answers
1k 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
8k 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\...
2
votes
3answers
832 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\...
1
vote
1answer
3k 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 ...
0
votes
1answer
479 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
419 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:...
1
vote
2answers
922 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
236 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\...
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:- ...
1
vote
1answer
365 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> <...
2
votes
1answer
1k 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/...