Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ItemIdProcessor.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
19  public function process($jsLayout, AbstractItem $item)
20  {
21  if (isset($jsLayout['components']['giftOptionsCartItem'])) {
22  if (!isset($jsLayout['components']['giftOptionsCartItem']['config'])) {
23  $jsLayout['components']['giftOptionsCartItem']['config'] = [];
24  }
25  $jsLayout['components']['giftOptionsCartItem']['config']['itemId'] = $item->getId();
26 
27  $jsLayout['components']['giftOptionsCartItem-' . $item->getId()] =
28  $jsLayout['components']['giftOptionsCartItem'];
29  unset($jsLayout['components']['giftOptionsCartItem']);
30  }
31 
32  return $jsLayout;
33  }
34 }