Jump to content

SOLVED: Export products with product_tag from PS 1.4


xapa
 Share

Recommended Posts

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 by xapa (see edit history)

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More