cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

Hello since the update to magento 2.4 I have a problem on a module following the passage of Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection in virtualtype.

My plugin does not work.
In my di.xml I have this line

<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>
 

And suddenly with the error: "Class "Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection\Interceptor" does not exist"

In the page admin/sales/order/index/

How to sol it Please ?
8 REPLIES 8

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

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

Ankit Jasani

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

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

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

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

Ankit Jasani

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

Smiley Sad sorry not working

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

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 
 

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

I can share with you the experience of using https://processmix.com/solutions/build-api/ with low code, which provides a user interface for setting up business rules and predictive models, powerful calculation capabilities and advanced functions for testing various elements of a credit decision model. It is easy to use and has an intuitive interface; it allows you to create an entire model without any technical knowledge or training!

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection

Hi! After the update, have you tried running the "bin/magento setup:upgrade" command? This command updates the module dependencies and may solve the problem. Another thing you can try is to check if the class "Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection\Interceptor" exists in your code. Also contact Magento support and maintenance. I hope that helps!

Re: Problem with type Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection


@quatrys81100 wrote:
Hello since the update to magento 2.4 I have a problem on a module following the passage of Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection in graffiti shop website.

My plugin does not work.
In my di.xml I have this line

<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>
 

And suddenly with the error: "Class "Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection\Interceptor" does not exist"

In the page admin/sales/order/index/

How to sol it Please ?

Is your issue resolved? As i try many method including codes of differnet authors paste but all in vain. Don't know is it due to cache issue or something bug like comes up in Magento.