Merge branch 'master' of gitlab.antadis.net:dev-antadis/bebeboutik
This commit is contained in:
commit
ca67d6026a
@ -1280,7 +1280,10 @@ class soflexibilite extends CarrierModule
|
||||
}
|
||||
|
||||
if (in_array($params['order']->id_carrier, $this->id_carrier_so)) {
|
||||
if (!in_array($params['order']->id_carrier, array($this->id_carrier_so['SOFLEXIBILITE_DOM_ID'], $this->id_carrier_so['SOFLEXIBILITE_DOS_ID']))) {
|
||||
if (!in_array($params['order']->id_carrier, array(
|
||||
$this->id_carrier_so['SOFLEXIBILITE_DOM_ID'],
|
||||
$this->id_carrier_so['SOFLEXIBILITE_DOS_ID']))) {
|
||||
|
||||
$soDelivery = new SoFlexibiliteDelivery((int)$params['cart']->id, (int)$params['cart']->id_customer);
|
||||
$soDelivery->loadDelivery();
|
||||
|
||||
@ -1328,17 +1331,24 @@ class soflexibilite extends CarrierModule
|
||||
$address_delivery = new Address($id_address_new);
|
||||
|
||||
if (Validate::isLoadedObject($address_delivery)) {
|
||||
// Change lastname according to the address
|
||||
$soDelivery->lastname = $address->lastname;
|
||||
|
||||
// If type = BPR, change firstname according to the address
|
||||
if ($soDelivery->type == 'BPR') {
|
||||
$soDelivery->firstname = $address_delivery->firstname;
|
||||
}
|
||||
}
|
||||
$soDelivery->saveDelivery();
|
||||
|
||||
if (Validate::isLoadedObject($address)) {
|
||||
if (is_null($soDelivery->telephone) || empty($soDelivery->telephone) || Tools::strlen($soDelivery->telephone) < 7) {
|
||||
$soDelivery->telephone = $address->phone_mobile ? $address->phone_mobile : ($address->phone ? $address->phone : '');
|
||||
}
|
||||
}
|
||||
|
||||
$soDelivery->saveDelivery();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$soDelivery = new SoFlexibiliteDelivery((int)$params['cart']->id, (int)$params['cart']->id_customer);
|
||||
$soDelivery->loadDelivery();
|
||||
|
||||
@ -1392,7 +1402,8 @@ class soflexibilite extends CarrierModule
|
||||
|
||||
$soDelivery->saveDelivery();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$soDelivery = new SoFlexibiliteDelivery();
|
||||
$soDelivery->removeDelivery((int)$params['cart']->id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user