header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Location: ../"); exit; } if (isset($idcS) && $idcS != 0) { $idc = $idcS; } else { $idc = Tools::getValue('idc') ? Tools::getValue('idc') : 0; } $server = $catalog->getInfoEco('ECO_URL_COM'); if ($catalog->tabConfig['IMPORT_AUTO'] == 1 || isset($idcS) && $idcS != 0) { $commande = $catalog->getOrders($idc); foreach ($commande as $com) { $resu = '<gen>'; $reqExp = array(); $TotCom = Db::getInstance()->getRow('SELECT SUM(`product_quantity`) AS SPQ, `tax_rate`, SUM(`product_price`) AS SPP, SUM(`product_quantity`*`product_price`) AS STT FROM `' . _DB_PREFIX_ . 'order_detail` od LEFT JOIN `' . _DB_PREFIX_ . 'ec_ecopresto_catalog_attribute` ca ON (od.`product_supplier_reference` = ca.`reference_attribute`) LEFT JOIN `' . _DB_PREFIX_ . 'ec_ecopresto_catalog` c ON (od.`product_supplier_reference` = c.`reference`) WHERE `id_order`=' . (int) $com['id_order'] . ' GROUP BY od.`product_supplier_reference`'); $ComRef = Db::getInstance()->ExecuteS('SELECT `product_quantity`, `product_id`, `tax_rate`, `product_price`, `id_order`, `product_supplier_reference` FROM `' . _DB_PREFIX_ . 'order_detail` od LEFT JOIN `' . _DB_PREFIX_ . 'ec_ecopresto_catalog_attribute` ca ON (od.`product_supplier_reference` = ca.`reference_attribute`) LEFT JOIN `' . _DB_PREFIX_ . 'ec_ecopresto_catalog` c ON (od.`product_supplier_reference` = c.`reference`) WHERE `id_order`=' . (int) $com['id_order'] . ' GROUP BY od.`product_supplier_reference`');