Questions tagged [di]
Denotes questions related to Dependency Injection in Magento 2.
203 questions
0 votes
0 answers
37 views
Creating a Custom Helper Class with Coding Best Practices ? Code Review Request
Adobe Commerce ver. 2.4.6-p2, multi-site instance Inheriting code base with numerous custom modules that are not scoped - but need to scope them as individual sites are migrated to new frontend stack ...
1 vote
0 answers
110 views
Remove Type and Arguments from di.xml
How do you remove a Type and the associated arguments from a di.xml file? Specifically, I would like to remove the "Apple Pay" button from the Shopping cart. I have found the below code, ...
0 votes
1 answer
249 views
Page Builder use Child in the di.xml
If we want to add a chiid in page builder like slider how will we inject the child using di.xml
1 vote
1 answer
341 views
Does area emulation also influence DI / plugins?
We are reading the Magento configurable configuration inside an API call: private function getSpConfig($product) { if ($product->getTypeId() != 'configurable') { return ...
0 votes
1 answer
75 views
How can I get the admin edit user url key for a specific user if I have the user_id and account info, what are the classes/methods for di?
Example: http://localhost/admin/admin/user/edit/user_id/5/key/db1082c352e51cfb817ce0335dd060cf6e953568daf2da25cca24eadb04dc884/ I want to return '...
0 votes
1 answer
1k views
Override Abstract class in Magento 2 not working
I'm using magento v2.4.3, i tried to override \Magento\Customer\Model\Address\AbstractAddress like this: app/code/Vendor/Module/etc/module.xml <?xml version="1.0" ?> <config xmlns:...
0 votes
2 answers
105 views
What is the meaning of below code (DI injection of proxy)
Can someone explain me what does this code does, when we need this. di.xml <type name="Magento\Wishlist\Helper\Data"> <arguments> <argument name="...
0 votes
0 answers
2k views
Admin Grid wont show and getting "Request validation failed for action" error in debug
I was trying to create an admin grid in the adminhtml trying to learn how they function and work and I ran into an issue following this guide: Mageplaza. I've been trying to debug where the issue is ...