// Problem with product return

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11566 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-12-22 09:39:44 +00:00
parent da1326a34d
commit cc7584e340
4 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -474,6 +474,7 @@ class AdminOrdersControllerCore extends AdminController
}
// Delete product
$orderDetail = new OrderDetail((int)($id_order_detail));
if (!$order->deleteProduct($order, $orderDetail, $qtyCancelProduct))
$this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>';
Hook::exec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail));
@@ -512,7 +513,8 @@ class AdminOrdersControllerCore extends AdminController
// Generate voucher
if (isset($_POST['generateDiscount']) AND !sizeof($this->_errors))
{
if (!$voucher = Discount::createOrderDiscount($order, $full_product_list, $full_quantity_list, $this->l('Credit Slip concerning the order #'), isset($_POST['shippingBack'])))
// @todo generate a voucher using cartrules
if (true || !$voucher = Discount::createOrderDiscount($order, $full_product_list, $full_quantity_list, $this->l('Credit Slip concerning the order #'), isset($_POST['shippingBack'])))
$this->_errors[] = Tools::displayError('Cannot generate voucher');
else
{