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