77 $meta = $this->removeFixedTierPrice($meta);
78 $path = $this->arrayManager->findPath(static::CODE_BUNDLE_DATA, $meta,
null,
'children');
80 $meta = $this->arrayManager->merge(
91 static::GROUP_CONTENT,
102 'isTemplate' =>
false,
105 'provider' =>
'product_form.product_form_data_source',
107 'title' =>
__(
'Add Products to Option'),
110 'text' =>
__(
'Cancel'),
111 'actions' => [
'closeModal'],
114 'text' =>
__(
'Add Selected Products'),
115 'class' =>
'action-primary',
118 'targetName' =>
'index = bundle_product_listing',
119 'actionName' =>
'save' 130 'bundle_product_listing' => [
134 'autoRender' =>
false,
135 'componentType' =>
'insertListing',
136 'dataScope' =>
'bundle_product_listing',
137 'externalProvider' =>
138 'bundle_product_listing.bundle_product_listing_data_source',
139 'selectionsProvider' =>
140 'bundle_product_listing.bundle_product_listing.product_columns.ids',
141 'ns' =>
'bundle_product_listing',
142 'render_url' => $this->urlBuilder->getUrl(
'mui/index/render'),
143 'realTimeLink' =>
false,
144 'dataLinks' => [
'imports' =>
false,
'exports' =>
true],
145 'behaviourType' =>
'simple',
146 'externalFilterMode' =>
true,
153 self::CODE_AFFECT_BUNDLE_PRODUCT_SELECTIONS => [
157 'componentType' => Form\Field::NAME,
158 'dataType' => Form\Element\DataType\Text::NAME,
159 'formElement' => Form\Element\Input::NAME,
160 'dataScope' =>
'data.affect_bundle_product_selections',
174 $bundleItemsGroup = $this->arrayManager->get(
$path, $meta);
175 $meta = $this->arrayManager->remove(
$path, $meta);
176 $meta = $this->arrayManager->set(
$path, $meta, $bundleItemsGroup);
178 $meta = $this->modifyShipmentType($meta);
189 private function removeFixedTierPrice(array $meta)
191 $tierPricePath = $this->arrayManager->findPath(
197 $pricePath = $this->arrayManager->findPath(
202 $pricePath = $this->arrayManager->slicePath($pricePath, 0, -1) .
'/value_type/arguments/data/options';
204 $price = $this->arrayManager->get($pricePath, $meta);
206 $meta = $this->arrayManager->remove($pricePath, $meta);
212 $meta = $this->arrayManager->merge(
213 $this->arrayManager->slicePath($pricePath, 0, -1),
236 private function modifyShipmentType(array $meta)
238 $meta = $this->arrayManager->merge(
239 $this->arrayManager->findPath(
240 static::CODE_SHIPMENT_TYPE,
244 ) . static::META_CONFIG_PATH,
247 'dataScope' =>
'data.product.shipment_type',
249 'required-entry' =>
false 271 'template' =>
'ui/form/components/complex',
281 'title' =>
__(
'Add Option'),
284 'component' =>
'Magento_Ui/js/form/components/button',
288 'targetName' =>
'product_form.product_form.' 290 'actionName' =>
'processingAddChild',
313 'component' =>
'Magento_Bundle/js/components/bundle-dynamic-rows',
314 'template' =>
'ui/dynamic-rows/templates/collapsible',
315 'additionalClasses' =>
'admin__field-wide',
316 'dataScope' =>
'data.bundle_options',
317 'isDefaultFieldScope' =>
'is_default',
318 'bundleSelectionsName' =>
'product_bundle_container.bundle_selections',
328 'isTemplate' =>
true,
329 'is_collection' =>
true,
330 'headerLabel' =>
__(
'New Option'),
331 'component' =>
'Magento_Ui/js/dynamic-rows/record',
332 'positionProvider' =>
'product_bundle_container.position',
334 'label' =>
'${ $.name }' .
'.product_bundle_container.option_info.title:value' 340 'product_bundle_container' => [
344 'componentType' =>
'fieldset',
345 'collapsible' =>
true,
356 'bundle_selections' => [
361 'component' =>
'Magento_Bundle/js/components/bundle-dynamic-rows-grid',
363 'additionalClasses' =>
'admin__field-wide',
364 'template' =>
'ui/dynamic-rows/templates/default',
365 'provider' =>
'product_form.product_form_data_source',
366 'dataProvider' =>
'${ $.dataScope }' .
'.bundle_button_proxy',
367 'identificationDRProperty' =>
'product_id',
368 'identificationProperty' =>
'product_id',
370 'product_id' =>
'entity_id',
375 'selection_can_change_qty' =>
'',
376 'selection_id' =>
'',
377 'selection_price_type' =>
'',
378 'selection_price_value' =>
'',
379 'selection_qty' =>
'',
381 'links' => [
'insertData' =>
'${ $.provider }:${ $.dataProvider }'],
383 'inputType' =>
'${$.provider}:${$.dataScope}.type',
385 'source' =>
'product',
415 'componentType' => Form\Field::NAME,
416 'dataType' => Form\Element\DataType\Text::NAME,
417 'formElement' => Form\Element\Input::NAME,
418 'dataScope' => $columnName,
420 'additionalClasses' => [
'_hidden' =>
true],
421 'sortOrder' => $sortOrder,
440 'formElement' =>
'container',
441 'componentType' =>
'container',
442 'dataScope' =>
'bundle_button_proxy',
443 'component' =>
'Magento_Catalog/js/bundle-proxy-button',
444 'provider' =>
'product_form.product_form_data_source',
445 'listingDataProvider' =>
'bundle_product_listing',
448 'targetName' =>
'product_form.product_form.' . static::CODE_BUNDLE_DATA .
'.modal',
449 'actionName' =>
'toggleModal' 452 'targetName' =>
'product_form.product_form.' . static::CODE_BUNDLE_DATA
453 .
'.modal.bundle_product_listing',
454 'actionName' =>
'render' 457 'title' =>
__(
'Add Products to Option'),
471 $result[
'title'][
'arguments'][
'data'][
'config'] = [
472 'dataType' => Form\Element\DataType\Text::NAME,
473 'formElement' => Form\Element\Input::NAME,
474 'componentType' => Form\Field::NAME,
475 'dataScope' => $this->
isDefaultStore() ?
'title' :
'default_title',
478 'validation' => [
'required-entry' =>
true],
482 $result[
'store_title'][
'arguments'][
'data'][
'config'] = [
483 'dataType' => Form\Element\DataType\Text::NAME,
484 'formElement' => Form\Element\Input::NAME,
485 'componentType' => Form\Field::NAME,
486 'dataScope' =>
'title',
487 'label' =>
__(
'Store View Title'),
489 'validation' => [
'required-entry' =>
true],
507 'formElement' =>
'container',
509 'component' =>
'Magento_Ui/js/form/components/group',
510 'showLabel' =>
false,
511 'additionalClasses' =>
'admin__field-group-columns admin__control-group-equal',
512 'breakLine' =>
false,
522 'dataType' => Form\Element\DataType\Text::NAME,
523 'formElement' => Form\Element\Select::NAME,
524 'componentType' => Form\Field::NAME,
525 'component' =>
'Magento_Ui/js/form/element/select',
526 'parentContainer' =>
'product_bundle_container',
527 'selections' =>
'bundle_selections',
528 'isDefaultIndex' =>
'is_default',
529 'userDefinedIndex' =>
'selection_can_change_qty',
530 'dataScope' =>
'type',
531 'label' =>
__(
'Input Type'),
535 'label' =>
__(
'Drop-down'),
539 'label' =>
__(
'Radio Buttons'),
543 'label' =>
__(
'Checkbox'),
544 'value' =>
'checkbox' 547 'label' =>
__(
'Multiple Select'),
554 'checkbox' =>
'checkbox',
555 'multi' =>
'checkbox' 565 'dataType' => Form\Element\DataType\Number::NAME,
566 'formElement' => Form\Element\Checkbox::NAME,
567 'componentType' => Form\Field::NAME,
568 'description' =>
__(
'Required'),
569 'dataScope' =>
'required',
600 'isTemplate' =>
true,
601 'component' =>
'Magento_Ui/js/dynamic-rows/record',
602 'is_collection' =>
true,
604 'inputType' =>
'${$.parentName}:inputType',
607 'isDefaultValue' =>
'${$.parentName}:isDefaultValue.${$.index}',
621 'formElement' => Form\Element\Checkbox::NAME,
622 'componentType' => Form\Field::NAME,
623 'component' =>
'Magento_Bundle/js/components/bundle-checkbox',
624 'parentContainer' =>
'product_bundle_container',
625 'parentSelections' =>
'bundle_selections',
626 'changer' =>
'option_info.type',
627 'dataType' => Form\Element\DataType\Boolean::NAME,
628 'label' =>
__(
'Is Default'),
629 'dataScope' =>
'is_default',
633 'valueMap' => [
'false' =>
'0',
'true' =>
'1']
642 'componentType' => Form\Field::NAME,
643 'dataType' => Form\Element\DataType\Text::NAME,
644 'formElement' => Form\Element\Input::NAME,
645 'elementTmpl' =>
'ui/dynamic-rows/cells/text',
646 'label' =>
__(
'Name'),
647 'dataScope' =>
'name',
657 'componentType' => Form\Field::NAME,
658 'dataType' => Form\Element\DataType\Text::NAME,
659 'formElement' => Form\Element\Input::NAME,
660 'elementTmpl' =>
'ui/dynamic-rows/cells/text',
661 'label' =>
__(
'SKU'),
662 'dataScope' =>
'sku',
674 'component' =>
'Magento_Bundle/js/components/bundle-option-qty',
675 'formElement' => Form\Element\Input::NAME,
676 'componentType' => Form\Field::NAME,
677 'dataType' => Form\Element\DataType\Number::NAME,
678 'label' =>
__(
'Default Quantity'),
679 'dataScope' =>
'selection_qty',
683 'required-entry' =>
true,
684 'validate-number' =>
true,
685 'validate-greater-than-zero' => true
688 'isInteger' =>
'${ $.provider }:${ $.parentScope }.selection_qty_is_integer' 694 'selection_can_change_qty' => [
698 'componentType' => Form\Field::NAME,
699 'formElement' => Form\Element\Checkbox::NAME,
700 'dataType' => Form\Element\DataType\Price::NAME,
701 'component' =>
'Magento_Bundle/js/components/bundle-user-defined-checkbox',
702 'label' =>
__(
'User Defined'),
703 'dataScope' =>
'selection_can_change_qty',
705 'valueMap' => [
'true' =>
'1',
'false' =>
'0'],
708 'inputType' =>
'${$.parentName}:inputType',
719 'componentType' =>
'actionDelete',
720 'dataType' => Form\Element\DataType\Text::NAME,
743 'componentType' => Form\Field::NAME,
744 'dataType' => Form\Element\DataType\Price::NAME,
745 'formElement' => Form\Element\Input::NAME,
746 'label' =>
__(
'Price'),
747 'dataScope' =>
'selection_price_value',
770 'componentType' => Form\Field::NAME,
771 'dataType' => Form\Element\DataType\Boolean::NAME,
772 'formElement' => Form\Element\Select::NAME,
773 'label' =>
__(
'Price Type'),
774 'dataScope' =>
'selection_price_type',
778 'label' =>
__(
'Fixed'),
782 'label' =>
__(
'Percent'),
803 return $this->locator->getProduct()->getStoreId() == 0;
const CODE_TIER_PRICE_FIELD_PRICE