Jump to content

Importing products question


Recommended Posts

When importing prodcuts from a csv file where do the raw images need to be placed in the ftp (which folder), and how do i point to that folder on the csv, would it be for eg

/htdocs/img/p/image.jpg or mysite/img/p/image.jpg or would it be just pointing at /img/p

im thinking this way the files are there so they dont need to be cached

At the moment i am using a website address where the pictures are stored and this is causing prestashop to time out on me.

Hope i made sense

Thankyou in advance for your help

Link to comment
Share on other sites

I have spent a lot of time writing a tool that can import XML (and CSV) files. My challenge has been that the XML file contains more than 17000 items. I have observed and solved 3 problems:

# Just resizing the images takes way too long time. The server I use (and it’s not slow) can fetch (via http) and resize 1 image per second.
# It takes way too long time to import the products even if the images are dropped.
# The XML file only associates 5 categories to the products. That won’t do. I prefer max. 20 products in one category. I want sub-categories (and sub-sub) to be created automatically.

Send me a PM if you are interested.

/Kjeld

Link to comment
Share on other sites

  • 3 weeks later...
I have spent a lot of time writing a tool that can import XML (and CSV) files. My challenge has been that the XML file contains more than 17000 items. I have observed and solved 3 problems:

# Just resizing the images takes way too long time. The server I use (and it’s not slow) can fetch (via http) and resize 1 image per second.
# It takes way too long time to import the products even if the images are dropped.
# The XML file only associates 5 categories to the products. That won’t do. I prefer max. 20 products in one category. I want sub-categories (and sub-sub) to be created automatically.

Send me a PM if you are interested.

/Kjeld


Hi,

Can i get the details ?

Thanks,
Link to comment
Share on other sites

I realized that there were way too many database requests. Before importing I remove all products and categories. I don't use the functions in classes/Product.php etc. since they are too slow. Instead I add multiple products directly via SQL.

The fields are mapped in a way similar to the way it's done in the standard import function. I have tested my import tool on actual XML and CSV files I have received from sellers. My intention is to keep adding options and fixing the code as I receive new examples of XML/CSV files.

The pictures are not resized immediately. Instead I save the URL in the database. When a picture is requested the system checks if it has been resized and is available. If not, it is resized on the fly. Of course this increases the response time, but only the first time the picture is requested. On top of that, I have added a cronjob that resizes a lot of pictures at night.

/Kjeld

Link to comment
Share on other sites

  • 11 months later...
×
×
  • Create New...