Created
August 20, 2019 09:27
-
-
Save ircykk/9228c0e3d119b3032a1892c198a5f2ee to your computer and use it in GitHub Desktop.
Export PrestaShop products with seo URLs (including category)
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
# Export PrestaShop products with seo URLs (including category) | |
# id_lang = xxx, id_shop = yyy (default 1 if not multistore) | |
SELECT p.id_product, pl.name, CONCAT("https://example.com/", cl.link_rewrite, "/", p.id_product, "-", pl.link_rewrite, ".html") AS url, p.date_add, p.date_upd | |
FROM ps_product p | |
INNER JOIN ps_product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = 1 AND pl.id_shop = 1) | |
INNER JOIN ps_category_lang cl ON (p.id_category_default = cl.id_category AND cl.id_lang = 1 AND cl.id_shop = 1) | |
WHERE p.active = 1 | |
ORDER BY `p`.`id_product` DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment