0

I have a Magento ver. 2.4.3-p1.

When I try to insert the "catalog product list" widget on a CMS page with the below code:

<p>{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" show_pager="0" products_count="1" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`==`,`value`:``^]^]"}}</p>

It gives me this error:

"Error filtering template: Invalid block type: Magento \ CatalogWidget \ Block \ Product \ ProductsList"

I'm going crazy I don't understand the reason for the mistake.

Thanks for your help.

3 Answers 3

0

I've tested that feature on your site. Adding Catalog New Product List works fine, but Catalog Product List has the error.

I Can see that you have installed at least 3 3rd-party modules: Mageplaza SMTP, Product Inquiry, and Amage Cms (Import/Export CMS). So, let's try to disable all of these modules to check if Catalog Product List Wiget works or not.

Run the following commands to disable 3 3rd-party modules:

bin/magento module:disable Mageplaza_Smtp Sparsh_ProductInquiry Amage_Cms
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Then go to the frontend to test the result.

Case 1: If after disabling 3 modules above the issue still persists, enable these modules again and continue debugging.

Run the following commands to enable 3 3rd-party modules:

bin/magento module:disable Mageplaza_Smtp Sparsh_ProductInquiry Amage_Cms
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Case 2: If after disabling 3 modules above the issue is resolved, enable each module one by one to test.

2.1: Run the following commands to enable Mageplaza_Smtp module:

bin/magento module:enable Mageplaza_Smtp
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Then test

2.2: If after enabling Mageplaza_Smtp module the issue is still resolved, that means Mageplaza_Smtp module does not cause the error. Run the following commands to enable Sparsh_ProductInquiry modules:

bin/magento module:enable Sparsh_ProductInquiry
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Then test

2.3: If after enabling Sparsh_ProductInquiry module the issue is still resolved, that means Sparsh_ProductInquiry module does not cause the error. Looks like Amage_Cms module causes the error, but still need to check for sure. Run the following commands to enable Amage_Cms modules:

bin/magento module:enable Amage_Cms
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Then test, if after enabling Amage_Cms module the issue persists. Run the following commands to disable that module:

bin/magento module:disable Amage_Cms
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
17
  • doesnt work this widget {{widget type="Magento\CatalogWidget\Block\Product\ProductsList" show_pager="0" products_count="1" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="^[1:^[type:Magento||CatalogWidget||Model||Rule||Condition||Combine,aggregator:all,value:1,new_child:^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`==`,`value`:^]^]"}}
    – enrico
    Commented Nov 7, 2022 at 14:46
  • Could you confirm you tried my code but the issue still persists?
    – Tu Van
    Commented Nov 7, 2022 at 14:56
  • i tried but persist =(
    – enrico
    Commented Nov 7, 2022 at 14:57
  • do you have any advice???
    – enrico
    Commented Nov 7, 2022 at 14:58
  • do you install any 3rd-party modules (extensions) or did you create any custom modules?
    – Tu Van
    Commented Nov 7, 2022 at 15:02
0

Did you override the widget / is it custom ? This error is given when the paths aren't right. Check if all the paths are correct

1
  • hi i am using the magento default widget. What do you mean by "paths aren't right". Can you give me an example? You can see the error here corsomagento2.com/test
    – enrico
    Commented Nov 7, 2022 at 11:32
0

I have the same issue. Is there a solution? Error disapears after deaktivating Sparsh ProductInquiry. I need the Plugin, so is there a solution?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.