diff --git a/modules/ant_logistic/AdminAntLogistic.php b/modules/ant_logistic/AdminAntLogistic.php index c305b100..62652597 100644 --- a/modules/ant_logistic/AdminAntLogistic.php +++ b/modules/ant_logistic/AdminAntLogistic.php @@ -21,6 +21,8 @@ class AdminAntLogistic extends AdminTab { public $_html = ''; + public $submitShipAfter = false; + private function stripaccents($str) { return preg_replace( @@ -332,8 +334,8 @@ class AdminAntLogistic extends AdminTab $render = $logistics_carriers['mondialrelay']->renderLabel(new Order($id_order), $weight, $result[1]); $this->printLabel($render,true); } elseif(Tools::isSubmit('submitShip') && ($id_order = (int) Tools::getValue('id_order'))) { - $order = new Order((int) $id_order); - + + $order = new Order((int) $id_order); $to_ship = array(); foreach(Db::getInstance()->ExecuteS(' SELECT d.`id_order_detail`, SUM(d.`product_quantity`) AS `product_quantity`, SUM(d.`product_quantity_refunded`) AS `product_quantity_refunded`, SUM(d.`product_quantity_return`) AS `product_quantity_return`, SUM(w.`quantity`) AS `quantity_sent` @@ -426,6 +428,8 @@ class AdminAntLogistic extends AdminTab } else { $this->_html .= '

'.$this->l('Please enter a weight and select at least one product').'


'; } + + $this->submitShipAfter = true; } } elseif(Tools::isSubmit('submitMod') && ($id_order = (int) Tools::getValue('id_order'))) { $product_ids = Tools::getValue('product_ids'); @@ -472,7 +476,7 @@ class AdminAntLogistic extends AdminTab public function display() { global $cookie, $logistics_carriers; - + $unavailable_carriers = array(); foreach($logistics_carriers as $name => $class) { @@ -787,14 +791,25 @@ class AdminAntLogistic extends AdminTab } } }); - } - + }'; + + if ($this->submitShipAfter && Tools::getIsset('id_order')) { + $helperForm->_js .= ' + $(function() { + $("#manualinput").val('.Tools::getValue('id_order').'); + $("#barcodeinput").val(""); + loadOrder(null, true); + }); + '; + } + + $helperForm->_js .= ' '; - $this->_html.=' + $helperForm->_js .='