Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundleQuantity.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
15  const CODE_QUANTITY_AND_STOCK_STATUS = 'quantity_and_stock_status';
16  const CODE_QUANTITY = 'qty';
17  const CODE_QTY_CONTAINER = 'quantity_and_stock_status_qty';
18 
22  public function modifyMeta(array $meta)
23  {
24  if ($groupCode = $this->getGroupCodeByField($meta, 'container_' . self::CODE_QUANTITY_AND_STOCK_STATUS)) {
25  $parentChildren = &$meta[$groupCode]['children'];
26  if (!empty($parentChildren['container_' . self::CODE_QUANTITY_AND_STOCK_STATUS])) {
27  $parentChildren['container_' . self::CODE_QUANTITY_AND_STOCK_STATUS] = array_replace_recursive(
28  $parentChildren['container_' . self::CODE_QUANTITY_AND_STOCK_STATUS],
29  [
30  'children' => [
31  self::CODE_QUANTITY_AND_STOCK_STATUS => [
32  'arguments' => [
33  'data' => [
34  'config' => ['disabled' => false],
35  ],
36  ],
37  ],
38  ]
39  ]
40  );
41  }
42  }
43 
44  if ($groupCode = $this->getGroupCodeByField($meta, self::CODE_QTY_CONTAINER)) {
45  $parentChildren = &$meta[$groupCode]['children'];
46  if (!empty($parentChildren[self::CODE_QTY_CONTAINER])) {
47  $parentChildren[self::CODE_QTY_CONTAINER] = array_replace_recursive(
48  $parentChildren[self::CODE_QTY_CONTAINER],
49  [
50  'children' => [
51  self::CODE_QUANTITY => [
52  'arguments' => [
53  'data' => [
54  'config' => ['disabled' => true],
55  ],
56  ],
57  ],
58  ],
59  ]
60  );
61  }
62  }
63 
64  return $meta;
65  }
66 
70  public function modifyData(array $data)
71  {
72  return $data;
73  }
74 }