I have written a short MySQL function to insert new products straight into my store database.
The function works fine for adding all information to the relevant tables, and are displayed in the store fine. The only problem I am having is that for some reason prestashop is converting the image url into seperate digits, for example:
product id: 1234
image id 5678
For all my existing products prestashop will read the the image url as: ../img/p/1234-5678-large.jpg, which is fine.
However, for products being added by my function, prestashop reads the url like this: ../img/p/1/2/3/4-5678.jpg, which obviously doesn't work as there is no folder called '1' in the img/p folder.
I have declared the product as integer in the function, but don't think this can be the issue as the product id works for everything else (attributes, price, description etc).
Also, when manually adding product images to the [db]_image and [db]_image_lang tables I get the same problem, even when copying and then deleting product images that were working beforehand.
Any suggestions would be much appreciated!