14 <fieldset
id=
"catalog_product_composite_configure_fields_bundle" 15 class=
"fieldset admin__fieldset composite-bundle<?= $block->getIsLastFieldset() ? ' last-fieldset' : '' ?>">
16 <legend
class=
"legend admin__legend"><span><?=
__(
'Bundle Items') ?></span></legend><br />
18 <?php
if (
$option->getSelections()) : ?>
26 "Magento_Catalog/catalog/product/composite/configure" 28 BundleControl = Class.create();
30 BundleControl.prototype = {
31 initialize:
function (config) {
35 changeSelection:
function (selection) {
36 if (selection.multiple) {
39 var parts = selection.id.split(
'-'), optionId = parts[2],
40 showQtyInput = selection.value && selection.value !=
'none',
41 options = this.config.options[optionId],
42 selectionOptions = options && options.selections && options.selections[selection.value] || {};
44 selectionOptions.can_change_qty = Number(selectionOptions.can_change_qty) && showQtyInput;
45 this.updateQtyInput(optionId, selectionOptions);
48 updateQtyInput:
function(optionId, selectionOptions) {
49 var elem = $(
'bundle-option-' + optionId +
'-qty-input'),
50 default_qty = Number(selectionOptions.default_qty);
54 if (selectionOptions.can_change_qty) {
55 elem.removeClassName(
'qty-disabled');
56 elem.disabled =
false;
57 elem.value = default_qty || 1;
59 elem.addClassName(
'qty-disabled');
61 elem.value = default_qty || 0;
65 updateForDefaults:
function () {
66 for (var optionId in this.config.options) {
67 var selection = $(
'bundle-option-' + optionId);
69 this.changeSelection(selection);
74 ProductConfigure.bundleControl =
new BundleControl(<?=
$block->getJsonConfig() ?>);