-
Posts
14 -
Joined
-
Last visited
Contact Methods
Profile Information
-
Activity
Web development agency
Recent Profile Visitors
Prestashopconector's Achievements
Newbie (1/14)
2
Reputation
-
No asigna "nleft" y "nright" al crear una categoría
Prestashopconector replied to yera's topic in Informes de Bugs (errores)
Buenas tardes, El código a ejecutar es un procedimiento de mysql, si bien no hay que ser un dba experto, si que se tienen que tener ciertas nociones de sql y bases de datos para ejcutarlas como le paso al primer compañero que contesto a nuestra respuestas. Si los parent childs están bien creados (evitando así que entre en bucle infinito el proceso), insertaís ese código en el eidtor de procedimientos almacenados y os lo ejecutará sin problemas. Si lo hacéis desde una ventana de sql tendréis que poner el create procedure ComoSeLlame antes. Una vez creado este proceso acordaros que hay q ejecutarlo, o bien mediación de interface grafica con "ejecutar" o bien con sentencia sql call ComoSeLlame Si con esta información no se os ejecuta, googleear los errores e ir avanzando hasta que os funciones. Repito, no hay que ser experto.. pero es un fragmento de código de programación sql y hay que saberlo crear y ejecutar. Saludos y mucha suerte con ello.- 13 replies
-
- base de datos
- categorias
-
(and 2 more)
Tagged with:
-
Any attributes on your products ?? check ps_product_attribute and ps_product_attribute_shop tables and as tuk66 ps_specifc_price. if you are not using neither attributes and specific prices, truncate all listed tables above, including ps_product_attribute_combination or update price column in this table to 0. Hope it works.
-
No asigna "nleft" y "nright" al crear una categoría
Prestashopconector replied to yera's topic in Informes de Bugs (errores)
Hola Voignar, Estas haciendo un procecure ? En caso afrimativo deberías empezar con el BEGIN... En tu post hay además de un "1" pegado al BEGIN, UNA QUERY antes con el where statment sin terminar... SELECT * FROM `ps_category` WHERE 1BEGIN Esta sentencia no tiene sentido... Recuerdo que para la ejecución de esta rutina hay que tener unos niveles mínimos de lenguaje sql y de su sintaxis para mysql... así como conocer el uso de procedures, funciones y scripts... Si montas el proceso desde begin y lo ejecutas no tendrías porque tener problemas en su ejecución. Saludos y buena suerte- 13 replies
-
- base de datos
- categorias
-
(and 2 more)
Tagged with:
-
No asigna "nleft" y "nright" al crear una categoría
Prestashopconector replied to yera's topic in Informes de Bugs (errores)
Hola Patuky Estas recibiendo un error de "stack overflow". Habla con tu hosting para que te aumenten el tamaño de pila ya que no debes tener sufciente pila / memoria para ejecutar el proceso. Si te fijas en el código verás que este proceso se realiza medienate la creación de una tabla temporal en donde se hacen las operaciones y despuúes volcado de esta infromación a la tabla category. Además de crear el proceso, luego hay que ejecutarlo. Saludos- 13 replies
-
- base de datos
- categorias
-
(and 2 more)
Tagged with:
-
No asigna "nleft" y "nright" al crear una categoría
Prestashopconector replied to yera's topic in Informes de Bugs (errores)
Hola, Acabo de realizar el código para generarlo automáticamente por sql. He hecho unas modificaciones sobre un código de joomla para mossets trees y adaptarlo para prestashop. Código para Joomla: http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28291301.html Espero os sirva, cualquier cosa me pregutnais sin problemas, aunque el codigo a mi me funciona a la perfección. Saludos BEGIN DECLARE currentId, currentParentId CHAR(36); DECLARE currentLeft INT; DECLARE startId INT DEFAULT 1; # Determines the max size for MEMORY tables. SET max_heap_table_size = 1024 * 1024 * 512; START TRANSACTION; # Temporary MEMORY table to do all the heavy lifting in, # otherwise performance is simply abysmal. DROP TABLE IF EXISTS ps_category_tmp; CREATE TABLE `ps_category_tmp` ( `id_category` char(36) NOT NULL DEFAULT '', `id_parent` char(36) DEFAULT NULL, `nleft` int(11) unsigned DEFAULT NULL, `nright` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id_category`), INDEX USING HASH (`id_parent`), INDEX USING HASH (`nleft`), INDEX USING HASH (`nright`) ) ENGINE = MEMORY -- SELECT `id_category`, `id_parent`, `nleft`, `nright` FROM `health4_mt_cats`; select id_category, id_parent, nleft, nright from ps_category ; # Leveling the playing field. UPDATE `ps_category_tmp` SET `nleft` = NULL, `nright` = NULL; # Establishing starting numbers for all root elements. WHILE EXISTS (SELECT * FROM `ps_category_tmp` WHERE `id_parent` = 0 AND `nleft` IS NULL AND `nright` IS NULL LIMIT 1) DO UPDATE `ps_category_tmp` SET `nleft` = startId, `nright` = startId + 1 WHERE `id_parent` = 0 AND `nleft` IS NULL AND `nright` IS NULL LIMIT 1; SET startId = startId + 2; END WHILE; # Switching the indexes for the nleft/nright columns to B-Trees to speed up the next section, which uses range queries. DROP INDEX `nleft` ON `ps_category_tmp`; DROP INDEX `nright` ON `ps_category_tmp`; CREATE INDEX `nleft` USING BTREE ON `ps_category_tmp` (`nleft`); CREATE INDEX `nright` USING BTREE ON `ps_category_tmp` (`nright`); # Numbering all child elements WHILE EXISTS (SELECT * FROM `ps_category_tmp` WHERE `nleft` IS NULL LIMIT 1) DO # Picking an unprocessed element which has a processed parent. SELECT `ps_category_tmp`.`id_category` INTO currentId FROM `ps_category_tmp` INNER JOIN `ps_category_tmp` AS `parents` ON `ps_category_tmp`.`id_parent` = `parents`.`id_category` WHERE `ps_category_tmp`.`nleft` IS NULL AND `parents`.`nleft` IS NOT NULL LIMIT 1; # Finding the element's parent. SELECT `id_parent` INTO currentParentId FROM `ps_category_tmp` WHERE `id_category` = currentId; # Finding the parent's nleft value. SELECT `nleft` INTO currentLeft FROM `ps_category_tmp` WHERE `id_category` = currentParentId; # Shifting all elements to the right of the current element 2 to the right. UPDATE `ps_category_tmp` SET `nright` = `nright` + 2 WHERE `nright` > currentLeft; UPDATE `ps_category_tmp` SET `nleft` = `nleft` + 2 WHERE `nleft` > currentLeft; # Setting nleft and nright values for current element. UPDATE `ps_category_tmp` SET `nleft` = currentLeft + 1, `nright` = currentLeft + 2 WHERE `id_category` = currentId; END WHILE; UPDATE `ps_category`, `ps_category_tmp` SET `ps_category`.`nleft` = `ps_category_tmp`.`nleft`, `ps_category`.`nright` = `ps_category_tmp`.`nright` WHERE `ps_category`.`id_category` = `ps_category_tmp`.`id_category`; COMMIT; END- 13 replies
-
- 1
-
-
- base de datos
- categorias
-
(and 2 more)
Tagged with:
-
Have you also tried deleting the cache ??
-
Hi Chachits, Can you check what is the value on the advanced_stock_management column from the ps_product table for those products ? :-) in case this is enabled ps_product_atribute should be the responsible for showing the quantities.... For double check this, also you need to jion with the ps_product_attribute_combination table. product id from ps_product joined with ps_product_attribute and them joined with the ps_product_attribute_combination. Check this and if it make sence i will help you with the query to jion the 3 tables :-)
-
Maybe you have deleted by error root and home categories.... check that.
- 3 replies
-
- sql
- categories
-
(and 1 more)
Tagged with:
-
Hi, To update your stock using sql, just run 2 queries updating the value in the column quantity from the ps_product table and quantity column from the ps_stock_available table with a query like this: update ps_product set quantity = YOUR_STOCK_VALUE where id_product = X (you mention the ean13 field, so in that case: where ean13 = XXXXXXXXXXXXX ; update ps_stock_available set quantity = YOUR_STOCK_VALUE where id_product = X As you are using the ean13 value to update this tables, i figure up that you don't know your product_id taht is required to update the ps_stock_available table, son in that case join this table in the update statement with ps_product in this way: update ps_stock_available join ps_product on ps_stock_available.id_product = ps_product.id_product set ps_stock_available.quantity = YOUR_STOCK_VALUE where ps_product.ean13 = XXXXXXXXXXXXX Hope it helps you ! :-)
-
SQL script that copies "product name" into "product code"
Prestashopconector replied to SkyHiRider's topic in Core developers
product name is stored in ps_product_lang table with rest of text information, as description, shor description, name etc... and products id, price, quantity and other foreing keys refered to the product (categories etc) are stored in ps_product table so "product name" into "product reference" will be something like this: update ps_product p join ps_product_lang pla on p.id_product = pla.id_product set p.reference = pla.name if you are using multilanguage you have so many records in ps_product_lang as languages you have per each product, so the relation between ps_product and ps_product_lang is 1 to many, so if you have diferent names for each product language you will need to chouse one as the reference, because reference is unique per product... add a where statement to filter which language you gonna use as the default for the reference information -
Getting information from PrestaShop
Prestashopconector replied to Jimbola's topic in Core developers
Try to do something like this linking ps_orders, ps_customers and ps_order detail to get the product you wanna filter. select od.* , o.*, c.* from ps_order_detail od join ps_orders o on od.id_order = o.id_order join ps_customer c on o.id_customer = c.id_customer where od.product_id = ? YOu need to customize the select to get the fields you are interested in, and of course change the question mark with the id of the product you are going to filter with. -
Módulo para zona privada de distribuidores
Prestashopconector replied to amuybuenprecio's topic in Discusión general
Nosotros desarrollamos un scrip para uno de nuestros clientes que necesitaba vender por proveedores y zonas, y lo hicimos creando grupos de clientes con reglas de precios determiandas para cada uno de estos grupos y controlando su visibilidad. Por si te interesa la información esta linkada entre grupo de clientes o clientes y productos en la tabla ps_specific_price -
SQL script that copies "product name" into "product code"
Prestashopconector replied to SkyHiRider's topic in Core developers
if its the same product and you wanna copy data from a field to another you can do a simple update script on the same table record, imagine your product id = 1 and the field "a" is the field you wanna copy into field "b", do this, update ps_product set b=a where product_id = 1 if you want to do for all the products in the table avoid the where statement. Is this what do you want to do ??