Closed cbacalhauTri closed 5 years ago
Hi, Maybe this piece of code can help you. What it does is: checks if the product has some images associated to it... if it has, then updates the first image to the new one you give (imagePath).. if not, adds a new image to that product.
//prod is a product already added on prestashop
//imgfac is the ImageFactory
if (prod.associations.images.Count > 0)
imgfac.UpdateProductImage((long)prod.id, prod.associations.images.First().id, imagePath);
else
imgfac.AddProductImage((long)prod.id, imagePath);
Closing as it is answered by @LuisDavidR correctly.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello
How can i check if my product has images on prestashop??
thanks