<type name="Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection"> <plugin name="adfab_gdpr_resource_order_invoice_grid_collection" type="Adfab\Gdpr\Model\ResourceModel\CollectionPlugin" /> </type>
Hi @quatrys81100 ,
Please replace your below code:
From:
<type name="Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection"> <plugin name="adfab_gdpr_resource_order_invoice_grid_collection" type="Adfab\Gdpr\Model\ResourceModel\CollectionPlugin" /> </type>
To:
<type name="Magento\Sales\Model\ResourceModel\Order\Invoice\Orders\Grid\Collection"> <plugin name="adfab_gdpr_resource_order_invoice_grid_collection" type="Adfab\Gdpr\Model\ResourceModel\CollectionPlugin" /> </type>
Problem Solved? Accept as solution!
Hope it helps!
Thanks
Hello Thanks
I have already tried this but already working in order page on invoice tab.
This Not working in /sales/invoice/index page on magento 2.4.5
Hi @quatrys81100 ,
Please try below.
<type name="Magento\Sales\Model\ResourceModel\Order\Invoice\Collection"> <plugin name="adfab_gdpr_resource_order_invoice_grid_collection" type="Adfab\Gdpr\Model\ResourceModel\CollectionPlugin" /> </type>
Problem Solved? Accept as solution.
Hope it helps!
Thanks
sorry not working
Hello In Magento 2.4.5 this collection is loaded like this :
<virtualType name="Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult"> <arguments> <argument name="mainTable" xsi:type="string">sales_invoice_grid</argument> <argument name="resourceModel" xsi:type="string">Magento\Sales\Model\ResourceModel\Order\Invoice</argument> </arguments> </virtualType>
How can we modify a collection? in the module that I want to modify which no longer works
the class CollectionPlugin has a function :public function afterLoad( SourceProviderInterface $collection, $result ) { if ( $this->cipher->getIsIndexing() || $this->isRunning ) { return $result; } $this->isRunning = true; foreach( $collection->getItems() as $item ) { $this->decipher($item); } $this->isRunning = false; return $result; }
How to make this work in magento 2.4.5 for invoices page. Thanks