I found code hot sellers widget in cms block,

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_per_page="5" products_count="5" 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:3:sku;s:8:operator;s:2:();s:5:value;s:60:WS12, WT09, MT07, MH07, 24-MB02, 24-WB04, 241-MB08, 240-LV05;]]"}}

But i got error when replace a product have sku WS12 by WSH12.

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_per_page="5" products_count="5" 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:3:sku;s:8:operator;s:2:();s:5:value;s:60:WSH12, WT09, MT07, MH07, 24-MB02, 24-WB04, 241-MB08, 240-LV05;]]"}}

Error filtering template: Notice: unserialize(): Error at offset magento widget

I don't know how to add or replace products in widget right way.


After struggle with this issue i resolved it by my self. I wrote script create conditions_encode by using class Magento\Widget\Helper\Conditions; It has encode function.

Using encode value and replace conditions_encoded products will update.


use Magento\Framework\App\Bootstrap;
use Magento\Widget\Helper\Conditions;
require __DIR__ . '/app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$cons= array(
        'value'=>'crowe-sweater,Easy Full Dress,Herve Leger,Striped Maxi Dress,Daisy Lace Trim Blouse',
$a=new Conditions();
echo "<pre>";
echo "</pre>";exit;

1 Answer 1


I have check this issue. You have to added new widget for update products and remove old one, else you need to check that condition that added when widget was created and need to follow this condition. There is no any way to edit that catalog list widget which is added in static block directly.

  • I've just updated right way to do it. Thanks
    – long thanh
    Commented Sep 20, 2016 at 3:22

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.