[-] BO : Load customer and cart in AdminOrderController init to fix a bug with CancelProduct
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10601 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -77,6 +77,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->shopLinkType = 'shop';
|
||||
$this->shopShareDatas = Shop::SHARE_ORDER;
|
||||
|
||||
// Save context (in order to apply cart rule)
|
||||
$order = new Order((int)Tools::getValue('id_order'));
|
||||
$this->context->cart = new Cart($order->id_cart);
|
||||
$this->context->customer = new Customer($order->id_customer);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -100,6 +105,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
{
|
||||
if ($this->display == 'view')
|
||||
{
|
||||
$order = new Order((int)Tools::getValue('id_order'));
|
||||
if ($order->hasBeenDelivered()) $type = $this->l('Return');
|
||||
elseif ($order->hasBeenPaid()) $type = $this->l('Refund');
|
||||
else $type = $this->l('Cancel');
|
||||
|
||||
$this->toolbar_btn['new'] = array(
|
||||
'short' => 'Create',
|
||||
'href' => '',
|
||||
@@ -109,7 +119,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->toolbar_btn['standard_refund'] = array(
|
||||
'short' => 'Create',
|
||||
'href' => '',
|
||||
'desc' => $this->l('Standard refund'),
|
||||
'desc' => $type.' '.$this->l('refund'),
|
||||
'class' => 'process-icon-new standard_refund'
|
||||
);
|
||||
$this->toolbar_btn['partial_refund'] = array(
|
||||
|
||||
Reference in New Issue
Block a user