Between row 735 and 778 in my order.php:
Code:
// if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
if ($stock_left <= 0) {
// only set status to off when not displaying sold out
if (SHOW_PRODUCTS_SOLD_OUT == '0') {
$db->Execute("update " . TABLE_PRODUCTS . " set products_status = 0 where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
}
}
// for low stock email
if ( $stock_left <= STOCK_REORDER_LEVEL ) {
// WebMakers.com Added: add to low stock email
$this->email_low_stock .= 'ID# ' . zen_get_prid($this->products[$i]['id']) . ', ' . $this->products[$i]['model'] . ', ' . $this->products[$i]['name'] . ', ' . 'Stock: ' . $stock_left . "\n\n";
// kuroi: trigger and details for attribute low stock email
} elseif ($attribute_stock_left <= STOCK_REORDER_LEVEL) {
$this->email_low_stock .= 'ID# ' . zen_get_prid($this->products[$i]['id']) . ', ' . $this->products[$i]['model'] . ', ' . $this->products[$i]['name'] . ', ';
foreach($this->products[$i]['attributes'] as $attributes){
$this->email_low_stock .= $attributes['option'] . ': ' . $attributes['value'] . ', ';
}
$this->email_low_stock .= 'Stock: ' . $attribute_stock_left . "\n\n";
}
}
}
// Update products_ordered (for bestsellers list)
// $db->Execute("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . zen_get_prid($order->products[$i]['id']) . "'");
$db->Execute("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%f', $this->products[$i]['qty']) . " where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
$zco_notifier->notify('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_END');
$sql_data_array = array('orders_id' => $zf_insert_id,
'products_id' => zen_get_prid($this->products[$i]['id']),
'products_model' => $this->products[$i]['model'],
'products_name' => $this->products[$i]['name'],
'products_price' => $this->products[$i]['price'],
'final_price' => $this->products[$i]['final_price'],
'onetime_charges' => $this->products[$i]['onetime_charges'],
'products_tax' => $this->products[$i]['tax'],
'products_quantity' => $this->products[$i]['qty'],
'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
'product_is_free' => $this->products[$i]['product_is_free'],
'products_discount_type' => $this->products[$i]['products_discount_type'],
'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
'products_prid' => $this->products[$i]['id']);
zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
I hope it's helpfull...
/Typhoon
Bookmarks