Plugin Directory

Changeset 3451191


Ignore:
Timestamp:
01/31/2026 11:55:54 PM (2 months ago)
Author:
headplus
Message:

2.0.5

Location:
smartpoints-lockers-acs/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • smartpoints-lockers-acs/trunk/README.txt

    r3435516 r3451191  
    44Requires at least: 6.0
    55Tested up to: 6.9
    6 Stable tag: 2.0.2
     6Stable tag: 2.0.5
    77Requires PHP: 7.4
    88License: GPL v3
     
    113113== Changelog ==
    114114
     115= 2.0.5 =
     116* Fixed problems with Firefox Browser
     117
    115118= 2.0.2 =
    116119* 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];
     1const filesUrl = window.location.origin;
    32var locations = [];
    43var map;
    54var markers = [];
     5var customMarker = null;
    66var prepared = false;
    77const elementDistanceToPoint = '.point-distance';
     
    159159        if (status === 'OK' && results.length != 0) {
    160160
    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             }
     161if (customMarker) {
     162    customMarker.setMap(null);
     163}
     164
     165is_address = results[0].types[0] == 'premise' || results[0].types[0] == 'street_address';
     166
     167if (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}
    174176
    175177            findNearestPoint(results[0].geometry.location.lat(), results[0].geometry.location.lng(), is_address);
     
    247249    jQuery.ajax({
    248250        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,
     253success: function (data) {
     254    locations = data.points;
     255    addMarkers();
     256    fillFooter(data.meta);
     257    prepared = true;
     258}
    256259    });
    257260}
     
    271274    initMap();
    272275    fetchLocations();
    273     prepared = true;
    274 }
     276}
     277
    275278
    276279function openMap() {
    277280    if (!prepared) {
    278281        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
    280297    postcodeSearch(
    281298        jQuery(elementInputPostcode).val(),
     
    284301    toggleMapModal();
    285302}
     303
    286304
    287305function toggleSidebar() {
  • smartpoints-lockers-acs/trunk/smartpoints-lockers-acs-main.php

    r3440270 r3451191  
    121121        }
    122122
    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         }
     123public 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
    135178
    136179
  • smartpoints-lockers-acs/trunk/smartpoints-lockers-acs-plugin.php

    r3440270 r3451191  
    33 * Plugin Name: Smartpoints Lockers for ACS
    44 * 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.2
     5 * Version: 2.0.5
    66 * Author: HEADPLUS
    77 * Author URI: https://headplus.gr
     
    1919    return;
    2020}
    21 define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION', '2.0.2');
     21define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_VERSION', '2.0.5');
    2222define('SMARTPOINTS_LOCKERS_ACS_PLUGIN_ID', 'smartpoints-lockers-acs');
    2323
Note: See TracChangeset for help on using the changeset viewer.