Jump to content

In what table goes the category image


Recommended Posts

Hello,

I am developing a program to insert products, categories and images.

But i can't find where to add the image for the category.

When i insert a new category I have used the tables:

ps_category

ps_category_lang

ps_category_group

 

And after the product is inserted, the table ps_category_product is also inserted.

 

So, where or how does prestashop saves the cat image.. ?

 

Thanks!

Link to comment
Share on other sites

Ah yeah. I see. Images goes to img/c/xx-home.jpg and so on. Unlike the product images, these are not stored in the DB.

But 1 little other question:

In the folder img/p where some folders 1, 2, 3, 4 and in there are also some folders. What do they mean?

Link to comment
Share on other sites

Each image is given an id auto incremented in images table as you add an image to a product.

 

In the old image system that id is used as part of the image name along with the product's id it belongs to and the image is placed in /img/p/ directory. Multiple copies of the image is created to cater for the types you specify in the back office and that information is also appended to the image name. So the 15th image you add to prestashop will have the names productid-15-typea.jpg, productid-15-typeb.jpg...

 

The new image system uses a slightly different naming and location convention. The image base directory for product images is still /img/p/ directory. The type info is still appended to image names. Product id is not used and image id is split into directory names so e.g. 132nd image you add to PrestaShop will be used to create image types for various purposes and they have will have the names 132-typea.jpg, 132-typeb.jpg... and will be placed in /img/p/1/3/2/ directory. The image 132.jpg in the same directory is the image from which all other types created , e.g. when you regenerate images.

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

I made a fresh install of prestashop 1.5.6.1 and imported products and categories through the the database PhPmyadmin. 

For Hours i had missed out that images have references in the database till i saw this post of the  PS-IMAGE

Imported them and worked perfectly.

 

Now i have afresh install with old products in Fresh environment from 1.4.x straight to 1.5.6.1

 

thank you

 

Julius - Uganda 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...