// When viewing an order, the stock_available is now properly displayed.

This commit is contained in:
bMancone
2012-04-23 08:15:23 +00:00
parent d3e064d753
commit c7be89d916
3 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -674,7 +674,7 @@ class AdminOrdersControllerCore extends AdminController
$cartrule->date_from = date('Y-m-d H:i:s', $now);
$cartrule->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */
$cartrule->active = 1;
// Calculate the amount of the discount
$products = $order->getProducts(false, $full_product_list, $full_quantity_list);
// Totals are stored in the order currency (or at least should be)
@@ -690,9 +690,9 @@ class AdminOrdersControllerCore extends AdminController
}
if (Tools::isSubmit('shippingBack'))
$total += $order->total_shipping;
$cartrule->reduction_amount = $total;
if (!$cartrule->add())
$this->errors[] = Tools::displayError('Cannot generate voucher');
else
@@ -1205,6 +1205,10 @@ class AdminOrdersControllerCore extends AdminController
$payment_methods[] = $module->displayName;
}
// products current stock (from stock_available)
foreach ($products as &$product)
$product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']);
// Smarty assign
$this->tpl_view_vars = array(
'order' => $order,