Changeset 3451191
- Timestamp:
- 01/31/2026 11:55:54 PM (2 months ago)
- Location:
- smartpoints-lockers-acs/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (2 diffs)
-
js/script.js (modified) (5 diffs)
-
smartpoints-lockers-acs-main.php (modified) (1 diff)
-
smartpoints-lockers-acs-plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smartpoints-lockers-acs/trunk/README.txt
r3435516 r3451191 4 4 Requires at least: 6.0 5 5 Tested up to: 6.9 6 Stable tag: 2.0. 26 Stable tag: 2.0.5 7 7 Requires PHP: 7.4 8 8 License: GPL v3 … … 113 113 == Changelog == 114 114 115 = 2.0.5 = 116 * Fixed problems with Firefox Browser 117 115 118 = 2.0.2 = 116 119 * Added function: Appears the button if ACS SmartPoint Shipping class is selected -
smartpoints-lockers-acs/trunk/js/script.js
r3440270 r3451191 1 const getUrl = window.location; 2 const filesUrl = getUrl.protocol + "//" + getUrl.host + getUrl.pathname.split('/')[0]; 1 const filesUrl = window.location.origin; 3 2 var locations = []; 4 3 var map; 5 4 var markers = []; 5 var customMarker = null; 6 6 var prepared = false; 7 7 const elementDistanceToPoint = '.point-distance'; … … 159 159 if (status === 'OK' && results.length != 0) { 160 160 161 if (markers['custom_marker'] !== undefined) { 162 markers['custom_marker'].setMap(null); 163 } 164 165 is_address = results[0].types[0] == 'premise' || results[0].types[0] == 'street_address'; 166 if (is_address) { 167 custom_marker = new google.maps.Marker({ 168 position: new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()), 169 map: map, 170 id: 'custom-location' 171 }); 172 markers['custom_marker'] = custom_marker; 173 } 161 if (customMarker) { 162 customMarker.setMap(null); 163 } 164 165 is_address = results[0].types[0] == 'premise' || results[0].types[0] == 'street_address'; 166 167 if (is_address) { 168 customMarker = new google.maps.Marker({ 169 position: new google.maps.LatLng( 170 results[0].geometry.location.lat(), 171 results[0].geometry.location.lng() 172 ), 173 map: map 174 }); 175 } 174 176 175 177 findNearestPoint(results[0].geometry.location.lat(), results[0].geometry.location.lng(), is_address); … … 247 249 jQuery.ajax({ 248 250 dataType: "json", 249 url: filesUrl + pluginFolder + "/data.json?v="+new Date().getTime(), 250 async: false, 251 success: function (data) { 252 locations = data.points; 253 addMarkers(); 254 fillFooter(data.meta); 255 } 251 url: filesUrl + pluginFolder + "/data.json", 252 async: true, 253 success: function (data) { 254 locations = data.points; 255 addMarkers(); 256 fillFooter(data.meta); 257 prepared = true; 258 } 256 259 }); 257 260 } … … 271 274 initMap(); 272 275 fetchLocations(); 273 prepared = true; 274 } 276 } 277 275 278 276 279 function openMap() { 277 280 if (!prepared) { 278 281 prepare(); 279 } 282 283 const waitForData = setInterval(function () { 284 if (prepared) { 285 clearInterval(waitForData); 286 postcodeSearch( 287 jQuery(elementInputPostcode).val(), 288 jQuery(elementInputAddress).val() + ',' + jQuery(elementInputCity).val() 289 ); 290 toggleMapModal(); 291 } 292 }, 100); 293 294 return; 295 } 296 280 297 postcodeSearch( 281 298 jQuery(elementInputPostcode).val(), … … 284 301 toggleMapModal(); 285 302 } 303 286 304 287 305 function toggleSidebar() { -
smartpoints-lockers-acs/trunk/smartpoints-lockers-acs-main.php
r3440270 r3451191 121 121 } 122 122 123 124 public function add_map_in_checkout() 125 { 126 $googleMapsKey = $this->settings['googleMapsKey']; 127 $filesPath = '/wp-content/plugins/smartpoints-lockers-acs/'; 128 wp_enqueue_script(SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-googleapis', 'https://maps.googleapis.com/maps/api/js?key=' . $googleMapsKey . '&libraries=geometry', array(), SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 'all'); 129 wp_enqueue_script(SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-markerclusterer', plugins_url('js/markerclusterer.js', __FILE__), array(), SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 'all'); 130 wp_enqueue_script(SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-woo-script', plugins_url('js/woo-script.js', __FILE__), array(), SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 'all'); 131 wp_enqueue_script(SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-script', plugins_url('js/script.js', __FILE__), array(), SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 'all'); 132 wp_enqueue_style(SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-css-styles', plugins_url('css/styles.css', __FILE__), array(), SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 'all'); 133 require 'smartpoints-lockers-acs-map.php'; 134 } 123 public function add_map_in_checkout() 124 { 125 $googleMapsKey = $this->settings['googleMapsKey'] ?? ''; 126 127 // 1. Google Maps API (ΠΡΩΤΟ, στο footer) 128 wp_enqueue_script( 129 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-googleapis', 130 'https://maps.googleapis.com/maps/api/js?key=' . esc_attr($googleMapsKey) . '&libraries=geometry', 131 [], 132 SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 133 true 134 ); 135 136 // 2. MarkerClusterer (ΕΞΑΡΤΑΤΑΙ από Google Maps) 137 wp_enqueue_script( 138 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-markerclusterer', 139 plugins_url('js/markerclusterer.js', __FILE__), 140 [SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-googleapis'], 141 SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 142 true 143 ); 144 145 // 3. Woo helper script (ανεξάρτητο) 146 wp_enqueue_script( 147 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-woo-script', 148 plugins_url('js/woo-script.js', __FILE__), 149 ['jquery'], 150 SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 151 true 152 ); 153 154 // 4. ΚΥΡΙΟ script (εξαρτάται από Google Maps + jQuery) 155 wp_enqueue_script( 156 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-script', 157 plugins_url('js/script.js', __FILE__), 158 [ 159 'jquery', 160 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-js-googleapis' 161 ], 162 SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION, 163 true 164 ); 165 166 // 5. CSS 167 wp_enqueue_style( 168 SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID . '-css-styles', 169 plugins_url('css/styles.css', __FILE__), 170 [], 171 SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION 172 ); 173 174 // 6. HTML map markup 175 require_once __DIR__ . '/smartpoints-lockers-acs-map.php'; 176 } 177 135 178 136 179 -
smartpoints-lockers-acs/trunk/smartpoints-lockers-acs-plugin.php
r3440270 r3451191 3 3 * Plugin Name: Smartpoints Lockers for ACS 4 4 * Description: The Smartpoints Lockers for ACS Plugin on your e-shop, offers at your customers the option to easily and quickly pick up their online orders from an ACS Smartpoint Locker or ACS store. 5 * Version: 2.0. 25 * Version: 2.0.5 6 6 * Author: HEADPLUS 7 7 * Author URI: https://headplus.gr … … 19 19 return; 20 20 } 21 define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION', '2.0. 2');21 define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION', '2.0.5'); 22 22 define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID', 'smartpoints-lockers-acs'); 23 23
Note: See TracChangeset
for help on using the changeset viewer.