SQL to export categories and products:
select p.id_product, pl.name as product_name, pl.description as product_description, concat('http://', ifnull(conf.value,'example.com'), '/img/p/', p.id_product, '-' , pi.id_image, '.jpg') as product_image, p.id_category_default, cl.name as category_name, cl.description as category_description, concat('http://', ifnull(conf.value,'example.com'), '/img/c/', cl.id_category, '.jpg') as category_image from ps_product p left join ps_image pi on p.id_product = pi.id_product left join ps_product_lang pl on p.id_product = pl.id_product left join ps_category_lang cl on p.id_category_default = cl.id_category left join ps_configuration conf on conf.name = 'PS_SHOP_DOMAIN' group by p.id_product
SQL to export just categories:
select cl.id_category, cl2.name as parent_name, cl.name, cl.description, cl.link_rewrite, concat('http://', ifnull(conf.value,'example.com'), '/img/c/', c.id_category, '.jpg') as url_image, cl.id_lang from ps_category c inner join ps_category_lang cl on cl.id_category = c.id_category inner join ps_category_lang cl2 on cl2.id_category = c.id_parent and cl2.id_lang = cl.id_lang left join ps_configuration conf on conf.name = 'PS_SHOP_DOMAIN' order by cl.id_lang, c.level_depth
SQL to export just products:
select cl.id_product, cl.name, cl.description, concat('http://', ifnull(conf.value,'example.com'), '/img/p/', c.id_product, '-' , i.id_image, '.jpg') as url_image, cl.id_lang from ps_product c left join ps_image i on c.id_product = i.id_product left join ps_product_lang cl on cl.id_product = c.id_product left join ps_configuration conf on conf.name = 'PS_SHOP_DOMAIN' group by cl.id_product order by cl.id_lang
enjoy 😛
Thanks a lot, this is just was i needed!
Will you pls give the modified query that gives product name as well?
That first one should do it ( pl.name as product_name, )
This is the exactly one which i looked out from many times. Thanks a lot for this. Keep sharing as well.
Hi,
All of these queries returning an error in SQL manager in Prestashop 1.5.4.1
Any suggestion why?
Thank you for this useful information.
This is can be used for all Prestashop versions?
Hi!
I don’t know, why when i want to use the first or the third code, An error occur without any descriptions!
with this code:
http://nemops.com/prestashop-export-products/
Every thing is OK! But it hasn’t sufficient data that i want them!
can u help me?
Thanks a lot …
ok thank a lot i will try it and i see!
Thank YOU !
Hi
can you write a query to to export products combinations and the prices of combinations?
how to export in sql? have not option sql, csv, codegen …