public function getImageUrl($name, $ids, $type) { global $link; $url = $link->getImageLink($name, $ids, $type); // older prestashop versions return a relative url here, so we must make sure it's absolute if (CartAPI_Handlers_Helpers::isAbsoluteUrl($url)) { return $url; } else { return CartAPI_Handlers_Helpers::getShopDomain() . $url; } }
public function getImageUrl($name, $id_category, $type) { global $link; $url = $link->getCatImageLink($name, $id_category, $type); if (CartAPI_Handlers_Helpers::isAbsoluteUrl($url)) { return $url; } // new prestashop versions (above 1.5) return an absolute url in getCatImageLink if (method_exists('Link', 'getMediaLink')) { return $link->getMediaLink($url); } else { return CartAPI_Handlers_Helpers::getShopDomain() . $url; } // older prestashop versions don't support media servers }