public function getMediaUrl($file) { if ($this->_imageShouldComeFromCloudinary($file)) { return $this->_getUrlForImage($file); } return parent::getMediaUrl($file); }
/** * Get full url for image * * @param string $imagePath * * @return string */ protected function _getImageUrl($imagePath) { if (!in_array($imagePath, array(null, 'no_selection', '/'))) { if (pathinfo($imagePath, PATHINFO_EXTENSION) == 'tmp') { $imageUrl = $this->_mediaConfig->getTmpMediaUrl(substr($imagePath, 0, -4)); } else { $imageUrl = $this->_mediaConfig->getMediaUrl($imagePath); } } else { $imageUrl = $this->_design->getViewFileUrl('Mage_Adminhtml::images/image-placeholder.png'); } return $imageUrl; }