SergioE Posted August 18, 2016 Share Posted August 18, 2016 (edited) Buenas, alguien sabe que maneras hay para sacar todas las url de los productos en una pagina web? He mirado para sacarlas mediante una consulta SQL y luego concatenarlo en Excel pero no se que SELECT tengo que hacer exactamente, este no me sale: SELECT DISTINCT p.reference, CONCAT(‘http://www.tudominio.com/’,cl.link_rewrite,’/’,p.id_product,’-’,pl.link_rewrite, ‘.html’) as url FROM ps_product p WHERE p.active = 1 INNER JOIN ps_product_lang pl USING (id_product) INNER JOIN ps_category_product cp USING (id_product) INNER JOIN ps_category_lang cl USING (id_category) O algun otro programa que te permita extraer las URL. Gracias Edited August 19, 2016 by SergioE (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted August 18, 2016 Share Posted August 18, 2016 Otra vez ? https://www.prestashop.com/forums/topic/501702-obtener-urls-amigables-solucionado/ Link to comment Share on other sites More sharing options...
SergioE Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) Ostras, no lo encontraba. Disculpas. Edited August 18, 2016 by SergioE (see edit history) Link to comment Share on other sites More sharing options...
SergioE Posted August 18, 2016 Author Share Posted August 18, 2016 Aprovecho para decir, antes de poner solucionado, como hago para sacar el EAN tambien? Saludos Link to comment Share on other sites More sharing options...
ventura Posted August 18, 2016 Share Posted August 18, 2016 Ostras, no lo encontraba. Disculpas. Nada, no te preocupes Aprovecho para decir, antes de poner solucionado, como hago para sacar el EAN tambien? Saludos añade entre comas p.ean13 Link to comment Share on other sites More sharing options...
SergioE Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) Asi no me funciona, como seria?. Gracias SELECT CONCAT( 'http://midominio.com/', cl.`link_rewrite` , '/', pl.`link_rewrite` , '-', p.`id_product` , '-', 'p.ean13' '.html' ) AS ProductURL FROM `ps_product` p LEFT JOIN `ps_product_lang` pl ON pl.`id_product` = p.`id_product` LEFT JOIN `ps_category_lang` cl ON cl.`id_category` = p.`id_category_default` GROUP BY p.`id_product` Edited August 18, 2016 by SergioE (see edit history) Link to comment Share on other sites More sharing options...
SergioE Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) Listo, pero he visto que cuando el producto no tiene EAN el guion lo pone igual, como le digo que cuando no haya EAN no aparezca el guion "-"? Gracias SELECT CONCAT( 'http://www.midominio.es/', 'p-', p.`id_product` , '-', pl.`link_rewrite`, '-', p. `ean13` , '.html' ) AS ProductURL FROM `ps_product` p LEFT JOIN `ps_product_lang` pl ON pl.`id_product` = p.`id_product` LEFT JOIN `ps_category_lang` cl ON cl.`id_category` = p.`id_category_default` WHERE p.`active` = 1 GROUP BY p.`id_product` Edited August 18, 2016 by SergioE (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted August 19, 2016 Share Posted August 19, 2016 Si los valores que tienes registrados para el ean13 en la base de datos son valor vacio ( que no es null ó 0) algo asi te deberia de valer SELECT CONCAT( 'http://midominio.com/', cl.`link_rewrite` , '/', pl.`link_rewrite` , '-', p.`id_product` , IF( p.`ean13` != '', CONCAT( '-', p.`ean13` ) , '' ) , '.html' ) AS fullname FROM `ps_product` p LEFT JOIN `ps_product_lang` pl ON pl.`id_product` = p.`id_product` LEFT JOIN `ps_category_lang` cl ON cl.`id_category` = p.`id_category_default` WHERE p.`active` =1 GROUP BY p.`id_product` LIMIT 0 , 30 Link to comment Share on other sites More sharing options...
SergioE Posted August 19, 2016 Author Share Posted August 19, 2016 Se agradece, lo había echo al final reemplazando en excel los que salian con "-". Gracias Link to comment Share on other sites More sharing options...
Recommended Posts