|
@@ 63-73 (lines=11) @@
|
| 60 |
|
} catch (\Exception $e) { |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
if (!$senderCountryValid) { |
| 64 |
|
$senderCountry = $this->countryMapping($label->getSenderCountryCode()); |
| 65 |
|
if ($senderCountry) { |
| 66 |
|
$label->setSenderCountryCode($senderCountry); |
| 67 |
|
} else { |
| 68 |
|
$output->writeln('Sender country code `'.$label->getSenderCountryCode().'` is not a valid ISO 3166 alpha 2 country code. Create a mapping or change the country manually.', OutputInterface::VERBOSITY_VERBOSE); |
| 69 |
|
$label->markAsError('Sender country code `'.$label->getSenderCountryCode().'` is not a valid ISO 3166 alpha 2 country code. Create a mapping or change the country manually.'); |
| 70 |
|
$manager->flush(); |
| 71 |
|
continue; |
| 72 |
|
} |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
$receiverCountryValid = false; |
| 76 |
|
try { |
|
@@ 82-92 (lines=11) @@
|
| 79 |
|
} catch (\Exception $e) { |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
if (!$receiverCountryValid) { |
| 83 |
|
$receiverCountry = $this->countryMapping($label->getReceiverCountryCode()); |
| 84 |
|
if ($receiverCountry) { |
| 85 |
|
$label->setReceiverCountryCode($receiverCountry); |
| 86 |
|
} else { |
| 87 |
|
$output->writeln('Receiver country code `'.$label->getReceiverCountryCode().'` is not a valid ISO 3166 alpha 2 country code. Create a mapping or change the country manually.', OutputInterface::VERBOSITY_VERBOSE); |
| 88 |
|
$label->markAsError('Receiver country code `'.$label->getReceiverCountryCode().'` is not a valid ISO 3166 alpha 2 country code. Create a mapping or change the country manually.'); |
| 89 |
|
$manager->flush(); |
| 90 |
|
continue; |
| 91 |
|
} |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
// check that the shipping method is mapped |
| 95 |
|
if ($label->getShippingMethod()) { |