Questions tagged [di.xml]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
40 views

Magento 2.4.2 Adminhtml grid error

So I have a custom table and I want to create a grid in admin html to display all the records from my custom table. I created new page using page factory. I created listing.xml and di.xml as well but ...
1
vote
1answer
43 views

I can't enable my module with di.xml in magento

My 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
2answers
56 views

Magento 2 :How to override Magento\Sales\Model\Order\Email\Sender.php model?

Is their any way we can override Magento\Sales\Model\Order\Email\Sender.php model in magento 2 module ? I have created below files di.xml <?xml version="1.0"?> <config xmlns:xsi=&...
1
vote
1answer
37 views

Override Magento\Sales\Model\Order\Email\Sender\CreditmemoSender Magento 2

How to override below file in module ? Magento\Sales\Model\Order\Email\Sender\CreditmemoSender.php
0
votes
2answers
90 views

How can i upload SVG image on Magento 2.3.6?

Please help me. Now i can't upload SVG image on Magento V-2.3.6. I tried with below code but still can't. <type name="Magento\Cms\Model\Wysiwyg\Images\Storage"> <argument name=&...
1
vote
1answer
44 views

Adding a BCC and CC (sales person) to the welcome email Magento 2

I've edited this function below and i'm overriding this method in app/code/FF/Customer/Model/EmailNotification.php natively this file exists in vendor/magento/module-customer/Model/EmailNotification....
0
votes
0answers
12 views

Deactivating and reactivating plugins on-the-fly

I am currently developing on a VM with a Ubuntu host machine - it is super slow. I am currently trying to implement a plugin but the magento s:d:c command takes 6 minutes. Within examples for Plugins ...
0
votes
0answers
20 views

Override 3rd party extension plugin name in di.xml

I have two 3rd party extensions, Magedelight_Storepickup and Amasty_Deliverydate, that both have a plugin named "save-in-quote". This is causing conflict and errors. <type name="...
0
votes
1answer
348 views

Magento 2.4.1 Custom Content Security Policy (CSP) whitelist for connect-src not Working

I created a whitelist for content-src CSP like this: <policy id="connect-src"> <values> <value id="cloudflare" type="host">*....
0
votes
1answer
62 views

how to disable di.xml virtual types from vendor in custom module

I am currently experiencing an issue where a vendor module is using MSI, however we needed to disable it via composer completly ( magento 2.3.4 ) The vendor module in question is the amasty layered ...
0
votes
1answer
95 views

Magento 2 Cron Run throws PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Filesystem\DriverInterface

So when I run the php bin/magento cron:run I get error as PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Filesystem\DriverInterface This error gets disappear after ...
0
votes
1answer
53 views

how to change the order of aggreation filter in magento 2 in di.xml

Magento/Cataloggraphql/etc/graphql/di.xml <type name="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\LayerBuilder"> <arguments> <argument name="...
1
vote
1answer
82 views

Creating custom M2 grid and rendering data from a custom table issue

I tried to follow these tutorials: https://medium.com/@jhonkelly2016/how-to-create-admin-grid-in-magento-2-9f39d052322d https://www.mageplaza.com/magento-2-module-development/create-admin-grid-...
5
votes
2answers
484 views

Argument replacement not working for type object

I am trying to replace an object using Argument Replacement but unfortunately I am unable to do so for type:object. Every time I am getting error: 1 exception(s): Exception #0 (Magento\Framework\...
0
votes
1answer
198 views

Injecting additional dependencies into a class - Magento 2.3

I am trying to inject additional dependencies into a class. The class in question is: \Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo The construct of this class looks like: public ...
1
vote
1answer
154 views

How to override already override class in magento 2

Hii we need to override Magento\Catalog\Model\ResourceModel\Product\Collection class for our customisation. To do this we added <preference for="Magento\Catalog\Model\ResourceModel\Product\...
2
votes
0answers
140 views

di.xml ExtensionPool create/read handlers Conflicts

I am creating extensionpool handlers to save data in multiple tables. There are total 3 tables : 1 : Sliders 2 : SliderItems 3 : SliderSelectedItems When I create/update Slider, list of selected ...
2
votes
3answers
3k views

How to create custom route in magento2

I have used below code in di.xml <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> <item name="...
1
vote
1answer
2k views

What is the Use of Type and Virtual Types(di.xml) in Magento2?

I want to know clear about Type and Virtual Types in di.xml with examples. When we can use it. Please share simple example to understand concept. Note please go through the practical examples.
1
vote
0answers
149 views

ifconfig to disable part of an extension

I have added a Column to the New Order -> Customer Grid. I am having a really tough time getting the system config to disable this code if turned off. I was hoping I could use a simple ifconfig in the ...
0
votes
1answer
54 views

Rewriting blocks in admin

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

Magento 2 How to over write route FrontName of a module?

I'm trying to extend Magento 2 default module Magente_Contact, but I can't change the frontName, I tried to put in the di.xml, but nothing happens. <config> <router id="standart"> ...
0
votes
1answer
43 views

In Magento 2 is there any chance to broke site due to spaces in di.xml file

Is there any chance or any cause to broke the site due to spaces in di.xml file in Magento 2
1
vote
2answers
1k views

admin grid not working

listing file <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">faq_listing.faq_listing_data_source&...
4
votes
1answer
797 views

How to set ifconfig for di.xml magento 2

I want set ifconfig configuration for below code: First code in di.xml <virtualType name="searchFilterList" type="Magento\Catalog\Model\Layer\FilterList"> <arguments> <...
3
votes
2answers
3k views

Magento2: Change in di.xml

After making a change to app/etc/di.xml Am I required to take some additional steps in order for the change to take effect? Like clean cache, deploy static files or compile code?
11
votes
2answers
21k views

Magento 2 After plugin with parameter

I am trying to implement after plugin to the following method. public function getCategoryUrl($category) { if ($category instanceof ModelCategory) { return $category->getUrl(); } ...
0
votes
3answers
775 views

Overwrite pdf.xml

I want to overwrite pdf.xml in Magento 2.1.3 to change order for the total block, but i can't figure out how i can do that. The totals are ordered in pdf.xml in Magento/sales/pdf Edit: First I had ...
0
votes
1answer
283 views

Why is my Magento Catalog Block Preference ignored in di.xml?

I am trying to extend the Magento\Catalog\Block\Product\ListProduct block in Magento 2.1 My Vendor_ModuleName module has the registration.php, the etc/module.xml and it's enabled. Then I add an etc/...
10
votes
3answers
12k views

Is it possible to disable plugins defined in di.xml programatically?

Given a plugin defined in di.xml such as the following: <type name="\Magento\Catalog\Model\Product"> <plugin name="se_catalog_product_plugin_ample" type="Example\Module\Model\...
1
vote
2answers
1k views

Magento 2 : Display multiple grids in admin area

I have displayed my one custom table in a grid format. Now, I want to display one other custom table in a grid format (Under different menu). But I am little bit confused, how to add code in di.xml ...
9
votes
3answers
2k views

Correct, Supported way to Add CLI Commands to Magento 2

Is there a correct, and officially supported way, to add your CLI commands to a Magento 2 module? From what I've gathered your options are Add your command class to the commands argument of Magento\...
1
vote
1answer
452 views

What does this di.xml file have incorrect?

I am implementing a custom payment gateway. To be able to config it, I have created a ConfigProvider this way: <?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for ...
0
votes
2answers
236 views

Magento 2 For what secureUrlList at di

What purpose of using secureUrlList at Magento di.xml? It appear at few di.xml base and for frontend: Like an example: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
5
votes
1answer
620 views

Swapping Less for Sass / Removing an argument previously added to type via di.xml in Magento2

So I am investigating Ben Mark's claim that is really easy to switch out the PHP Less pre-processor for a Sass one. https://twitter.com/benmarks/status/590219053437833217 (I don't buy it) I have ...
1
vote
1answer
3k views

Magento 2 class not exist error occurs when overriding a controller

error: a:4:{i:0;s:68:"Class namespace\modulename\Controller\CustomLoginPost does not exist";i:1;s:6711:"#0 C:\xampp2\htdocs\magento2\lib\internal\Magento\Framework\Code\Reader\ClassReader.php(19): ...
0
votes
1answer
246 views

Magento2 use Plugins (di.xml)

I have created a Plugin. Registered it in di.xml All public methods execute. Can I inject/rewrite/replace (don't know the proper title) protected methods? How?
11
votes
6answers
11k views

Delete operation is forbidden for current area

I want to create command for delete operation for simple product by sku. I'm getting following error.how to set admin area? [Magento\Framework\Exception\LocalizedException] Delete operation is ...