This commit is contained in:
Christophe LATOUR 2017-11-17 18:34:51 +01:00
parent cdaa4f6fef
commit 74ca447bbf

View File

@ -313,19 +313,23 @@ class Cart extends BaseCart
} }
$available_carriers = array(); $available_carriers = array();
foreach ($carriers_ah as $carrier_ah) { if (isset($carriers_ah)) {
if (isset($carrier_ah['id_carrier'])) { foreach ($carriers_ah as $carrier_ah) {
$carrier = (new ApiCarrier())->populate($carrier_ah, $carrier_ah['id_carrier']); if (isset($carrier_ah['id_carrier'])) {
$carrier->is_relay = false; $carrier = (new ApiCarrier())->populate($carrier_ah, $carrier_ah['id_carrier']);
$available_carriers[] = $carrier; $carrier->is_relay = false;
$available_carriers[] = $carrier;
}
} }
} }
foreach ($carriers_ooh as $carrier_ooh) { if (isset($carriers_ooh)) {
if (isset($carrier_ooh['id_carrier'])) { foreach ($carriers_ooh as $carrier_ooh) {
$carrier = (new ApiCarrier())->populate($carrier_ooh, $carrier_ooh['id_carrier']); if (isset($carrier_ooh['id_carrier'])) {
$carrier->is_relay = true; $carrier = (new ApiCarrier())->populate($carrier_ooh, $carrier_ooh['id_carrier']);
$available_carriers[] = $carrier; $carrier->is_relay = true;
$available_carriers[] = $carrier;
}
} }
} }
return new Collection($available_carriers); return new Collection($available_carriers);