Merge branch 'ticket-14485-philea_2' into develop

This commit is contained in:
Marion Muszynski 2017-11-13 13:00:42 +01:00
commit ae6cec83f0

View File

@ -227,24 +227,40 @@ if(($id_order = (int) Tools::getValue('id_order'))
$link = new Link(2); $link = new Link(2);
$products = array(); $products = array();
foreach($order->getProductsDetail() as $p) { foreach($order->getProductsDetail() as $p) {
$p['product_quantity_sent'] = (int) Db::getInstance()->getValue(' $p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
SELECT IFNULL(SUM(`quantity`), 0) AS `total` SELECT IFNULL(SUM(`quantity`), 0)
FROM `'._DB_PREFIX_.'lapostews` FROM `'._DB_PREFIX_.'lapostews`
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].' WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
') + (int) Db::getInstance()->getValue(' ');
SELECT IFNULL(SUM(`quantity`), 0) AS `total` $p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
SELECT IFNULL(SUM(`quantity`), 0)
FROM `'._DB_PREFIX_.'exapaqws` FROM `'._DB_PREFIX_.'exapaqws`
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].' WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
'); ');
/** /**
* @Override MondialRelay * @Override MondialRelay
*/ */
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue(' $p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
SELECT IFNULL(SUM(`quantity`), 0) AS `total` SELECT IFNULL(SUM(`quantity`), 0)
FROM `'._DB_PREFIX_.'mondialrelay_parcel` FROM `'._DB_PREFIX_.'mondialrelay_parcel`
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . ' WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
'); ');
/**
* @Override Philea
*/
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
SELECT IFNULL(SUM(`quantity`), 0)
FROM `'._DB_PREFIX_.'philea_parcel`
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
');
/**
* @Override Dropshipping
*/
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
SELECT IFNULL(SUM(`quantity`), 0)
FROM `'._DB_PREFIX_.'ant_dropshipping_parcel`
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
');
$p['id_image'] = 0; $p['id_image'] = 0;