inventory
inventory copied to clipboard
Refactor InventoryDistanceBasedSourceSelection plugin to handle exceptions instead of silent fail
\Magento\InventoryDistanceBasedSourceSelection\Plugin\FillSourceLatitudeAndLongitude
public function beforeSave(
SourceRepositoryInterface $subject,
SourceInterface $source
)array {
if (!$source->getLatitude() && !$source->getLongitude()) {
try {
$latLng = $this->getLatLngFromSource->execute($source);
$source->setLatitude($latLng->getLat());
$source->setLongitude($latLng->getLng());
} catch (\Exception $e) {
unset($e); // Silently fail geo coding
}
}