0

I tried to add product list widget to show all the products which have a special price but it gives me the following error.

Error filtering template: Notice: unserialize(): Error at offset 298 of 329 bytes in /home/..../public_html/vendor/magento/module-widget/Helper/Conditions.php on line 34

<p>{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" title="iyi" show_pager="0" products_count="10" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Combine;s:10:aggregator;s:3:all;s:5:value;s:1:1;s:9:new_child;s:0:``;]s:4:1--1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Product;s:9:attribute;s:13:special_price;s:8:operator;s:1:`&

Please suggest

My version is Magento 2.1.8

  • Could you add the code you are using to call in the widget into your question? A where have you added your code into? I'm assuming it's a CMS Page or Block, but it would be helpful to know. – circlesix Apr 15 '18 at 15:33
  • <p>{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" title="iyi" show_pager="0" products_count="10" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Combine;s:10:aggregator;s:3:all;s:5:value;s:1:1;s:9:new_child;s:0:``;]s:4:1--1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Product;s:9:attribute;s:13:special_price;s:8:operator;s:1:`& – user2641473 Apr 16 '18 at 6:04
0

Any chance you have the memory limit set to anything less than 2G in the .htaccess?

You may see something like 256M, 768M, but Magento is recommending 2G.


Update

Review error and debug logs, post applicable errors to provide more information.

Logs to check:

  1. httpd logs (apache/nginx)
  2. PHP logs - such as error.log
  3. Magento's logs: ./var/log/* and ./var/report/*

update 2

Wouldnt hurt to ensure that there are not some improper characters that cannot be parsed by the serialize. Check all quotes, spaces, line terminations, etc... for any input you have inserted. You need to be sure that if you have copied code or text from somewhere that it did not contain any unsupported ascii characters.

  • It was 1024 and I have changed it to 2048 and still give me the same message – user2641473 Apr 16 '18 at 6:03
  • Please check the following two files app.box.com/s/4xikpm3ulay5zsgo4ii542mjrh2idl4h and app.box.com/s/zt2dlok27oe1cmkajh0efp3oawnj89dy to check the error log – user2641473 Apr 17 '18 at 6:21
  • I have the following error in the error_log, Iam still have the problem and can't add product list widget[15-Apr-2018 12:18:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Magento\Widget\Helper\Conditions::serialize() in /home/comfortegypt/public_html/vendor/magento/module-widget/Helper/Conditions.php:21 Stack trace: #0 /home/comfortegypt/public_html/vendor/magento/module-widget/Model/Widget.php(306): Magento\Widget\Helper\Conditions- – user2641473 Apr 18 '18 at 11:32
  • Please, advice I have magento 2.1.8 and trying to add catalog product list widget (price greater than 100) but it gives me the following error, some conditions are working and another gives me the error below. Error filtering template: Notice: unserialize(): Error at offset 81 of 305 bytes in /.../public_html/vendor/magento/module-widget/Helper/Conditions.php on line 34 – user2641473 Apr 18 '18 at 17:04
  • Please, advice I have magento 2.1.8 and trying to add catalog product list widget (price greater than 100) but it gives me the following error, some conditions are working and another gives me the error below. – user2641473 Apr 19 '18 at 7:38
0

I know this question was asked 9 months before, but anyone still look for the properly serialize string then here it is:

^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`special_price`,`operator`:`&gt;`,`value`:`0`^]^]

The above code will list all products which has special price greater than 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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