getItem()->getOptionByCode('simple_product')) { return $option->getProduct(); } return $this->getProduct(); } /** * Get item product name * * @return string */ public function getProductName() { return $this->getProduct()->getName(); } /** * Get list of all options for product * * @return array */ public function getOptionList() { return $this->_productConfig->getOptions($this->getItem()); } /** * {@inheritdoc} */ public function getProductForThumbnail() { /** * Show parent product thumbnail if it must be always shown according to the related setting in system config * or if child thumbnail is not available */ if ($this->_scopeConfig->getValue( self::CONFIG_THUMBNAIL_SOURCE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) == ThumbnailSource::OPTION_USE_PARENT_IMAGE || !($this->getChildProduct()->getThumbnail() && $this->getChildProduct()->getThumbnail() != 'no_selection') ) { $product = $this->getProduct(); } else { $product = $this->getChildProduct(); } return $product; } /** * Return identifiers for produced content * * @return array */ public function getIdentities() { $identities = parent::getIdentities(); if ($this->getItem()) { $identities = array_merge($identities, $this->getChildProduct()->getIdentities()); } return $identities; } }