Skip to content

Widgets: Allow for simpler editing of "Specific Products" field in layout updates #40778

@DanieliMi

Description

@DanieliMi

Description

Displaying a widget on a bunch of products is a pain to configure with increasing amount of products where it should be displayed. Currently the input is readonly and products can only be added through the chooser (without manipulating the underlying html). The current workflow would be:

  1. Select any of the product pages, e.g. "All Product Types"
  2. Open the chooser
  3. Search for the SKU or name
  4. Select the Product

And you will have to repeat step 3&4 for every product you want the widget displayed on. If it's 10 products that is manageable but the more products it gets, the more cumbersome it gets.

Expected behavior

There are a few possible option. The simplest would probably be something like this:

ndex: vendor/magento/module-widget/view/adminhtml/templates/instance/edit/layout.phtml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/magento/module-widget/view/adminhtml/templates/instance/edit/layout.phtml b/vendor/magento/module-widget/view/adminhtml/templates/instance/edit/layout.phtml
--- a/vendor/magento/module-widget/view/adminhtml/templates/instance/edit/layout.phtml
+++ b/vendor/magento/module-widget/view/adminhtml/templates/instance/edit/layout.phtml	(date 1712154026000)
@@ -122,7 +122,7 @@
             '<p>' +
                 '<input disabled="disabled" type="text" class="input-text entities" '+
                 'name="widget_instance[<%- data.id %>][{$escaper->escapeJs($container['name'])}][entities]" '+
-                'value="<%- data.{$escaper->escapeJs($container['name'])}_entities %>" readonly="readonly" />&nbsp;' +
+                'value="<%- data.{$escaper->escapeJs($container['name'])}_entities %>" />&nbsp;' +
                 '<a class="widget-option-chooser" href="#" '+
                 'title="{$escaper->escapeJs(__('Open Chooser'))}">' +
                     '<img src="{$escaper->escapeJs(

Removing the readonly from the input. This will let the user just paste a list of ids directly.

Another option would be to add a category filter to the chooser. Then you can at least filter by category and quickly go through (select) the products you want from that category or just select all.

Really cool would be if you could just select a category and all products of that category are chosen. This would probably be the most complex to implement.

Benefits

UX improvement.

Additional information

No response

Release note

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions