isLoggedBack() && $cart = Tools::getValue('id_cart')) { $address = Db::getInstance()->getRow(' SELECT s.*, m.*, r.`narel` FROM `'._DB_PREFIX_.'mr_selected` s INNER JOIN `'._DB_PREFIX_.'mr_method` m ON m.`id_mr_method` = s.`id_method` LEFT JOIN `'._DB_PREFIX_.'mondialrelay_relais` r ON SUBSTRING(s.`MR_Selected_Num`, 2) = r.`direction` AND s.`MR_Selected_Pays` = r.`prpay` WHERE `id_cart` = '.pSQL(intval(Tools::getValue('id_cart'))).' '); if($address['MR_Selected_Pays'] == 'F' || $address['MR_Selected_Pays'] == '') { $address['MR_Selected_Pays'] = 'FR'; } $deliv_address = Db::getInstance()->getRow(' SELECT * FROM `'._DB_PREFIX_.'address` a LEFT JOIN `'._DB_PREFIX_.'orders` o ON a.`id_address` = o.`id_address_delivery` WHERE o.`id_cart` = '.(int) Tools::getValue('id_cart').' '); if($address) { if(isset($_POST['submitMR'])) { $num = Tools::getValue('MR_Selected_Num', ''); if($num != '') { $rel = Db::getInstance()->getRow(' SELECT * FROM `'._DB_PREFIX_.'mondialrelay_relais` WHERE `direction` = "'.pSQL(sprintf('%05d', (int) ((string) substr($num, -5)))).'" AND `prpay` = "'.pSQL($address['MR_Selected_Pays']).'" '); if($rel) { Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_.'mr_selected` SET `MR_Selected_Num` = "'.pSQL($num).'", `MR_Selected_LgAdr1` = "'.pSQL(trim($rel['colnom'])).'", `MR_Selected_LgAdr2` = "'.pSQL(trim($rel['colbat'])).'", `MR_Selected_LgAdr3` = "'.pSQL(trim($rel['colrue'])).'", `MR_Selected_LgAdr4` = "'.pSQL(trim($rel['coldit'])).'", `MR_Selected_CP` = "'.pSQL(trim($rel['codpos'])).'", `MR_Selected_Ville` = "'.pSQL(trim($rel['libbp'])).'", `MR_Selected_Pays` = "'.pSQL(trim($rel['prpay'])).'" WHERE `id_cart` = '.(int) Tools::getValue('id_cart').' '); } } } $order = Db::getInstance()->getRow(' SELECT `id_carrier`, `id_order`, `id_address_delivery` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int) Tools::getValue('id_cart').' '); $weight = (float) Db::getInstance()->getValue(' SELECT SUM(`product_weight` * `product_quantity`) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int) $order['id_order'].' '); ?>

Info Destinataire

Information Point relais

function updateForm(delivery_mode, address1, address2, address3, address4, postcode, city, prid) { $("select[name=delivery_mode]").val(""); $("input[name=MR_Selected_LgAdr1]").val(""); $("input[name=MR_Selected_LgAdr2]").val(""); $("input[name=MR_Selected_LgAdr3]").val(""); $("input[name=MR_Selected_LgAdr4]").val(""); $("input[name=MR_Selected_CP]").val(""); $("input[name=MR_Selected_Ville]").val(""); $("input[name=MR_Selected_Num]").val(""); $("select[name=delivery_mode]").val(delivery_mode); $("input[name=MR_Selected_LgAdr1]").val(address1); $("input[name=MR_Selected_LgAdr2]").val(address2); $("input[name=MR_Selected_LgAdr3]").val(address3); $("input[name=MR_Selected_LgAdr4]").val(address4); $("input[name=MR_Selected_CP]").val(postcode); $("input[name=MR_Selected_Ville]").val(city); $("input[name=MR_Selected_Num]").val(prid); } var enseigne = "F1BEBEBO"; var isocode = "'.$address['MR_Selected_Pays'].'"; var postcode = "'.$address['MR_Selected_CP'].'"; var mode = "24R"; var weight = '.(int)($weight * 1000).'; if( weight == 0 ) weight = 100; var t; $(document).ready(function () { $("#Zone_Widget").MR_ParcelShopPicker({ UseSSL : true, Weight: weight, Target: "#Target_Widget", TargetDisplay: "#TargetDisplay_Widget", TargetDisplayInfoPR: "#TargetDisplayInfoPR_Widget", Brand: enseigne, Country: isocode, PostCode: postcode, ColLivMod: mode, NbResults: "15", DisplayMapInfo: true, OnParcelShopSelected: function (data) { updateForm("24R",data.Nom,"",data.Adresse1,data.Adresse2,data.CP,data.Ville,data.ID); $("#cb_ID").html(data.ID); $("#cb_Nom").html(data.Nom); $("#cb_Adresse").html(data.Adresse1 + " " + data.Adresse2); $("#cb_CP").html(data.CP); $("#cb_Ville").html(data.Ville); $("#cb_Pays").html(data.Pays); } }); }); '; ?>