Magento2 How can I choose multiple products by SKU?
-
23-01-2021 - |
سؤال
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.
لا تنتمي إلى magento.stackexchange