سؤال

How can I choose multiple products by SKU in a widget?

هل كانت مفيدة؟

المحلول

The best way would be to use the Conditions class that is used for the Catalog Product List widget. Code can be found in vendor/magento/module-catalog-widget/etc/widget.xml but the main bit you need is:

<parameter name="condition" xsi:type="conditions" visible="true" required="true" sort_order="10"
           class="Magento\CatalogWidget\Block\Product\Widget\Conditions">
    <label translate="true">Conditions</label>
</parameter>

You could then choose something like I've done in the image below and would have the flexibility to filter by other attributes if you wanted to.

Choose multiple SKUs

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top