DPDBeNeLux / DPD-Shipping-for-Prestashop-1.7

Let op: er zijn nieuwe DPD plugins (BETA versie) beschikbaar met belangrijke nieuwe functionaliteiten. De oude plugins zullen na Brexit niet meer goed functioneren, download daarom de nieuwe versie op Github/DPDconnect.
GNU General Public License v3.0
1 stars 2 forks source link

When Google Maps key is not defined, show an error #5

Open dumanhaydar opened 6 years ago

dumanhaydar commented 6 years ago

When you don't define Google Maps key when module is active, you can't do an order. And any message is showed.

I do this actually: change

        $LATITUDE = $gmapsData->results[0]->geometry->location->lat;
        $LONGITUDE = $gmapsData->results[0]->geometry->location->lng;

with

        if (count($gmapsData->results) == 0) {
        $LATITUDE = null;
        $LONGITUDE = null;
        } else {
        $LATITUDE = $gmapsData->results[0]->geometry->location->lat;
        $LONGITUDE = $gmapsData->results[0]->geometry->location->lng;
    }