domenica 3 agosto 2014

php script for prestashop 1.6 categories

Categories auto upload script

After many times spent on the web looking for a simple way for upload the categories on the new release of prestashop 1.6.x.x, i have decided to create a php script by myself.
First of all the database schema is needed , and you can find here DATABASE SCHEMA .
Like showed by te schema the tablet used are:
  • ps_category
  • ps_category_lang
  • ps_category_shop 


Then you should create the script that follow the prestashop idea for the category, means  all the categories are subcategory of the root not only for the name but for ID too ,
Example: root id 1 nleft 1 nright 20
 cat1 id 2 nleft 1 nright 5
cat2 id 3 nleft 6 nright 7
this means that cat1 are subfolder of root and could have subcategory itself too, and cat2 is subfolder too but could not have subcategory.

When you have uploaded the category to ps_category don't forget to upload the textual part to ps_category_lang like the name of category.

I've created a script for upload the product by csv file too, but is a complete another story...
feel free to ask if i can help you,

Bye

Nessun commento:

Posta un commento