1052 - Column 'products_options_id' in field list is ambiguous
SELECT products_options_id, products_options_values_id FROM orders_products_attributes LEFT JOIN products_options ON products_options_name = products_options LEFT JOIN products_options_values ON products_options_values_name = products_options_values WHERE orders_products_id = '25'
[TEP STOP]
Appare sempre quando vado a cancellare un ordine con l'opzione restock (ripristina quantità)
Il codice in questione dovrebbe essere nel file:
admin\includes\functions\general.php
il codice è:
Codice: Seleziona tutto
// START FIXING BUG TAAJNY
//$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
$order_query = tep_db_query("select products_id, products_quantity, orders_products_id from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
while ($order = tep_db_fetch_array($order_query)) {
$options_query = tep_db_query("SELECT products_options_id, products_options_values_id FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " ON products_options_name = products_options LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " ON products_options_values_name = products_options_values WHERE orders_products_id = '" . (int)$order['orders_products_id'] . "'");
$option = tep_db_fetch_array($options_query);
tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_quantity = options_quantity + " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id']. "' AND options_id = '" . (int)$option['products_options_id'] . "' AND options_values_id = '" . $option['products_options_values_id'] ."'");
// END FIXING BUG TAAJNY