예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function modifyMeta(array $meta)
 {
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(static::CODE_PRICE_TYPE, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['disabled' => (bool) $this->locator->getProduct()->getId(), 'valueMap' => ['false' => '1', 'true' => '0'], 'validation' => ['required-entry' => false]]);
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(ProductAttributeInterface::CODE_PRICE, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['imports' => ['disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked']]);
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(static::CODE_TAX_CLASS_ID, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['imports' => ['disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked']]);
     return $meta;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function modifyMeta(array $meta)
 {
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(static::CODE_WEIGHT_TYPE, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['valueMap' => ['false' => '1', 'true' => '0'], 'validation' => ['required-entry' => false]]);
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(ProductAttributeInterface::CODE_HAS_WEIGHT, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['disabled' => true, 'visible' => false]);
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(ProductAttributeInterface::CODE_WEIGHT, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['imports' => ['disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_WEIGHT_TYPE . ':checked']]);
     return $meta;
 }
예제 #3
0
 /**
  * Modify "Price Type" fields
  *
  * @param array $meta
  * @return array
  */
 private function modifyPriceTypeFields(array $meta)
 {
     $isConfigurable = $this->locator->getProduct()->getTypeId() === ConfigurableProductType::TYPE_CODE;
     $paths = $this->arrayManager->findPaths(CustomOptionsModifier::FIELD_PRICE_TYPE_NAME, $meta, CustomOptionsModifier::GROUP_CUSTOM_OPTIONS_NAME . '/children', 'children');
     foreach ($paths as $fieldPath) {
         $meta = $this->arrayManager->merge($fieldPath . static::META_CONFIG_PATH, $meta, ['component' => 'Magento_ConfigurableProduct/js/components/custom-options-price-type', 'isConfigurable' => $isConfigurable, 'bannedOptions' => ['percent'], 'imports' => ['updateOptions' => 'ns = ${ $.ns }, index = ' . ConfigurablePanel::CONFIGURABLE_MATRIX . ':isEmpty']]);
     }
     return $meta;
 }
예제 #4
0
 /**
  * Add default service to title
  *
  * @param string $titleIndex
  * @return $this
  */
 protected function titleUsedDefault($titleIndex)
 {
     $canDisplayService = $this->locator->getProduct()->getStoreId();
     $usedDefault = $this->locator->getProduct()->getAttributeDefaultValue($titleIndex) === false;
     if ($canDisplayService) {
         $useDefaultConfig = ['usedDefault' => $usedDefault, 'disabled' => $usedDefault, 'service' => ['template' => 'ui/form/element/helper/service']];
         $linksTitlePath = $this->arrayManager->findPath($titleIndex, $this->meta, null, 'children') . static::META_CONFIG_PATH;
         $this->meta = $this->arrayManager->merge($linksTitlePath, $this->meta, $useDefaultConfig);
     }
     return $this;
 }
 /**
  * Add default service to title
  *
  * @param string $titleIndex
  * @return $this
  */
 protected function titleUsedDefault($titleIndex)
 {
     $canDisplayService = $this->locator->getProduct()->getStoreId();
     $usedDefault = $this->locator->getProduct()->getAttributeDefaultValue($titleIndex) === false;
     if ($canDisplayService) {
         $useDefaultConfig = ['usedDefault' => $usedDefault, 'disabled' => $usedDefault, 'service' => ['template' => 'ui/form/element/helper/service']];
         $linksTitlePath = $this->getElementArrayPath($this->meta, $titleIndex) . '/arguments/data/config';
         $this->meta = $this->arrayManager->merge($linksTitlePath, $this->meta, $useDefaultConfig);
     }
     return $this;
 }
예제 #6
0
 /**
  * Customize msrp field
  *
  * @return $this
  */
 protected function customizeMsrp()
 {
     $msrpPath = $this->arrayManager->findPath(static::FIELD_MSRP, $this->meta, null, 'children');
     if ($msrpPath) {
         if ($this->msrpConfig->isEnabled()) {
             $this->meta = $this->arrayManager->merge($msrpPath . '/arguments/data/config', $this->meta, ['addbefore' => $this->locator->getStore()->getBaseCurrency()->getCurrencySymbol(), 'validation' => ['validate-zero-or-greater' => true]]);
         } else {
             $this->meta = $this->arrayManager->remove($this->arrayManager->slicePath($msrpPath, 0, -2), $this->meta);
         }
     }
     return $this;
 }
 /**
  * Customization of allow gift message field
  *
  * @param array $meta
  * @return array
  */
 protected function customizeAllowGiftMessageField(array $meta)
 {
     $groupCode = $this->getGroupCodeByField($meta, 'container_' . static::FIELD_MESSAGE_AVAILABLE);
     if (!$groupCode) {
         return $meta;
     }
     $containerPath = $this->getElementArrayPath($meta, 'container_' . static::FIELD_MESSAGE_AVAILABLE);
     $fieldPath = $this->getElementArrayPath($meta, static::FIELD_MESSAGE_AVAILABLE);
     $groupConfig = $this->arrayManager->get($containerPath, $meta);
     $fieldConfig = $this->arrayManager->get($fieldPath, $meta);
     $meta = $this->arrayManager->merge($containerPath, $meta, ['arguments' => ['data' => ['config' => ['formElement' => 'container', 'componentType' => 'container', 'component' => 'Magento_Ui/js/form/components/group', 'label' => $groupConfig['arguments']['data']['config']['label'], 'breakLine' => false, 'sortOrder' => $fieldConfig['arguments']['data']['config']['sortOrder'], 'dataScope' => '']]]]);
     $meta = $this->arrayManager->merge($containerPath, $meta, ['children' => [static::FIELD_MESSAGE_AVAILABLE => ['arguments' => ['data' => ['config' => ['dataScope' => static::FIELD_MESSAGE_AVAILABLE, 'imports' => ['disabled' => '${$.parentName}.use_config_' . static::FIELD_MESSAGE_AVAILABLE . ':checked'], 'additionalClasses' => 'admin__field-x-small', 'formElement' => Checkbox::NAME, 'componentType' => Field::NAME, 'prefer' => 'toggle', 'valueMap' => ['false' => '0', 'true' => '1']]]]], 'use_config_' . static::FIELD_MESSAGE_AVAILABLE => ['arguments' => ['data' => ['config' => ['dataType' => 'number', 'formElement' => Checkbox::NAME, 'componentType' => Field::NAME, 'description' => __('Use Config Settings'), 'dataScope' => 'use_config_' . static::FIELD_MESSAGE_AVAILABLE, 'valueMap' => ['false' => '0', 'true' => '1']]]]]]]);
     return $meta;
 }
 /**
  * Customize date range field if from and to fields belong to one group
  *
  * @param array $meta
  * @return array
  */
 protected function customizeDateRangeField(array $meta)
 {
     if ($this->getGroupCodeByField($meta, self::CODE_CUSTOM_DESIGN_FROM) !== $this->getGroupCodeByField($meta, self::CODE_CUSTOM_DESIGN_TO)) {
         return $meta;
     }
     $fromFieldPath = $this->arrayManager->findPath(self::CODE_CUSTOM_DESIGN_FROM, $meta, null, 'children');
     $toFieldPath = $this->arrayManager->findPath(self::CODE_CUSTOM_DESIGN_TO, $meta, null, 'children');
     $fromContainerPath = $this->arrayManager->slicePath($fromFieldPath, 0, -2);
     $toContainerPath = $this->arrayManager->slicePath($toFieldPath, 0, -2);
     $meta = $this->arrayManager->merge($fromFieldPath . self::META_CONFIG_PATH, $meta, ['label' => __('Schedule Update From'), 'additionalClasses' => 'admin__field-date']);
     $meta = $this->arrayManager->merge($toFieldPath . self::META_CONFIG_PATH, $meta, ['label' => __('To'), 'scopeLabel' => null, 'additionalClasses' => 'admin__field-date']);
     $meta = $this->arrayManager->merge($fromContainerPath . self::META_CONFIG_PATH, $meta, ['label' => __('Schedule Update From'), 'additionalClasses' => 'admin__control-grouped-date', 'breakLine' => false, 'component' => 'Magento_Ui/js/form/components/group']);
     $meta = $this->arrayManager->set($fromContainerPath . '/children/' . self::CODE_CUSTOM_DESIGN_TO, $meta, $this->arrayManager->get($toFieldPath, $meta));
     return $this->arrayManager->remove($toContainerPath, $meta);
 }
 /**
  * Adding URL rewrite checkbox to meta
  *
  * @param array $meta
  * @return array
  */
 protected function addUrlRewriteCheckbox(array $meta)
 {
     $urlPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_SEO_FIELD_URL_KEY);
     if ($urlPath) {
         $containerPath = $this->arrayManager->slicePath($urlPath, 0, -2);
         $urlKey = $this->locator->getProduct()->getData('url_key');
         $saveRewritesHistory = $this->scopeConfig->isSetFlag(self::XML_PATH_SEO_SAVE_HISTORY, ScopeInterface::SCOPE_STORE, $this->locator->getProduct()->getStoreId());
         $meta = $this->arrayManager->merge($containerPath, $meta, ['arguments' => ['data' => ['config' => ['component' => 'Magento_Ui/js/form/components/group']]]]);
         $checkbox['arguments']['data']['config'] = ['componentType' => Field::NAME, 'formElement' => Checkbox::NAME, 'dataType' => Text::NAME, 'component' => 'Magento_CatalogUrlRewrite/js/components/url-key-handle-changes', 'valueMap' => ['false' => '', 'true' => $urlKey], 'imports' => ['handleChanges' => '${ $.provider }:data.product.' . ProductAttributeInterface::CODE_SEO_FIELD_URL_KEY], 'description' => __('Create Permanent Redirect for old URL'), 'dataScope' => 'url_key_create_redirect', 'value' => $saveRewritesHistory ? $urlKey : '', 'checked' => $saveRewritesHistory];
         $meta = $this->arrayManager->merge($urlPath . '/arguments/data/config', $meta, ['valueUpdate' => 'keyup']);
         $meta = $this->arrayManager->merge($containerPath . '/children', $meta, ['url_key_create_redirect' => $checkbox]);
         $meta = $this->arrayManager->merge($containerPath . '/arguments/data/config', $meta, ['breakLine' => true]);
     }
     return $meta;
 }
예제 #10
0
 /**
  * Customize Advanced Pricing Panel
  *
  * @return $this
  */
 protected function customizeAdvancedPricing()
 {
     $this->meta['advanced-pricing']['arguments']['data']['config']['opened'] = true;
     $this->meta['advanced-pricing']['arguments']['data']['config']['collapsible'] = false;
     $this->meta['advanced-pricing']['arguments']['data']['config']['label'] = '';
     $this->meta['advanced_pricing_modal']['arguments']['data']['config'] = ['isTemplate' => false, 'componentType' => Modal::NAME, 'dataScope' => '', 'provider' => 'product_form.product_form_data_source', 'onCancel' => 'actionDone', 'options' => ['title' => __('Advanced Pricing'), 'buttons' => [['text' => __('Done'), 'class' => 'action-primary', 'actions' => [['targetName' => '${ $.name }', 'actionName' => 'actionDone']]]]]];
     $this->meta = $this->arrayManager->merge($this->arrayManager->findPath(static::CONTAINER_PREFIX . ProductAttributeInterface::CODE_PRICE, $this->meta, null, 'children'), $this->meta, ['arguments' => ['data' => ['config' => ['component' => 'Magento_Ui/js/form/components/group']]]]);
     $this->meta['advanced_pricing_modal']['children']['advanced-pricing'] = $this->meta['advanced-pricing'];
     unset($this->meta['advanced-pricing']);
     return $this;
 }
예제 #11
0
 /**
  * Customize Categories field
  *
  * @param array $meta
  * @return array
  */
 protected function customizeCategoriesField(array $meta)
 {
     $fieldCode = 'category_ids';
     $elementPath = $this->arrayManager->findPath($fieldCode, $meta, null, 'children');
     $containerPath = $this->arrayManager->findPath(static::CONTAINER_PREFIX . $fieldCode, $meta, null, 'children');
     if (!$elementPath) {
         return $meta;
     }
     $meta = $this->arrayManager->merge($containerPath, $meta, ['arguments' => ['data' => ['config' => ['label' => __('Categories'), 'dataScope' => '', 'breakLine' => false, 'formElement' => 'container', 'componentType' => 'container', 'component' => 'Magento_Ui/js/form/components/group', 'scopeLabel' => __('[GLOBAL]')]]], 'children' => [$fieldCode => ['arguments' => ['data' => ['config' => ['formElement' => 'select', 'componentType' => 'field', 'component' => 'Magento_Catalog/js/components/new-category', 'filterOptions' => true, 'chipsEnabled' => true, 'disableLabel' => true, 'levelsVisibility' => '1', 'elementTmpl' => 'ui/grid/filters/elements/ui-select', 'options' => $this->getCategoriesTree(), 'listens' => ['index=create_category:responseData' => 'setParsed', 'newOption' => 'toggleOptionSelected'], 'config' => ['dataScope' => $fieldCode, 'sortOrder' => 10]]]]], 'create_category_button' => ['arguments' => ['data' => ['config' => ['title' => __('New Category'), 'formElement' => 'container', 'additionalClasses' => 'admin__field-small', 'componentType' => 'container', 'component' => 'Magento_Ui/js/form/components/button', 'template' => 'ui/form/components/button/container', 'actions' => [['targetName' => 'product_form.product_form.create_category_modal', 'actionName' => 'toggleModal'], ['targetName' => 'product_form.product_form.create_category_modal.create_category', 'actionName' => 'render'], ['targetName' => 'product_form.product_form.create_category_modal.create_category', 'actionName' => 'resetForm']], 'additionalForGroup' => true, 'provider' => false, 'source' => 'product_details', 'displayArea' => 'insideGroup', 'sortOrder' => 20]]]]]]);
     return $meta;
 }
 /**
  * Add links for fields depends of product name
  *
  * @param array $meta
  * @return array
  */
 protected function customizeNameListeners(array $meta)
 {
     $listeners = [ProductAttributeInterface::CODE_SKU, ProductAttributeInterface::CODE_SEO_FIELD_META_TITLE, ProductAttributeInterface::CODE_SEO_FIELD_META_KEYWORD, ProductAttributeInterface::CODE_SEO_FIELD_META_DESCRIPTION];
     foreach ($listeners as $listener) {
         $listenerPath = $this->getElementArrayPath($meta, $listener);
         $importsConfig = ['arguments' => ['data' => ['config' => ['component' => 'Magento_Catalog/js/components/import-handler', 'imports' => ['handleChanges' => '${$.provider}:data.product.name']]]]];
         $meta = $this->arrayManager->merge($listenerPath, $meta, $importsConfig);
     }
     $skuPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_SKU);
     $meta = $this->arrayManager->merge($skuPath, $meta, ['arguments' => ['data' => ['config' => ['autoImportIfEmpty' => true, 'allowImport' => $this->locator->getProduct()->getId() ? false : true]]]]);
     $namePath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_NAME);
     return $this->arrayManager->merge($namePath, $meta, ['arguments' => ['data' => ['config' => ['valueUpdate' => 'keyup']]]]);
 }
 /**
  * @return void
  */
 private function prepareMeta()
 {
     $fieldCode = 'quantity_and_stock_status';
     $pathField = $this->getElementArrayPath($this->meta, $fieldCode);
     if ($pathField) {
         $labelField = $this->arrayManager->get($this->arrayManager->slicePath($pathField, 0, -2) . '/arguments/data/config/label', $this->meta);
         $fieldsetPath = $this->arrayManager->slicePath($pathField, 0, -4);
         $this->meta = $this->arrayManager->merge($pathField . '/arguments/data/config', $this->meta, ['label' => __('Stock Status'), 'value' => '1', 'dataScope' => $fieldCode . '.is_in_stock', 'scopeLabel' => '[GLOBAL]']);
         $this->meta = $this->arrayManager->merge($this->arrayManager->slicePath($pathField, 0, -2) . '/arguments/data/config', $this->meta, ['label' => __('Stock Status'), 'scopeLabel' => '[GLOBAL]']);
         $container['arguments']['data']['config'] = ['formElement' => 'container', 'componentType' => 'container', 'component' => "Magento_Ui/js/form/components/group", 'label' => $labelField, 'breakLine' => false, 'dataScope' => $fieldCode, 'scopeLabel' => '[GLOBAL]', 'source' => 'product_details', 'sortOrder' => (int) $this->arrayManager->get($this->arrayManager->slicePath($pathField, 0, -2) . '/arguments/data/config/sortOrder', $this->meta) - 1];
         $qty['arguments']['data']['config'] = ['component' => 'Magento_CatalogInventory/js/components/qty-validator-changer', 'dataType' => 'number', 'formElement' => 'input', 'componentType' => 'field', 'visible' => '1', 'require' => '0', 'additionalClasses' => 'admin__field-small', 'dataScope' => 'qty', 'validation' => ['validate-number' => true, 'validate-digits' => true], 'imports' => ['handleChanges' => '${$.provider}:data.product.stock_data.is_qty_decimal'], 'sortOrder' => 10];
         $advancedInventoryButton['arguments']['data']['config'] = ['displayAsLink' => true, 'formElement' => 'container', 'componentType' => 'container', 'component' => 'Magento_Ui/js/form/components/button', 'template' => 'ui/form/components/button/container', 'actions' => [['targetName' => 'product_form.product_form.advanced_inventory_modal', 'actionName' => 'toggleModal']], 'title' => __('Advanced Inventory'), 'provider' => false, 'additionalForGroup' => true, 'source' => 'product_details', 'sortOrder' => 20];
         $container['children'] = ['qty' => $qty, 'advanced_inventory_button' => $advancedInventoryButton];
         $this->meta = $this->arrayManager->merge($fieldsetPath . '/children', $this->meta, ['quantity_and_stock_status_qty' => $container]);
     }
 }
예제 #14
0
 /**
  * Add links for fields depends of product name
  *
  * @param array $meta
  * @return array
  */
 protected function customizeNameListeners(array $meta)
 {
     $listeners = [ProductAttributeInterface::CODE_SKU, ProductAttributeInterface::CODE_SEO_FIELD_META_TITLE, ProductAttributeInterface::CODE_SEO_FIELD_META_KEYWORD, ProductAttributeInterface::CODE_SEO_FIELD_META_DESCRIPTION];
     $textListeners = [ProductAttributeInterface::CODE_SEO_FIELD_META_KEYWORD, ProductAttributeInterface::CODE_SEO_FIELD_META_DESCRIPTION];
     foreach ($listeners as $listener) {
         $listenerPath = $this->arrayManager->findPath($listener, $meta, null, 'children');
         $importsConfig = ['mask' => $this->locator->getStore()->getConfig('catalog/fields_masks/' . $listener), 'component' => 'Magento_Catalog/js/components/import-handler', 'imports' => ['handleNameChanges' => '${$.provider}:data.product.name', 'handleDescriptionChanges' => '${$.provider}:data.product.description', 'handleSkuChanges' => '${$.provider}:data.product.sku', 'handleColorChanges' => '${$.provider}:data.product.color', 'handleCountryChanges' => '${$.provider}:data.product.country_of_manufacture', 'handleGenderChanges' => '${$.provider}:data.product.gender', 'handleMaterialChanges' => '${$.provider}:data.product.material', 'handleShortDescriptionChanges' => '${$.provider}:data.product.short_description', 'handleSizeChanges' => '${$.provider}:data.product.size'], 'allowImport' => !$this->locator->getProduct()->getId()];
         if (!in_array($listener, $textListeners)) {
             $importsConfig['elementTmpl'] = 'ui/form/element/input';
         }
         $meta = $this->arrayManager->merge($listenerPath . static::META_CONFIG_PATH, $meta, $importsConfig);
     }
     $skuPath = $this->arrayManager->findPath(ProductAttributeInterface::CODE_SKU, $meta, null, 'children');
     $meta = $this->arrayManager->merge($skuPath . static::META_CONFIG_PATH, $meta, ['autoImportIfEmpty' => true]);
     $namePath = $this->arrayManager->findPath(ProductAttributeInterface::CODE_NAME, $meta, null, 'children');
     return $this->arrayManager->merge($namePath . static::META_CONFIG_PATH, $meta, ['valueUpdate' => 'keyup']);
 }
예제 #15
0
 /**
  * Get config for container with common fields for any type
  *
  * @param int $sortOrder
  * @return array
  */
 protected function getCommonContainerConfig($sortOrder)
 {
     $commonContainer = ['arguments' => ['data' => ['config' => ['componentType' => Container::NAME, 'formElement' => Container::NAME, 'component' => 'Magento_Ui/js/form/components/group', 'breakLine' => false, 'showLabel' => false, 'additionalClasses' => 'admin__field-group-columns admin__control-group-equal', 'sortOrder' => $sortOrder]]], 'children' => [static::FIELD_OPTION_ID => $this->getOptionIdFieldConfig(10), static::FIELD_TITLE_NAME => $this->getTitleFieldConfig(20, ['arguments' => ['data' => ['config' => ['label' => __('Option Title'), 'component' => 'Magento_Catalog/component/static-type-input', 'valueUpdate' => 'input', 'imports' => ['optionId' => '${ $.provider }:${ $.parentScope }.option_id']]]]]), static::FIELD_TYPE_NAME => $this->getTypeFieldConfig(30), static::FIELD_IS_REQUIRE_NAME => $this->getIsRequireFieldConfig(40)]];
     if ($this->locator->getProduct()->getStoreId()) {
         $useDefaultConfig = ['service' => ['template' => 'Magento_Catalog/form/element/helper/custom-option-service']];
         $titlePath = $this->arrayManager->findPath(static::FIELD_TITLE_NAME, $commonContainer, null) . static::META_CONFIG_PATH;
         $commonContainer = $this->arrayManager->merge($titlePath, $commonContainer, $useDefaultConfig);
     }
     return $commonContainer;
 }
예제 #16
0
 /**
  * Get option info
  *
  * @return array
  */
 protected function getOptionInfo()
 {
     $result = ['arguments' => ['data' => ['config' => ['formElement' => 'container', 'componentType' => Container::NAME, 'component' => 'Magento_Ui/js/form/components/group', 'showLabel' => false, 'additionalClasses' => 'admin__field-group-columns admin__control-group-equal', 'breakLine' => false, 'sortOrder' => 10]]], 'children' => ['type' => ['arguments' => ['data' => ['config' => ['dataType' => Form\Element\DataType\Text::NAME, 'formElement' => Form\Element\Select::NAME, 'componentType' => Form\Field::NAME, 'component' => 'Magento_Bundle/js/components/bundle-input-type', 'parentContainer' => 'product_bundle_container', 'selections' => 'bundle_selections', 'isDefaultIndex' => 'is_default', 'userDefinedIndex' => 'selection_can_change_qty', 'dataScope' => 'type', 'label' => __('Input Type'), 'sortOrder' => 20, 'options' => [['label' => __('Drop-down'), 'value' => 'select'], ['label' => __('Radio Buttons'), 'value' => 'radio'], ['label' => __('Checkbox'), 'value' => 'checkbox'], ['label' => __('Multiple Select'), 'value' => 'multi']], 'typeMap' => ['select' => 'radio', 'radio' => 'radio', 'checkbox' => 'checkbox', 'multi' => 'checkbox']]]]], 'required' => ['arguments' => ['data' => ['config' => ['dataType' => Form\Element\DataType\Number::NAME, 'formElement' => Form\Element\Checkbox::NAME, 'componentType' => Form\Field::NAME, 'description' => __('Required'), 'dataScope' => 'required', 'label' => ' ', 'value' => '1', 'valueMap' => ['true' => '1', 'false' => '0'], 'sortOrder' => 30]]]]]];
     return $this->arrayManager->merge('children', $result, $this->getTitleConfiguration());
 }
예제 #17
0
 /**
  * {@inheritdoc}
  */
 public function modifyMeta(array $meta)
 {
     $meta = $this->arrayManager->merge($this->arrayManager->findPath(static::CODE_SKU_TYPE, $meta, null, 'children') . static::META_CONFIG_PATH, $meta, ['valueMap' => ['false' => '1', 'true' => '0'], 'validation' => ['required-entry' => false]]);
     return $meta;
 }
예제 #18
0
파일: Eav.php 프로젝트: rafaelstz/magento2
 /**
  * Setup attribute container meta
  *
  * @param ProductAttributeInterface $attribute
  * @return array
  * @api
  */
 public function setupAttributeContainerMeta(ProductAttributeInterface $attribute)
 {
     $containerMeta = $this->arrayManager->set('arguments/data/config', [], ['formElement' => 'container', 'componentType' => 'container', 'breakLine' => false, 'label' => $attribute->getDefaultFrontendLabel(), 'required' => $attribute->getIsRequired()]);
     if ($attribute->getIsWysiwygEnabled()) {
         $containerMeta = $this->arrayManager->merge('arguments/data/config', $containerMeta, ['component' => 'Magento_Ui/js/form/components/group']);
     }
     return $containerMeta;
 }
 /**
  * @param string $path
  * @param array $data
  * @param array $value
  * @param array $result
  * @dataProvider mergeDataProvider
  */
 public function testMerge($path, $data, $value, $result)
 {
     $this->assertSame($result, $this->arrayManager->merge($path, $data, $value));
 }