Updated the Google Maps API endpoints for improved performance and compatibility

This commit is contained in:
vishalsingh.qlo325
2025-06-23 18:30:31 +05:30
parent bd7bfcfdf5
commit 475a547bd6
16 changed files with 171 additions and 227 deletions

View File

@@ -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.'&region='.$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.'&region='.$this->context->country->iso_code
);
}
}