Jump to content

Recommended Posts

Hola de nuevo he conseguido modificar la cantidad desde la base de datos directamente en la tabla product_attribute, ahora lo único que al modificarlo no lo veo que se modifique también en el backend de prestashop. Puede ser porque tiene que pasar un tiempo hasta que se actualice en la tienda también?

Link to comment
Share on other sites

 

Haz lo mismo en la tabla

product_attribute_shop

En esa tabla no tengo el campo cantidad solo tengo estos:

 

id_product----  id_product_attribute----  id_shop---- wholesale_price---- price ecotax---- weight---- unit_price_impact---- default_on---- minimal_quantity---- available_date

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

Ya esta solucionado por si alguien le sirve este script en php sobre la tabla stock_available:

$query = "select *,SUM(quantity) as suma from bps_stock_available where id_product_attribute!='0' group by id_product";
	$result = mysql_query($query) or die('Consulta fallida: ' . mysql_error());
					
			while($elemento= mysql_fetch_array($result)){
				$suma=$elemento['suma'];
				$id_product_uno=$elemento['id_product'];
			
				
				$consulta = "update bps_stock_available set quantity='$suma' where id_product_attribute='0' and id_product='$id_product_uno'";
				mysql_query( $consulta, $db );
			}

he dejado en la tabla product_attribute_shop quantity en 1 y me funciona igual no se si debería de cambiarlo a 10 o a la suma de las combinaciones.

Link to comment
Share on other sites

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