thilip.xandy Posted March 24, 2014 Share Posted March 24, 2014 Hi, I'm creating one module in that customer need to upload the image for product. If was working fine for single image, when we go for multiple image it is not working properly, only cover image was getting uploaded others are not getting uploaded here is my code for ($i=0; $i< count($_FILES['design']['name']) ; $i++) { $image->position = Image::getHighestPosition($product->id) + 1; if(Image::getImagesTotal($product->id)> 0) $image->cover = false; else $image->cover = true; $languages = Language::getLanguages(); foreach ($languages as $language) $image->legend[$language['id_lang']] = $name; $id_image = $image->id; $image->add(); $tmpName = tempnam(_PS_IMG_DIR_, 'PS'); move_uploaded_file($_FILES['design']['tmp_name'][$i], $tmpName); $new_path = $image->getPathForCreation(); ImageManager::resize($tmpName, $new_path.'.'.$image->image_format); $imagesTypes = ImageType::getImagesTypes('products'); foreach ($imagesTypes as $imageType) ImageManager::resize($tmpName, $new_path.'-'.stripslashes($imageType['name'][$i]).'.'.$image->image_format, $imageType['width'][$i], $imageType['height'][$i], $image->image_format); } thanks in advance. Link to comment Share on other sites More sharing options...
vekia Posted March 27, 2014 Share Posted March 27, 2014 duplicated: http://www.prestashop.com/forums/topic/318045-multiple-image-upload-for-product/ topic closed. Link to comment Share on other sites More sharing options...
Recommended Posts