Beispiel #1
0
 /**
  * Retrieve product configured options
  *
  * @return array
  */
 public function getConfiguredOptions()
 {
     $item = $this->getItem();
     $data = $this->getOptionsRenderCfg($item->getProduct()->getTypeId());
     $helper = $this->_helperPool->get($data['helper']);
     return $helper->getOptions($item);
 }
Beispiel #2
0
 /**
  * Returns helper for product type
  *
  * @param Product $product
  * @return \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface
  */
 protected function _getProductHelper($product)
 {
     // Retrieve whole array of renderers
     $productHelpers = $this->getProductHelpers();
     if (!is_array($productHelpers)) {
         $column = $this->getColumn();
         if ($column) {
             $grid = $column->getGrid();
             if ($grid) {
                 $productHelpers = $grid->getProductConfigurationHelpers();
                 $this->setProductHelpers($productHelpers ? $productHelpers : []);
             }
         }
     }
     // Check whether we have helper for our product
     $productType = $product->getTypeId();
     if (isset($productHelpers[$productType])) {
         $helperName = $productHelpers[$productType];
     } elseif (isset($productHelpers['default'])) {
         $helperName = $productHelpers['default'];
     } else {
         $helperName = 'Magento\\Catalog\\Helper\\Product\\Configuration';
     }
     return $this->_productConfigPool->get($helperName);
 }
Beispiel #3
0
 /**
  * Returns html for showing item options
  *
  * @param \Magento\Wishlist\Model\Item $item
  * @return string
  *
  * @deprecated after 1.6.2.0
  */
 public function getDetailsHtml(\Magento\Wishlist\Model\Item $item)
 {
     $cfg = $this->getOptionsRenderCfg($item->getProduct()->getTypeId());
     if (!$cfg) {
         return '';
     }
     $block = $this->getChildBlock('item_options');
     if (!$block) {
         return '';
     }
     if ($cfg['template']) {
         $template = $cfg['template'];
     } else {
         $cfgDefault = $this->getOptionsRenderCfg('default');
         if (!$cfgDefault) {
             return '';
         }
         $template = $cfgDefault['template'];
     }
     $block->setTemplate($template);
     $block->setOptionList($this->_helperPool->get($cfg['helper'])->getOptions($item));
     return $block->toHtml();
 }