Last active
December 20, 2015 19:28
-
-
Save selinerdominik/6183236 to your computer and use it in GitHub Desktop.
Get All Prestashop product_attribute combinations with their ean13 code and supplier_reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ppl.name, group_concat(al.name SEPARATOR ',') as attributes, pa.ean13, pa.supplier_reference | |
FROM ps_product AS pp, ps_product_lang AS ppl, ps_attribute_lang AS al, ps_product_attribute AS pa, ps_product_attribute_combination AS pac | |
WHERE pp.id_product = ppl.id_product | |
AND pp.id_product = pa.id_product | |
AND pa.id_product_attribute = pac.id_product_attribute | |
AND pac.id_attribute = al.id_attribute | |
AND ppl.id_lang =4 | |
AND al.id_lang =4 | |
AND id_supplier =5 | |
GROUP BY pa.id_product_attribute | |
ORDER BY ppl.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ma.name, ppl.name, group_concat( al.name | |
SEPARATOR ',' ) AS attributes, pa.ean13 | |
FROM ps_product AS pp, ps_product_lang AS ppl, ps_attribute_lang AS al, ps_product_attribute AS pa, ps_product_attribute_combination AS pac, ps_manufacturer AS ma | |
WHERE pp.id_product = ppl.id_product | |
AND pp.id_manufacturer = ma.id_manufacturer | |
AND pp.id_product = pa.id_product | |
AND pa.id_product_attribute = pac.id_product_attribute | |
AND pac.id_attribute = al.id_attribute | |
AND ppl.id_lang =4 | |
AND al.id_lang =4 | |
AND id_supplier =5 | |
GROUP BY pa.id_product_attribute | |
ORDER BY ma.name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment