Reload ajax page after submit
This commit is contained in:
parent
f7a4656e9d
commit
2a1c162040
@ -21,6 +21,8 @@ class AdminAntLogistic extends AdminTab
|
|||||||
{
|
{
|
||||||
public $_html = '';
|
public $_html = '';
|
||||||
|
|
||||||
|
public $submitShipAfter = false;
|
||||||
|
|
||||||
private function stripaccents($str)
|
private function stripaccents($str)
|
||||||
{
|
{
|
||||||
return preg_replace(
|
return preg_replace(
|
||||||
@ -332,8 +334,8 @@ class AdminAntLogistic extends AdminTab
|
|||||||
$render = $logistics_carriers['mondialrelay']->renderLabel(new Order($id_order), $weight, $result[1]);
|
$render = $logistics_carriers['mondialrelay']->renderLabel(new Order($id_order), $weight, $result[1]);
|
||||||
$this->printLabel($render,true);
|
$this->printLabel($render,true);
|
||||||
} elseif(Tools::isSubmit('submitShip') && ($id_order = (int) Tools::getValue('id_order'))) {
|
} 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();
|
$to_ship = array();
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
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`
|
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 {
|
} else {
|
||||||
$this->_html .= '<p class="error">'.$this->l('Please enter a weight and select at least one product').'</p><br />';
|
$this->_html .= '<p class="error">'.$this->l('Please enter a weight and select at least one product').'</p><br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->submitShipAfter = true;
|
||||||
}
|
}
|
||||||
} elseif(Tools::isSubmit('submitMod') && ($id_order = (int) Tools::getValue('id_order'))) {
|
} elseif(Tools::isSubmit('submitMod') && ($id_order = (int) Tools::getValue('id_order'))) {
|
||||||
$product_ids = Tools::getValue('product_ids');
|
$product_ids = Tools::getValue('product_ids');
|
||||||
@ -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);
|
||||||
|
});
|
||||||
|
';
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
$helperForm->_js .= '</script>
|
||||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.hotkeys.js"></script>
|
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.hotkeys.js"></script>
|
||||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.multiselect.min.js"></script>
|
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.multiselect.min.js"></script>
|
||||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.multiselect.filter.min.js"></script>
|
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/libs/jquery.multiselect.filter.min.js"></script>
|
||||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/script.js?v=1"></script>';
|
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/ant_logistic/script.js?v=1"></script>';
|
||||||
|
|
||||||
$this->_html.='
|
$helperForm->_js .='
|
||||||
<div class="modal" id="confirm" tabindex="-1" role="dialog">
|
<div class="modal" id="confirm" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
Loading…
Reference in New Issue
Block a user