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

@@ -237,15 +237,16 @@ class ContactControllerCore extends FrontController
$this->addJS(_PS_JS_DIR_.'validate.js');
// GOOGLE MAP
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && ($PS_MAP_ID = Configuration::get('PS_MAP_ID')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
Media::addJsDef(
array(
'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
'&libraries=places,marker&loading=async&callback=initMap&language='.$this->context->language->iso_code.'&region='.$this->context->country->iso_code
);
}
}