Skip to content

Commit 36b8821

Browse files
manleyacmamhoff
authored andcommitted
Promotions: Set line_item_option_value product-picker multiple false
This updates the product picker for the line_item_option_value form to not allow selecting multiple products per entry.
1 parent 143f09a commit 36b8821

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

promotions/app/javascript/backend/solidus_promotions/web_components/product_picker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class ProductPicker extends HTMLInputElement {
22
connectedCallback() {
3-
$(this).productAutocomplete();
3+
const multiple = this.dataset.multiple !== "false";
4+
$(this).productAutocomplete({ multiple });
45
}
56
}
67

promotions/lib/views/backend/solidus_promotions/admin/condition_fields/line_item_option_value/_option_value_fields.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
is="product-picker"
55
class="w-100"
66
data-action="select2Change->product-option-values#propagate_product_id_to_value_input"
7+
data-multiple="false"
78
type="hidden"
89
value="<%= product_option_values[0] %>"
910
>

0 commit comments

Comments
 (0)