Example #1
0
 /**
  * Assemble variant image data 
  * 
  * @param \XLite\Module\XC\ProductVariants\Model\Image\ProductVariant\Image $image Image
  *  
  * @return array
  */
 protected function assembleVariantImageData(\XLite\Model\Base\Image $image)
 {
     $result = array('full' => array($image->getWidth(), $image->getHeight(), $image->getURL(), $image->getAlt()));
     foreach ($this->getImageSizes() as $name => $sizes) {
         $result[$name] = $image->getResizedURL($sizes[0], $sizes[1]);
         $result[$name][3] = $image->getAlt();
     }
     return $result;
 }
Example #2
0
 /**
  * Get URL
  *
  * @return string
  */
 public function getURL()
 {
     if (self::STORAGE_S3 == $this->getStorageType()) {
         $url = $this->getS3() ? $this->getS3()->getURL($this->generateS3Path()) : null;
     } else {
         $url = parent::getURL();
     }
     return $url;
 }