speriamobene Posted February 23, 2012 Share Posted February 23, 2012 hi with the image url: http://localhost/ps/.../10-50-home.jpg i understand 10 is id_product and 50 is id_image. but in the url: http://localhost/ps/...3/7/37-home.jpg what are 3 = ? 7 = ? 37 = ? Link to comment Share on other sites More sharing options...
boris.suska Posted March 2, 2012 Share Posted March 2, 2012 Hi, it seems to be image_id by digits, I guess. Anyway after googling I found that getting image URL is easy by this code: // get Product cover image (all images is possible retrieve by // Image::getImages($id_lang, $id_product) or // $productInstance->getImages($id_lang)) $id_image = Product::getCover($id_product); // get Image by id if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); // get image full URL $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } This works for PrestaShop 1.4.6 Link to comment Share on other sites More sharing options...
kelvz Posted December 7, 2012 Share Posted December 7, 2012 hi! tnx for this post... is there a way to get the small image of product generated by presta? Link to comment Share on other sites More sharing options...
stefanbc Posted September 2, 2013 Share Posted September 2, 2013 (edited) hi! tnx for this post... is there a way to get the small image of product generated by presta? Using the code provided by boris.suska you could replace this $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; with this $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath()."-small_default.jpg"; Edited September 2, 2013 by stefanbc (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now