From cb34675312bc15edf10b563427acfc8ee5e96005 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Tue, 24 Jan 2017 15:41:19 +0100 Subject: [PATCH] fix CMT when other countries than BE or FR --- modules/soflexibilite/functions/saveDeliveryPoint.php | 2 +- modules/soflexibilite/js/front_flexibilite.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/soflexibilite/functions/saveDeliveryPoint.php b/modules/soflexibilite/functions/saveDeliveryPoint.php index 9def3da0..c0a96570 100644 --- a/modules/soflexibilite/functions/saveDeliveryPoint.php +++ b/modules/soflexibilite/functions/saveDeliveryPoint.php @@ -99,7 +99,7 @@ class SoFlexibiliteDeliverySave extends SoFlexibilite $soDelivery->indice = pSQL($indice); $soDelivery->postcode = pSQL($codePostal); $soDelivery->city = pSQL($commune); - $soDelivery->country = (($type == 'CMT' || $type == 'BDP') ? pSQL('BE') : pSQL('FR')); + $soDelivery->country = pSQL(substr(Tools::getValue('pays', 'FR'), 0, 2)); $soDelivery->address1 = pSQL($adresse1); $soDelivery->address2 = pSQL(''); $soDelivery->lieudit = pSQL(''); diff --git a/modules/soflexibilite/js/front_flexibilite.js b/modules/soflexibilite/js/front_flexibilite.js index 99c60785..01b5f13f 100644 --- a/modules/soflexibilite/js/front_flexibilite.js +++ b/modules/soflexibilite/js/front_flexibilite.js @@ -686,7 +686,8 @@ $(document).ready(function () { adresse1: $('#' + idPoint).find('.address1').text(), code_postal: $('#' + idPoint).find('.code_postal').text(), commune: $('#' + idPoint).find('.commune').text(), - id_cart: $('#soflexibilite_cart_id').val() + id_cart: $('#soflexibilite_cart_id').val(), + pays: $("#sl-0-country").val() }, success: function (data) { /* if (window.console) { @@ -728,7 +729,8 @@ $(document).ready(function () { address2: $(fullid).find('.pr-indice').val(), postcode: $(fullid).find('.code_postal').html(), city: $(fullid).find('.commune').html(), - country: $(fullid).is('.BPR, .A2P, .CIT, .CDI') ? 'France' : 'Belgique' + country: $("#sl-0-country").val() + //country: $(fullid).is('.BPR, .A2P, .CIT, .CDI') ? 'France' : 'Belgique' })); $('#custMail').val(sf_customer_mail); $('#custPhone').val(sf_customer_phone);