// Fix freeshipping on backoffice Order
This commit is contained in:
@@ -693,7 +693,7 @@
|
||||
$('#carrier_recycled_package').attr('checked', true);
|
||||
else
|
||||
$('#carrier_recycled_package').removeAttr('checked');
|
||||
if (jsonSummary.free_shipping)
|
||||
if (jsonSummary.free_shipping == 1)
|
||||
$('#free_shipping').attr('checked', true);
|
||||
else
|
||||
$('#free_shipping').removeAttr('checked');
|
||||
|
||||
@@ -643,7 +643,16 @@ class AdminCartsControllerCore extends AdminController
|
||||
$message_content = '';
|
||||
if ($message = Message::getMessageByCartId((int)$this->context->cart->id))
|
||||
$message_content = $message['message'];
|
||||
|
||||
$cart_rules = $this->context->cart->getCartRules(CartRule::FILTER_ACTION_SHIPPING);
|
||||
|
||||
$free_shipping = false;
|
||||
if (count($cart_rules))
|
||||
foreach ($cart_rules as $cart_rule)
|
||||
if ($cart_rule['id_cart_rule'] == CartRule::getIdByCode('BO_ORDER_'.(int)$this->context->cart->id))
|
||||
{
|
||||
$free_shipping = true;
|
||||
break;
|
||||
}
|
||||
return array('summary' => $this->getCartSummary(),
|
||||
'delivery_option_list' => $this->getDeliveryOptionList(),
|
||||
'cart' => $this->context->cart,
|
||||
@@ -654,7 +663,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'order', false,
|
||||
(int)$this->context->cart->id_lang,
|
||||
'step=3&recover_cart='.$id_cart.'&token_cart='.md5(_COOKIE_KEY_.'recover_cart_'.$id_cart)),
|
||||
'free_shipping' => (bool)CartRule::getIdByCode('BO_ORDER_'.(int)$this->context->cart->id)
|
||||
'free_shipping' => (int)$free_shipping
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -521,8 +521,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
if ($customizationList)
|
||||
foreach ($customizationList as $key => $id_order_detail)
|
||||
{
|
||||
$full_product_list[$id_order_detail] = $id_order_detail;
|
||||
$full_quantity_list[$id_order_detail] += $customizationQtyList[$key];
|
||||
$full_product_list[(int)$id_order_detail] = $id_order_detail;
|
||||
$full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
|
||||
}
|
||||
|
||||
if ($productList || $customizationList)
|
||||
@@ -627,7 +627,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$order_detail = new OrderDetail((int)$id_order_detail);
|
||||
if (!$order->deleteProduct($order, $order_detail, $qtyCancelProduct))
|
||||
$this->errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$order_detail->product_name.'</span>';
|
||||
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => $id_order_detail));
|
||||
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail));
|
||||
}
|
||||
if (!count($this->errors) && $customizationList)
|
||||
foreach ($customizationList as $id_customization => $id_order_detail)
|
||||
|
||||
@@ -384,12 +384,15 @@ class BlockLink extends Module
|
||||
{
|
||||
$links = $this->getLinks();
|
||||
$languages = Language::getLanguages();
|
||||
$token = Tools::safeOutput(Tools::getValue('token'));
|
||||
if (!Validate::isCleanHtml($token))
|
||||
$token = '';
|
||||
if ($links)
|
||||
{
|
||||
$this->_html .= '
|
||||
<script type="text/javascript">
|
||||
var currentUrl = \''.addslashes(AdminController::$currentIndex.'&configure='.$this->name).'\';
|
||||
var token=\''.addslashes(Tools::getValue('token')).'\';
|
||||
var currentUrl = \''.Tools::safeOutput(AdminController::$currentIndex.'&configure='.$this->name).'\';
|
||||
var token=\''.$token.'\';
|
||||
var links = new Array();';
|
||||
foreach ($links as $link)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user