xapa Posted June 6, 2019 Share Posted June 6, 2019 (edited) Hi I'm trying to export all products from Prestashop 1.4 with all product tags associated to a product with no luck, I don't understand too much about mysql, I just need the product number and tags associated with it. Shop is in two languages. Can somebody please help me? Just got a list of the products with the same tag on all products and just one tag. Thanks in advance for your time My sql query is: SELECT p.id_product AS 'ID', pl.id_lang AS 'ID_LANG', p.active AS 'Active (0/1)', pl.name AS 'Name', tag.name AS 'TAG' FROM tag, product p INNER JOIN product_lang pl ON p.id_product = pl.id_product WHERE 1=1 and p.active = 1 GROUP BY p.id_product Edited June 6, 2019 by xapa (see edit history) Link to comment Share on other sites More sharing options...
xapa Posted June 6, 2019 Author Share Posted June 6, 2019 SOLVED. For anyone interested, tags from two languages are on the same row and for my needs it works. SELECT product.id_product, GROUP_CONCAT( DISTINCT(tag.name) SEPARATOR ' / ') AS tags FROM product LEFT JOIN product_tag ON(product.id_product = product_tag.id_product) LEFT JOIN tag ON(product_tag.id_tag = tag.id_tag) GROUP BY product.id_product Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now