Posted on

How do I retrieve data from Conditions

I have a problem. I created a widget where inside <parameters> I have a field with conditions.

<parameter name=”products” xsi:type=”conditions” visible=”true” required=”true” sort_order=”1″
class=”MagentoCatalogWidgetBlockProductWidgetConditions”>
<label translate=”true”>Products</label>
</parameter>

I also have other fields in there and I pull them out using $block->getData(‘name of data’);. And this is where the problem arises. In this conditions I set if is one of and I want to pull it in phtml using $block->getData(‘products’) then I get this error main.CRITICAL: Notice: Trying to access array offset on value of type null.

I expected to get an array with values indicated inside this conditions e.g. there are 6 products selected by SKU. And I wanted to get an array of these SKUs. How to do it? Help please.

Leave a Reply

Your email address will not be published.