Skip to main content

Questions tagged [preference]

Denotes questions related to Magento 2 preferences

3 votes
0 answers
79 views

This seemingly simple override via preference just isn't happening and I'm not seeing what's wrong. I just want it to use a different version of addSourceItemInStockFilter() PS: I have verified that ...
iphigenie's user avatar
  • 1,805
0 votes
1 answer
79 views

I am trying to change the logic in my Elasticsearch engine from "and" logic to "or" logic following the advise of the second answer in this question How do I change Magento 2 ...
Jack's user avatar
  • 5
1 vote
2 answers
582 views

How do you overwrite a trait function from vendor. Things i did try in the di.xml <preference for="\Vendor\Module\Traits\Model\ChangeMe" type="\Company\Module\Traits\...
Johan's user avatar
  • 11
1 vote
2 answers
370 views

I have to add 2 new methods getter and setter in CartItemInterface but i am facing issues. Basically I have added a new column in quote item table and now I want to add this column in cart api. Please ...
Asad Ali's user avatar
0 votes
1 answer
246 views

Here is my di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <...
hkguile's user avatar
  • 2,241
0 votes
1 answer
656 views

I'm working on 2.4.5 upgrade and Magento has a bug in the core. I need to work around the bug by overriding a class. I created a plugin to override it via preference. What am I missing? /etc/di.xml &...
PaulM's user avatar
  • 37
0 votes
1 answer
254 views

Should be achieved by preference not using the plugin and observer. can anyone provide code for this ?
Mark's user avatar
  • 73
0 votes
1 answer
1k views

I am not able to override the Search.php file by using preference in magento 2.3.4. Below is the my di.xml file. Please anybody can check the below code. <config xmlns:xsi="http://www.w3.org/...
Mahendra's user avatar
  • 716

15 30 50 per page
1
2 3 4 5
7