Wouter85 Posted January 20, 2013 Share Posted January 20, 2013 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! Link to comment Share on other sites More sharing options...
PascalVG Posted January 28, 2013 Share Posted January 28, 2013 Looks like a text format problem, like imported as UTF8_general_ci, ASCII_bin, etc (How do they call that, 'collation' or so??) Seems there is some 'hidden byte' behind your digits that make prestashop believe there is a need to add a slash there. Anyone more on importing format needed? Maybe first check on current prestashop database values, and see if you import in the same format. My 2 cents, Pascal Link to comment Share on other sites More sharing options...
PhiLho Posted January 28, 2013 Share Posted January 28, 2013 I have seen somebody mentioning that now (1.5.xx) PrestaShop avoids putting thousands of image files in the same directory, for performance reasons. That implies making a set of sub-directories to split the distribution of these images. Perhaps that's what you see... It would be interesting to see where this is done, to check the algorithm, and see if there is a workaround (like adding a letter prefix or something). Link to comment Share on other sites More sharing options...
Wouter85 Posted January 29, 2013 Author Share Posted January 29, 2013 Thanks for the suggestions, once I'm any wiser I'll post back 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