Last active
February 12, 2017 19:39
-
-
Save oldlastman/cba320f9fc6f5437e25f3cc7d8d754d2 to your computer and use it in GitHub Desktop.
Consultas sql útiles en prestashop
This file contains hidden or 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
UPDATE `TUbaseDEdatos`.`ps_delivery` SET `price` = (`ps_delivery`.`price` * incremento) WHERE `ps_delivery`.`id_carrier` = IDdelCarrierAcambiar; | |
Se incrementa todas las tarifas de un carrier concreto por un porcentaje dado | |
en donde | |
- TUbaseDEdatos , es el nombre de tu base de datos | |
- incremento es el porcentaje que se ha de ha deincrementar en el formato (100+porcentaje incremento )/100 , ejemplo (100+5)/100 = 1.05 | |
- IDdelCarrierAcambiar = buscar en el front o tabla de carriers el id del carrier que se desea cambiar |
This file contains hidden or 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
En cada archivo se muestra y comenta una consulta | |
del siguente listado: | |
- Quitar usuario del newsletter | |
- Actualizar las tarifas de un carrier porcentaje incremento | |
- Modificar friendly url de productos para incluir categoría |
This file contains hidden or 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
Se modifica la url amigable actual añadiendo la categoría principal del producto, ejemplo: | |
tu producto - inicio | |
update ps_product_lang a | |
JOIN `ps_product_shop` sa ON ( a.`id_product` = sa.`id_product` ) | |
set a.link_rewrite = CONCAT( | |
a.link_rewrite,"-",( | |
select ps_category_lang.link_rewrite from ps_category_lang where sa.id_category_default=ps_category_lang.id_category and a.id_lang=ps_category_lang.id_lang)) | |
WHERE (sa.`id_category_default` between catIDx and CatIDy) | |
En donde | |
- catIDx id de categoría del rango inicio | |
- catIDy id de categoría del rango final |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment