1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
| <?php
namespace Silk\AdvancedEstimatedShippingDate\Ui\DataProvider\Product\Form\Modifier; use Magento\Framework\Stdlib\ArrayManager;
class esd implements \Magento\Ui\DataProvider\Modifier\ModifierInterface {
const CONTAINER_PREFIX = 'container_';
protected $arrayManager;
public function __construct(ArrayManager $arrayManager) { $this->arrayManager = $arrayManager; }
public function modifyData(array $data) { return $data; }
public function modifyMeta(array $meta) { $fieldCode = 'esd'; $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' => [ 'formElement' => 'container', 'componentType' => 'container', 'breakLine' => false, 'label' => __('ESD'), 'required' => 0, 'sortOrder' => 320, 'scopeLabel' => __('[STORE VIEW]'), ], ], ], 'children' => [ $fieldCode => [ 'arguments' => [ 'data' => [ 'config' => [ 'dataType' => 'multiselect', 'formElement' => 'multiselect', 'elementTmpl' => 'Silk_AdvancedEstimatedShippingDate/ui/form/element/multiselect' ], ], ], ], ] ] ); return $meta; } }
|