Obexto Posted April 3, 2014 Share Posted April 3, 2014 Hello, I can add product images with the web service but how can I update the legend ? Link to comment Share on other sites More sharing options...
Pachis Posted January 28, 2015 Share Posted January 28, 2015 Hi Same problem here. I can create product images through webservice but don't know how to modify the legend/title. Created a issue report here: http://forge.prestashop.com/browse/PSCSX-4244 Still waiting for response. Regards. Link to comment Share on other sites More sharing options...
mlecoq Posted March 27, 2020 Share Posted March 27, 2020 Hi I add to modify classes/webservice/WebserviceSpecificManagementImages.php file to make it accept legend in post in writePostedImageOnDisk method after elseif ($this->wsObject->method == 'POST') { if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name']) { $file = $_FILES['image']; if ($file['size'] > $this->imgMaxUploadSize) { throw new WebserviceException(sprintf('The image size is too large (maximum allowed is %d KB)', ($this->imgMaxUploadSize / 1000)), array(72, 400)); } require_once(_PS_CORE_DIR_.'/images.inc.php'); if ($error = ImageManager::validateUpload($file)) { throw new WebserviceException('Image upload error : '.$error, array(76, 400)); } if (isset($file['tmp_name']) && $file['tmp_name'] != null) { if ($this->imageType == 'products') { $product = new Product((int)$this->wsObject->urlSegment[2]); if (!Validate::isLoadedObject($product)) { throw new WebserviceException('Product '.(int)$this->wsObject->urlSegment[2].' does not exist', array(76, 400)); } $image = new Image(); $image->id_product = (int)($product->id); $image->position = Image::getHighestPosition($product->id) + 1; if (!Image::getCover((int)$product->id)) { $image->cover = 1; } else { $image->cover = 0; } add $image->legend = $_POST["legend"]; and then you can add legend with uploaded picture 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