Updated the Google Maps API endpoints for improved performance and compatibility
This commit is contained in:
@@ -66,10 +66,11 @@ class ProductControllerCore extends FrontController
|
||||
$this->addJqueryPlugin('jqzoom');
|
||||
}
|
||||
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY'))) {
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY'))
|
||||
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
|
||||
) {
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id);
|
||||
if ($roomTypeInfo) {
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($roomTypeInfo['id_hotel']);
|
||||
if (floatval($objHotelBranchInformation->latitude) != 0
|
||||
&& floatval($objHotelBranchInformation->longitude) != 0
|
||||
@@ -79,12 +80,13 @@ class ProductControllerCore extends FrontController
|
||||
'latitude' => $objHotelBranchInformation->latitude,
|
||||
'longitude' => $objHotelBranchInformation->longitude,
|
||||
),
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON'))
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'PS_MAP_ID' => $PS_MAP_ID
|
||||
));
|
||||
|
||||
$this->addJS(
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$PS_API_KEY.'&libraries=places&language='.
|
||||
$this->context->language->iso_code.'®ion='.$this->context->country->iso_code
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$PS_API_KEY.
|
||||
'&libraries=places,marker&loading=async&callback=initMap&language='.$this->context->language->iso_code.'®ion='.$this->context->country->iso_code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user