Jump to content

Add product images with php


agbandini

Recommended Posts

3 hours ago, agbandini said:

Hi,

Is there a way to set a product image with php without using neither the main prestashop libraries inclusion nor the api webservices?

someone can explain me the steps to follow to obtain this result?

is there an example script?

thank you

At first sight you just need to insert records into database and generate files in the correct folders. You need to know IDs. And remember to generate all the sizes :D

Edited by joseantgv (see edit history)
Link to comment
Share on other sites

53 minutes ago, joseantgv said:

At first sight you just need to insert records into database and generate files in the correct folders. You need to know IDs. And remember to generate all the sizes :D

Hi,

no problem for db and sizes....but regarding the folders, there are rules to define the target folder inside the main "img" dir?

 

Link to comment
Share on other sites

wow....😅 it's a very hard folder organization expecially if you want to cerate a script by zero.

in case of I would to use the ps libraries to create product and images, I'm obliged to create my script file in the ps root dir, I can not require configh.inc and init from other positions (exampl another vhost), it is true (if you know)?

Link to comment
Share on other sites

1 hour ago, agbandini said:

wow....😅 it's a very hard folder organization expecially if you want to cerate a script by zero.

in case of I would to use the ps libraries to create product and images, I'm obliged to create my script file in the ps root dir, I can not require configh.inc and init from other positions (exampl another vhost), it is true (if you know)?

You just need to include these files. If you are able to include them from other location...

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...