Jump to content

(SOLUCIONADO) Ayuda con 12 errores, por favor


SERGIO_RGH

Recommended Posts

Al actualizar a la version 1.6.1 se me desactivaron los descuentos de la tienda, no funciona ni los especificos ni lo de volumen de compra. he activado el DEV y estes son los errores que se muestran

 

ERROR 1

Key 'id_product_2' doesn't exist in table 'RGH_specific_price'

SELECT *, ( IF (`id_group` = 3, 2, 0) +  IF (`id_country` = 6, 4, 0) +  IF (`id_currency` = 1, 8, 0) +  IF (`id_shop` = 1, 16, 0) +  IF (`id_customer` = 7, 32, 0)) AS `score`
				FROM `RGH_specific_price` USE INDEX (id_product_2)
				WHERE `id_product` IN (0, 11130)
				AND `id_product_attribute` IN (0, 78515)
				AND `id_shop` IN (0, 1)
				AND `id_currency` IN (0, 1)
				AND `id_country` IN (0, 6)
				AND `id_group` IN (0, 3)
				AND `id_customer` IN (0, 7)
				AND
				(
					(`from` = '0000-00-00 00:00:00' OR '2015-07-16 10:04:00' >= `from`)
					AND
					(`to` = '0000-00-00 00:00:00' OR '2015-07-16 10:04:00' <= `to`)
				)
				AND id_cart IN (0, 0)
				AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC LIMIT 1

ERROR 2

at line 765 in file classes/db/Db.php

760. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
761. 		}
762. 		elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
763. 		{
764. 			if ($sql)
765. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
766. 
767. 			throw new PrestaShopDatabaseException($this->getMsgError());
768. 		}
769. 	}
770. 

(MARCADO EN ROJO throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>') ;)

 

ERROR 3

 

  • DbCore->displayError - [line 418 - classes/db/Db.php] - [1 Arguments]
    413.             if ($this->connect())
    414.                 $this->result = $this->_query($sql);
    415.         }
    416.
    417.         if (_PS_DEBUG_SQL_)
    418.             $this->displayError($sql);
    419.
    420.         return $this->result;
    421.     }
    422.
    423.     /**
ERROR 4
664. 				$this->last_cached = true;
665. 				return $result;
666. 			}
667. 		}
668. 
669. 		$this->result = $this->query($sql);
670. 		if (!$this->result)
671. 			$result = false;
672. 		else
673. 			$result = $this->nextRow($this->result);
674.

ERROR 5

DbCore->getRow - [line 236 - classes/SpecificPrice.php] - [1 Arguments]

231. 				AND IF(`from_quantity` > 1, `from_quantity`, 0) <= ';
232. 
233. 			$query .= (Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION') || !$id_cart || !$real_quantity) ? (int)$quantity : max(1, (int)$real_quantity);
234. 			$query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC';
235. 
236. 			SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
237. 
238. 		}
239. 		return SpecificPrice::$_specificPriceCache[$key];
240. 	}
241.

ERROR 6

SpecificPriceCore::getSpecificPrice - [line 2808 - classes/Product.php] - [10 Arguments]

2803. 			$quantity,
2804. 			$id_product_attribute,
2805. 			$id_customer,
2806. 			$id_cart,
2807. 			$real_quantity
2808. 		);
2809. 
2810. 		if (isset(self::$_prices[$cache_id]))
2811. 			return self::$_prices[$cache_id];
2812. 
2813. 		// fetch price & attribute price

ERROR 7

ProductCore::priceCalculation - [line 2738 - classes/Product.php] - [20 Arguments]

2733. 			$use_group_reduction,
2734. 			$id_customer,
2735. 			$use_customer_price,
2736. 			$id_cart,
2737. 			$cart_quantity
2738. 		);
2739. 
2740. 		return $return;
2741. 	}
2742. 
2743. 	/**

ERROR 8 

ProductCore::getPriceStatic - [line 498 - classes/Product.php] - [13 Arguments]

493. 			$this->new = $this->isNew();
494. 
495. 			// Keep base price
496. 			$this->base_price = $this->price;
497. 
498. 			$this->price = Product::getPriceStatic((int)$this->id, false, null, 6, null, false, true, 1, false, null, null, null, $this->specificPrice);
499. 			$this->unit_price = ($this->unit_price_ratio != 0  ? $this->price / $this->unit_price_ratio : 0);
500. 			if ($this->id)
501. 				$this->tags = Tag::getProductTags((int)$this->id);
502. 
503. 			$this->loadStockData();

ERROR 9

ProductCore->__construct - [line 84 - controllers/front/ProductController.php] - [4 Arguments]

79. 	public function init()
80. 	{
81. 		parent::init();
82. 
83. 		if ($id_product = (int)Tools::getValue('id_product'))
84. 			$this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id);
85. 
86. 		if (!Validate::isLoadedObject($this->product))
87. 		{
88. 			header('HTTP/1.1 404 Not Found');
89. 			header('Status: 404 Not Found');

ERROR 10

ProductControllerCore->init - [line 163 - classes/controller/Controller.php]

158. 	/**
159. 	 * Starts the controller process (this method should not be overridden!)
160. 	 */
161. 	public function run()
162. 	{
163. 		$this->init();
164. 		if ($this->checkAccess())
165. 		{
166. 			// setMedia MUST be called before postProcess
167. 			if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
168. 				$this->setMedia();

ERROR 11

ControllerCore->run - [line 373 - classes/Dispatcher.php]

368. 			// Execute hook dispatcher
369. 			if (isset($params_hook_action_dispatcher))
370. 				Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
371. 
372. 			// Running controller
373. 			$controller->run();
374. 		}
375. 		catch (PrestaShopException $e)
376. 		{
377. 			$e->displayMessage();
378. 		}

ERROR 12

DispatcherCore->dispatch - [line 28 - index.php

23. *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
24. *  International Registered Trademark & Property of PrestaShop SA
25. */
26. 
27. require(dirname(__FILE__).'/config/config.inc.php');
28. Dispatcher::getInstance()->dispatch();

Ya se que son muchos errores, así que si alguien puede ayudar aunque sol osea en uno se lo agradeceria.

 

Gracias

Un Saludo!

Edited by SERGIO_RGH (see edit history)
Link to comment
Share on other sites

Ejecuta esta query si no tienes el index:

 

ALTER TABLE RGH_specific_price
ADD UNIQUE KEY `id_product_2` (`id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`)
  • Like 1
Link to comment
Share on other sites

 

Ejecuta esta query si no tienes el index:

 

ALTER TABLE RGH_specific_price
ADD UNIQUE KEY `id_product_2` (`id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`)

 

Para ello hay que ir al MYSQL > tabla RGH_specific_price > SQL e insertar ese texto no?

 

Sale lo siguiente:

 

 

Error

consulta SQL:

 

ALTER TABLE RGH_specific_price

ADD UNIQUE KEY `id_product_2` (`id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`)

 

MySQL ha dicho: dot.gif

#1062 - Duplicate entry '8309-0-0-0-0-0-1-31475-1-0-0000-00-00 00:00:00-0000-00-00 00:00:' for key 'id_product_2' 

Link to comment
Share on other sites

 

 

Hola,

 

he pillado esa query de la instalación de PS 1.6.1.0, por lo que esas columnas deberían ser las correctas.

Para ello hay que ir al MYSQL > tabla RGH_specific_price > SQL e insertar ese texto no?

 

Sale lo siguiente:

 

 

Error

consulta SQL:

 

ALTER TABLE RGH_specific_price

ADD UNIQUE KEY `id_product_2` (`id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`)

 

MySQL ha dicho: dot.gif

#1062 - Duplicate entry '8309-0-0-0-0-0-1-31475-1-0-0000-00-00 00:00:00-0000-00-00 00:00:' for key 'id_product_2' 

 

Podrías borrar todas las reglas creadas?

Link to comment
Share on other sites

Hola,

 

he pillado esa query de la instalación de PS 1.6.1.0, por lo que esas columnas deberían ser las correctas.

 

Podrías borrar todas las reglas creadas?

Borrarlas las reglas por volumen de compra de back o las reglas del MYSQL

Link to comment
Share on other sites

Reglas del BO borradas, borre también 8 reglas de productos que tenían el descuento desde la ficha del producto. Voy al MYSQL > a la tabla specific_price >  SQL pongo el codigo que me habeis dicho y sale lo mismo... :(

Error
consulta SQL:


ALTER TABLE RGH_specific_price
ADD UNIQUE KEY `id_product_2` (`id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`)
MySQL ha dicho: Documentación

#1062 - Duplicate entry '8309-0-0-0-0-0-1-31475-1-0-0000-00-00 00:00:00-0000-00-00 00:00:' for key 'id_product_2' 

Y si borro todo lo que sale en la tabla: RGH_specific_price ??(quedan aun 3 paginas con 25 filas)

Edited by SERGIO_RGH (see edit history)
Link to comment
Share on other sites

Adjunto capturas de la tabla RGH_specific_price no existe ningún producto con id 2

 

Lo de "id_product_2" es el nombre del índice, no quiere decir que haya un producto con ID 2.

 

Haz lo que te dijo en el último mensaje @Enrique Engblom

Link to comment
Share on other sites

El Query es darle a la pestaña SQL y pegar el codigo de joseantgv no?

 

 

Si es eso sigue saliendo el mismo mensaje: #1062 - Duplicate entry '8309-0-0-0-0-0-1-31475-1-0-0000-00-00 00:00:00-0000-00-00 00:00:' for key 'id_product_2' 

Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...