/**
  * {@inheritdoc}
  */
 public function loadProductGalleryByAttributeId($product, $attributeId)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'loadProductGalleryByAttributeId');
     if (!$pluginInfo) {
         return parent::loadProductGalleryByAttributeId($product, $attributeId);
     } else {
         return $this->___callPlugins('loadProductGalleryByAttributeId', func_get_args(), $pluginInfo);
     }
 }
Example #2
0
 /**
  * Get all product images
  *
  * @param \Magento\Framework\DataObject $product
  * @param int $storeId
  * @return array
  */
 protected function _getAllProductImages($product, $storeId)
 {
     $product->setStoreId($storeId);
     $gallery = $this->_mediaAttribute->loadProductGalleryByAttributeId($product, $this->_getMediaGalleryModel()->getAttribute()->getId());
     $imagesCollection = [];
     if ($gallery) {
         $productMediaPath = $this->_getMediaConfig()->getBaseMediaUrlAddition();
         foreach ($gallery as $image) {
             $imagesCollection[] = new \Magento\Framework\DataObject(['url' => $productMediaPath . $image['file'], 'caption' => $image['label'] ? $image['label'] : $image['label_default']]);
         }
     }
     return $imagesCollection;
 }