public function getGalleryImages() { if ($this->_all === null) { if (class_exists('FlintDigital_SimpleProductData_Block_Product_View_Media')) { $block = new FlintDigital_SimpleProductData_Block_Product_View_Media(); $collection = $block->getGalleryImages(); } else { $collection = parent::getGalleryImages(); } if (empty($collection) || $collection->getSize() == 0) { $productMediaConfig = Mage::getModel('catalog/product_media_config'); $image = $this->getProduct()->getImage(); if ($image != 'no_selection') { $img['url'] = $productMediaConfig->getMediaUrl($image); $img['id'] = null; $img['path'] = $productMediaConfig->getMediaPath($image); $collection = new Varien_Data_Collection(); $collection->addItem(new Varien_Object($img)); } } $videosInit = new IWD_Productvideo_Block_Frontend_Init(); $this->_all = new Varien_Data_Collection(); if ($videosInit->getThumbnailsPosition() == 'before') { $this->_completeCollectionWithVideo(); } foreach ($collection as $item) { $this->_all->addItem($item); } if ($videosInit->getThumbnailsPosition() == 'after') { $this->_completeCollectionWithVideo(); } } return $this->_all; }