@@ 62-72 (lines=11) @@ | ||
59 | $senderCountryValid = true; |
|
60 | } catch (\Exception $e) {} |
|
61 | ||
62 | if(!$senderCountryValid) { |
|
63 | $senderCountry = $this->countryMapping($label->getSenderCountryCode()); |
|
64 | if($senderCountry) { |
|
65 | $label->setSenderCountryCode($senderCountry); |
|
66 | } else { |
|
67 | $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); |
|
68 | $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.'); |
|
69 | $manager->flush(); |
|
70 | continue; |
|
71 | } |
|
72 | } |
|
73 | ||
74 | $receiverCountryValid = false; |
|
75 | try { |
|
@@ 80-90 (lines=11) @@ | ||
77 | $receiverCountryValid = true; |
|
78 | } catch (\Exception $e) {} |
|
79 | ||
80 | if(!$receiverCountryValid) { |
|
81 | $receiverCountry = $this->countryMapping($label->getReceiverCountryCode()); |
|
82 | if($receiverCountry) { |
|
83 | $label->setReceiverCountryCode($receiverCountry); |
|
84 | } else { |
|
85 | $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); |
|
86 | $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.'); |
|
87 | $manager->flush(); |
|
88 | continue; |
|
89 | } |
|
90 | } |
|
91 | ||
92 | // check that the shipping method is mapped |
|
93 | if($label->getShippingMethod()) { |