UPDATE: If anyone is looking for answer - how to import ... great reply is there: https://stackoverflow.com/a/7894485/1068055
I am unable find answer and I am stuck for a day studying ObjectModel and classes, too...
I have a valid Product object. I have 1 url for cover image, 2 url for antoher images of product. I am able to copy the images to my server. But then I am stuck :/ I dont know, how to exactly create an Image object and then bing it to the product?
Any help? Don't need entire script, just the logic.
I was looking for something like that:
- ImageCore::createFromTempFile()
- Product::addImage()
I tried:
add1:
$img = new ImageCore()
$img->id_product = $prod->id
$img->cover = TRUE/FALSE
.. and stuck there :// Unable to find out, how to transfer the image_data to this object :( I have the image in tmp directory, e.g. $tmpFileName...