问题
I am looking for sql or php script which shows how to insert integrated data represents product with its attributes, images etc. to PrestaShop database. Does anyone know steps of this process - I mean name of tables and columns I need to fill.
回答1:
Read the source!! You have access to every classes, so just take a look at Product.php
and ObjectModel.php
and you will have every infos you need about the fields and the tables.
If your goal is to insert products, you don't need to write any sql queries. I would recommend to use the methods provided to avoid any errors.
回答2:
I'm not recommend use the ObjectModel (Prestashop Classes), this is too slow for big imports (+10000 products with categories and features), SQL inserts is the fastest method, but this is not easy task, you need fill a lot of tables:
- ps_product
- ps_product_lang
- ps_product_shop
- ps_stock_available
- ps_category_product
- ps_image
- ps_product_download
Luck!
来源:https://stackoverflow.com/questions/16068141/prestashop-insert-products-script