Questions tagged [override-model]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
166 views

How to override core model in custom module for SOAP & REST API?

I want override Magento\Sales\Model\Order\ShippingAssignmentBuildermodel only for Soap & REST API. I have tried following: SOAP API: app\code\AR\Sales\etc\webapi_soap\di.xml <preference ...
1
vote
1answer
547 views

Override Order PDF Abstract Model From Custom Module

I want to override magento function model which located at app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php Mage_Sales_Model_Order_Pdf_Abstract, how to override the insertOrder function at this ...
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-...
2
votes
0answers
166 views

In Magento2 what is the place to override the quote?

In Magento2, I want to modify the Quote. I want to add some custom attributes to the items and change the order of the items. At what level should it be done, Model, Controller, Block? Please, ...
10
votes
2answers
3k views

How can i override the PriceCurrencyInterface in Magento 2?

In \magento\framework\Pricing\PriceCurrencyInterface, I want to change the constant in that php interface file from this: /** * Default precision */ const DEFAULT_PRECISION = 2; to this: /** * ...
1
vote
1answer
46 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 ...
2
votes
1answer
265 views

How to override customer resource module customer.php

I have override customer resource module in custom module. Like : Core_Mage_Model_Resource_Customer Override this module but not succeed. I have follow these steps : Here is config.xml <?xml ...
4
votes
0answers
417 views

Override core model not working

I tried to override Magento core model which located in vendor/magento/module-catalog/Model/Layer.php, but it doesn't work at all, here's my code: app/code/Vendor/Module/etc/di.xml <preference ...
0
votes
2answers
820 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
1answer
2k views

Replacing the core module search using javascript in magento-2 [duplicate]

Replacing Core module search(form.mini). Run custom module search(form.mini) using javascript. REF:[Replacing Core module javascript magento 2] I don't know what mistake I did. app\code\Custom\...
0
votes
2answers
1k views

How to override a method of abstract file of invoice pdf

I want to override a method insert Totals of this file :- app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php How can I do that? Can anyone please guide? I saw this post : Changing PDF appearance ...
1
vote
1answer
652 views

Magento2 - Get Value of New Column in Tier Price Table

I have added a new column "admin_user" column in catalog_product_entity_tier_price table. This column value needs to come when following method is executed. $p=$productRepo->get('sample'); $tier=$...
1
vote
1answer
493 views

Dependency injection not working on one the the tax collector class

I am trying to override mapItem method from "Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector" using below code. However code written in my local module's class is not invoked. VendorName\Tax\...
0
votes
1answer
276 views

Magento 2: Get product ID in override getTierPriceList from TierPrice

I'm extending \Magento\Catalog\Pricing\Price\TierPrice to return a custom list of tier prices for products. But I can't seem to figure out how to get the product id that is calling the ...
1
vote
2answers
785 views

Magento 2 product model override not working correctly

I've created a model override for Magento\Catalog\Model\Product. My override functions for getName() and getPrice() are working. But getTierPrices() and getTierPrice() in the same class are not being ...
2
votes
2answers
2k views

Magento 2 - Can't override pdf invoice class

I'm trying to customize the pdf invoice template, so I want to override the class that generate the pdf. I found that these class create the pdf: Magento\Sales\Model\Order\Pdf\Invoice.php Magento\...
5
votes
2answers
455 views

How to override class which extends Abstract Class

I want to override a class Magento\Catalog\Model\Product\Type\Simple di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
2answers
919 views

magento 2 rewrite model is not working

I am using magento 2.1.5 I want to rewrite Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector model but it is not working. my module di.xml at vendor\module\etc\frontend\di.xml code as below <...
0
votes
1answer
365 views

After clicking on add to cart Lotus Breath - One Step Checkout hanges. It keep loading for a long time

To Bypass cart and go to checkout i used these files app/etc/modules/Maddy_Cart.xml <?xml version="1.0"?> <config> <modules> <Maddy_Cart> <...
0
votes
1answer
698 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:...
2
votes
0answers
537 views

Magento2 Overriding Block and Model Working Only For Direct Called Class

It seems like Overriding Block and Model in magento2 work only if the class is directly being called. For Example i want to override model file vendor/magento/module-catalog/Model/Layer/Filter/...

1
2