VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: panoss on August 24, 2017, 17:05:00 pm

Title: How can I add images to products with code?
Post by: panoss on August 24, 2017, 17:05:00 pm
I have products which have no image.
I want to add to them an image with code, not via VM GUI.
Which steps should I make?
1. add in table 'virtuemart_medias' in the product 's record, in field 'file_url', the image 's url? Something like: 'images/virtuemart/product/' .$file_title ?
2. put the image in the folder 'images/virtuemart/product/' ?
3. make an image of the appropriate dimensions and put it in the folder 'images/virtuemart/product/resized' ?
4. Something else?

How can I resample the image in order to achieve step 3? How is it applied in VM code?
Title: Re: How can I add images to products with code?
Post by: panoss on August 24, 2017, 17:33:47 pm
Ok, the other step was to add the imge in table 'virtuemart_product_medias'.

So I only need to know haw can I resample the image.
Where is the code of VM that does this?