Merge branch 'ticket-fixSoflex' into develop

This commit is contained in:
Marion Muszynski 2016-05-20 17:46:08 +02:00
commit 1eb95c2185

View File

@ -1427,7 +1427,13 @@ class soflexibilite extends CarrierModule
require_once dirname(__FILE__).'/classes/SoFlexibiliteWebService.php';
// Customer Name
if (!empty($soDelivery->firstname) && !empty($soDelivery->lastname)) {
$address = Db::getInstance()->ExecuteS('SELECT * FROM ps_socolissimo_delivery_info WHERE id_cart = '.pSQL((int)$order->id_cart));
if(count($address) > 0) {
$address = $address[0];
}
if (!empty($address['prname']) && !empty($address['prname'])) {
$fullname = sprintf('%s %s', $address['prfirstname'], $address['prname']);
} elseif (!empty($soDelivery->firstname) && !empty($soDelivery->lastname)) {
$fullname = sprintf('%s %s', $soDelivery->firstname, $soDelivery->lastname);
} else {
$fullname = sprintf('%s %s', $customer_address->firstname, $customer_address->lastname);