Plugin Directory

Changeset 3408287


Ignore:
Timestamp:
12/02/2025 04:59:47 PM (3 months ago)
Author:
europarcelcom
Message:

Release 1.0.6 - Fixed locker selection bug

Location:
europarcel-com
Files:
40 added
17 edited

Legend:

Unmodified
Added
Removed
  • europarcel-com/trunk/README.txt

    r3406550 r3408287  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.5
     7Stable tag: 1.0.6
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    7777== Changelog ==
    7878
     79= 1.0.6 =
     80* Fixed locker selection bug where wrong locker was saved to order meta
     81* Fixed race condition between session update and checkout refresh
     82
     83= 1.0.5 =
     84* Improved checkout integration for both Classic and Blocks checkout
     85* Enhanced locker selection modal interface
     86* Code refactoring and documentation improvements
     87
    7988= 1.0.4 =
    8089* Added Dragon star courier support
     
    92101== Upgrade Notice ==
    93102
     103= 1.0.6 =
     104Fixed locker selection bug where wrong locker was saved to order meta.
     105
     106= 1.0.5 =
     107Improved checkout integration and locker selection modal.
     108
    94109= 1.0.4 =
    95110Added support for Dragon star and FedEx couriers. Updated translations.
  • europarcel-com/trunk/assets/css/europarcel-admin.css

    r3406532 r3408287  
    66 *
    77 * @package    Europarcel
    8  * @since      1.0.5
     8 * @since      1.0.6
    99 */
    1010
  • europarcel-com/trunk/assets/js/europarcel-admin.js

    r3406532 r3408287  
    66 *
    77 * @package    Europarcel
    8  * @since      1.0.5
     8 * @since      1.0.6
    99 */
    1010
  • europarcel-com/trunk/assets/js/europarcel-locker-selector.js

    r3406532 r3408287  
    77 *
    88 * @package    Europarcel
    9  * @since      1.0.5
     9 * @since      1.0.6
    1010 */
    1111
     
    362362                const locker = event.data.locker;
    363363
    364                 updateWooCommerceFields(locker);
    365 
    366364                if (window.EuroparcelModal) {
    367365                    window.EuroparcelModal.close();
    368366                }
    369367
    370                 // Use unified display function
    371368                displayLockerInfo(locker, true);
    372 
    373                 $("body").trigger("update_checkout");
     369                updateWooCommerceFields(locker);
    374370            }
    375371        });
     
    395391                        order_lockers = response.data['order_lockers'];
    396392                    }
     393                    $("body").trigger("update_checkout");
    397394                }
    398395            });
  • europarcel-com/trunk/assets/js/europarcel-modal.js

    r3406532 r3408287  
    77 * @package    Europarcel
    88 * @subpackage Assets/JavaScript
    9  * @since      1.0.5
     9 * @since      1.0.6
    1010 */
    1111
     
    1616     * EuroParcel Modal object
    1717     *
    18      * @since 1.0.5
     18     * @since 1.0.6
    1919     */
    2020    window.EuroparcelModal = {
     
    2626         * Handles both desktop and mobile responsive display.
    2727         *
    28          * @since 1.0.5
     28         * @since 1.0.6
    2929         * @param {string} iframeUrl - The URL to load in the iframe
    3030         */
     
    9292         * Configures click handlers, escape key handler, and other modal interactions.
    9393         *
    94          * @since 1.0.5
     94         * @since 1.0.6
    9595         * @param {HTMLElement} modal - The modal element
    9696         * @param {boolean} isMobile - Whether the device is mobile
     
    141141         * Cleans up event listeners to prevent memory leaks.
    142142         *
    143          * @since 1.0.5
     143         * @since 1.0.6
    144144         */
    145145        close: function() {
  • europarcel-com/trunk/europarcel-com.php

    r3406532 r3408287  
    99 *
    1010 * @link              https://eawb.ro
    11  * @since             1.0.5
     11 * @since             1.0.6
    1212 * @package           Europarcel
    1313 *
     
    1515 * Plugin Name:       EuroParcel Integration for WooCommerce
    1616 * Description:       Connect your WooCommerce store with eAWB shipping platform
    17  * Version:           1.0.5
     17 * Version:           1.0.6
    1818 * Author:            EuroParcel
    1919 * Author URI:        https://eawb.ro/
     
    3333/**
    3434 * Currently plugin version.
    35  * Start at version 1.0.5 and use SemVer - https://semver.org
     35 * Start at version 1.0.6 and use SemVer - https://semver.org
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define('EUROPARCELCOM_WC_VERSION', '1.0.5');
     38define('EUROPARCELCOM_WC_VERSION', '1.0.6');
    3939
    4040/**
     
    7070 * Declare compatibility with WooCommerce High-Performance Order Storage (HPOS)
    7171 *
    72  * @since    1.0.5
     72 * @since    1.0.6
    7373 */
    7474add_action('before_woocommerce_init', function() {
     
    8181 * Initialize the shipping method
    8282 *
    83  * @since    1.0.5
     83 * @since    1.0.6
    8484 */
    8585add_action('woocommerce_shipping_init', 'europarcelcom_wc_shipping_init');
     
    8888 * Load the shipping method class
    8989 *
    90  * @since    1.0.5
     90 * @since    1.0.6
    9191 */
    9292function europarcelcom_wc_shipping_init() {
     
    100100 * Register the shipping method with WooCommerce
    101101 *
    102  * @since    1.0.5
     102 * @since    1.0.6
    103103 * @param    array    $methods    Existing shipping methods
    104104 * @return   array                Updated shipping methods
     
    112112 * Enqueue admin styles and scripts
    113113 *
    114  * @since    1.0.5
     114 * @since    1.0.6
    115115 */
    116116add_action('admin_enqueue_scripts', function () {
    117117    $current_screen = get_current_screen();
    118118    if (is_admin() && $current_screen && strpos($current_screen->id, 'woocommerce_page_wc-settings') !== false) {
    119         wp_enqueue_style('europarcel-admin', plugins_url('assets/css/europarcel-admin.css', __FILE__), array(), '1.0.5');
    120         wp_enqueue_script('europarcel-admin', plugins_url('assets/js/europarcel-admin.js', __FILE__), array('jquery', 'select2'), '1.0.5', true);
     119        wp_enqueue_style('europarcel-admin', plugins_url('assets/css/europarcel-admin.css', __FILE__), array(), '1.0.6');
     120        wp_enqueue_script('europarcel-admin', plugins_url('assets/js/europarcel-admin.js', __FILE__), array('jquery', 'select2'), '1.0.6', true);
    121121    }
    122122});
     
    125125 * Initialize the main plugin class
    126126 *
    127  * @since    1.0.5
     127 * @since    1.0.6
    128128 */
    129129function europarcelcom_wc_plugin_run() {
     
    138138 * Add plugin row meta links (Documentation, Video Tutorial)
    139139 *
    140  * @since    1.0.5
     140 * @since    1.0.6
    141141 * @param    array     $links    Existing meta links
    142142 * @param    string    $file     Plugin file path
  • europarcel-com/trunk/includes/class-europarcel-activator.php

    r3406532 r3408287  
    99 *
    1010 * @link       https://europarcel.com
    11  * @since      1.0.5
     11 * @since      1.0.6
    1212 *
    1313 * @package    Europarcel
     
    2020 * This class defines all code necessary to run during the plugin's activation.
    2121 *
    22  * @since      1.0.5
     22 * @since      1.0.6
    2323 * @package    Europarcel
    2424 * @subpackage Europarcel/includes
     
    3232     * Handles any setup tasks required when the plugin is activated.
    3333     *
    34      * @since    1.0.5
     34     * @since    1.0.6
    3535     */
    3636    public static function activate() {
    3737        // Store plugin version
    3838        if (!get_option('EUROPARCELCOM_WC_VERSION')) {
    39             add_option('EUROPARCELCOM_WC_VERSION', '1.0.5');
     39            add_option('EUROPARCELCOM_WC_VERSION', '1.0.6');
    4040        }
    4141       
  • europarcel-com/trunk/includes/class-europarcel-checkout.php

    r3406532 r3408287  
    1313 *
    1414 * @link       https://eawb.ro
    15  * @since      1.0.5
     15 * @since      1.0.6
    1616 *
    1717 * @package    Europarcel
     
    2828 * for locker selection and shipping updates.
    2929 *
    30  * @since      1.0.5
     30 * @since      1.0.6
    3131 * @package    Europarcel
    3232 * @subpackage Europarcel/includes
     
    3838     * Whether the current checkout is blocks-based
    3939     *
    40      * @since    1.0.5
     40     * @since    1.0.6
    4141     * @access   private
    4242     * @var      bool    $is_blocks_checkout    True if blocks checkout detected
     
    5050     * via smart_init method to detect checkout type first.
    5151     *
    52      * @since    1.0.5
     52     * @since    1.0.6
    5353     */
    5454    public function __construct() {
     
    6262     * or Blocks-based and initializes the appropriate functionality.
    6363     *
    64      * @since    1.0.5
     64     * @since    1.0.6
    6565     */
    6666    public function smart_init() {
     
    8383     * Enqueues scripts and localizes data for WooCommerce Blocks checkout.
    8484     *
    85      * @since    1.0.5
     85     * @since    1.0.6
    8686     */
    8787    private function init_blocks_checkout() {
     
    9696     * Enqueues scripts and localizes data for WooCommerce Classic checkout.
    9797     *
    98      * @since    1.0.5
     98     * @since    1.0.6
    9999     */
    100100    private function init_classic_checkout() {
     
    110110     * and checkout type information for JavaScript usage.
    111111     *
    112      * @since    1.0.5
     112     * @since    1.0.6
    113113     */
    114114    private function localize_script_data() {
     
    191191     * Validates nonce and returns carrier data via JSON response.
    192192     *
    193      * @since    1.0.5
     193     * @since    1.0.6
    194194     */
    195195    public function wp_ajax_europarcelcomwc_get_locker_carriers() {
     
    221221     * Validates nonce and sanitizes all input data.
    222222     *
    223      * @since    1.0.5
     223     * @since    1.0.6
    224224     */
    225225    public function wp_ajax_europarcelcomwc_update_locker_shipping() {
     
    240240            );
    241241            WC()->session->set('locker_info', $locker_info);
     242           
     243            $packages = WC()->cart->get_shipping_packages();
     244            foreach ($packages as $package_key => $package) {
     245                WC()->session->set('shipping_for_package_' . $package_key, false);
     246            }
    242247            $user_id = get_current_user_id();
    243248            if ($user_id) {
     
    271276     * the locker selection button in classic checkout when applicable.
    272277     *
    273      * @since    1.0.5
     278     * @since    1.0.6
    274279     */
    275280    public function classic_checkout_button() {
  • europarcel-com/trunk/includes/class-europarcel-constants.php

    r3406532 r3408287  
    99 *
    1010 * @link       https://eawb.ro
    11  * @since      1.0.5
     11 * @since      1.0.6
    1212 *
    1313 * @package    Europarcel
     
    2727 * shipping services for both admin configuration and API requests.
    2828 *
    29  * @since      1.0.5
     29 * @since      1.0.6
    3030 * @package    Europarcel
    3131 * @subpackage Europarcel/includes
     
    4141     * All strings are internationalized for translation support.
    4242     *
    43      * @since    1.0.5
     43     * @since    1.0.6
    4444     * @return   array    Array of service keys and their translated display names
    4545     */
     
    6969     * - 2: Locker delivery (home to locker)
    7070     *
    71      * @since    1.0.5
     71     * @since    1.0.6
    7272     * @param    array|string    $services    Array of service keys to convert (or string for backward compatibility)
    7373     * @return   array    Array of carrier configuration arrays
  • europarcel-com/trunk/includes/class-europarcel-customer.php

    r3406532 r3408287  
    99 *
    1010 * @link       https://eawb.ro
    11  * @since      1.0.5
     11 * @since      1.0.6
    1212 *
    1313 * @package    Europarcel
     
    3131 * and carrier service availability.
    3232 *
    33  * @since      1.0.5
     33 * @since      1.0.6
    3434 * @package    Europarcel
    3535 * @subpackage Europarcel/includes
     
    4141     * The WooCommerce shipping instance ID
    4242     *
    43      * @since    1.0.5
     43     * @since    1.0.6
    4444     * @access   private
    4545     * @var      int    $instance_id    WooCommerce shipping method instance ID
     
    5050     * The shipping method settings
    5151     *
    52      * @since    1.0.5
     52     * @since    1.0.6
    5353     * @access   public
    5454     * @var      array    $settings    WooCommerce shipping method settings
     
    6262     * configuration and loads the associated settings.
    6363     *
    64      * @since    1.0.5
     64     * @since    1.0.6
    6565     * @param    int    $instance_id    WooCommerce shipping method instance ID
    6666     */
     
    7676     * the EuroParcel API including name, contact details, and account status.
    7777     *
    78      * @since    1.0.5
     78     * @since    1.0.6
    7979     * @return   array|null    Customer account data or null on failure
    8080     */
     
    100100     * EuroParcel account for use in shipping calculations.
    101101     *
    102      * @since    1.0.5
     102     * @since    1.0.6
    103103     * @return   array    Array of billing addresses with ID as key and formatted address as value
    104104     */
     
    138138     * EuroParcel account for use as pickup locations.
    139139     *
    140      * @since    1.0.5
     140     * @since    1.0.6
    141141     * @return   array    Array of pickup addresses with ID as key and formatted address as value
    142142     */
     
    177177     * and destination address.
    178178     *
    179      * @since    1.0.5
     179     * @since    1.0.6
    180180     * @param    array    $package        WooCommerce package data with destination details
    181181     * @param    bool     $allow_locker   Whether to include locker delivery options
     
    262262     * Used with usort() to arrange services from lowest to highest cost.
    263263     *
    264      * @since    1.0.5
     264     * @since    1.0.6
    265265     * @param    array    $first_service     First service for comparison
    266266     * @param    array    $second_service    Second service for comparison
     
    280280     * based on the configured available services.
    281281     *
    282      * @since    1.0.5
     282     * @since    1.0.6
    283283     * @return   array    Array of carrier IDs that support locker delivery
    284284     */
     
    316316     * based on the configured available services.
    317317     *
    318      * @since    1.0.5
     318     * @since    1.0.6
    319319     * @return   array|false    Array of carrier IDs that support standard delivery or false if none available
    320320     */
  • europarcel-com/trunk/includes/class-europarcel-deactivator.php

    r3406532 r3408287  
    99 *
    1010 * @link       https://europarcel.com
    11  * @since      1.0.5
     11 * @since      1.0.6
    1212 *
    1313 * @package    Europarcel
     
    2020 * This class defines all code necessary to run during the plugin's deactivation.
    2121 *
    22  * @since      1.0.5
     22 * @since      1.0.6
    2323 * @package    Europarcel
    2424 * @subpackage Europarcel/includes
     
    3232     * Handles any cleanup tasks required when the plugin is deactivated.
    3333     *
    34      * @since    1.0.5
     34     * @since    1.0.6
    3535     */
    3636    public static function deactivate() {
  • europarcel-com/trunk/includes/class-europarcel-http-request.php

    r3406532 r3408287  
    88 *
    99 * @link       https://eawb.ro
    10  * @since      1.0.5
     10 * @since      1.0.6
    1111 *
    1212 * @package    Europarcel
     
    2626 * for both GET and POST requests with proper error handling.
    2727 *
    28  * @since      1.0.5
     28 * @since      1.0.6
    2929 * @package    Europarcel
    3030 * @subpackage Europarcel/includes
     
    3636     * The shipping method instance ID
    3737     *
    38      * @since    1.0.5
     38     * @since    1.0.6
    3939     * @access   private
    4040     * @var      int    $instance_id    WooCommerce shipping method instance ID
     
    4848     * shipping method settings and API key.
    4949     *
    50      * @since    1.0.5
     50     * @since    1.0.6
    5151     * @param    int    $instance_id    WooCommerce shipping method instance ID
    5252     */
     
    6060     * query parameters and handles the response.
    6161     *
    62      * @since    1.0.5
     62     * @since    1.0.6
    6363     * @param    string    $function    API endpoint function name
    6464     * @param    array     $data        Optional query parameters
     
    8989     * the provided data and handles the response.
    9090     *
    91      * @since    1.0.5
     91     * @since    1.0.6
    9292     * @param    string    $function    API endpoint function name
    9393     * @param    array     $data        POST data to send
     
    115115     * Throws exceptions for various error conditions.
    116116     *
    117      * @since    1.0.5
     117     * @since    1.0.6
    118118     * @param    array|WP_Error    $response    WordPress HTTP API response
    119119     * @return   array             Decoded JSON response
     
    155155     * the headers required for EuroParcel API authentication.
    156156     *
    157      * @since    1.0.5
     157     * @since    1.0.6
    158158     * @return   array    HTTP headers array with API key
    159159     */
  • europarcel-com/trunk/includes/class-europarcel-main.php

    r3406532 r3408287  
    1313 *
    1414 * @link       https://eawb.ro
    15  * @since      1.0.5
     15 * @since      1.0.6
    1616 *
    1717 * @package    Europarcel
     
    2626 * both classic and blocks checkout types.
    2727 *
    28  * @since      1.0.5
     28 * @since      1.0.6
    2929 * @package    Europarcel
    3030 * @subpackage Europarcel/includes
     
    3636     * The plugin name
    3737     *
    38      * @since    1.0.5
     38     * @since    1.0.6
    3939     * @access   protected
    4040     * @var      string    $plugin_name    The plugin identifier name
     
    4545     * The plugin version
    4646     *
    47      * @since    1.0.5
     47     * @since    1.0.6
    4848     * @access   protected
    4949     * @var      string    $version    The current plugin version
     
    5454     * The checkout handler instance
    5555     *
    56      * @since    1.0.5
     56     * @since    1.0.6
    5757     * @access   protected
    5858     * @var      EuroparcelCheckout    $checkout_handler    Handles checkout functionality
     
    6666     * and defines WooCommerce hooks for checkout functionality.
    6767     *
    68      * @since    1.0.5
     68     * @since    1.0.6
    6969     */
    7070    public function __construct() {
     
    7272            $this->version = EUROPARCELCOM_WC_VERSION;
    7373        } else {
    74             $this->version = '1.0.5';
     74            $this->version = '1.0.6';
    7575        }
    7676        $this->plugin_name = 'europarcel-com';
     
    8686     * managing checkout functionality and locker selection.
    8787     *
    88      * @since    1.0.5
     88     * @since    1.0.6
    8989     */
    9090    private function load_dependencies() {
     
    9999     * WordPress hooks for AJAX functionality and checkout integration.
    100100     *
    101      * @since    1.0.5
     101     * @since    1.0.6
    102102     */
    103103    private function define_woocommerce_hooks() {
     
    123123     * so this method is available for future use if needed.
    124124     *
    125      * @since    1.0.5
     125     * @since    1.0.6
    126126     */
    127127    public function run() {
     
    132132     * Get the plugin name
    133133     *
    134      * @since     1.0.5
     134     * @since     1.0.6
    135135     * @return    string    The plugin name
    136136     */
     
    142142     * Get the plugin version
    143143     *
    144      * @since     1.0.5
     144     * @since     1.0.6
    145145     * @return    string    The plugin version number
    146146     */
  • europarcel-com/trunk/includes/class-europarcel-request-data.php

    r3406532 r3408287  
    99 *
    1010 * @link       https://eawb.ro
    11  * @since      1.0.5
     11 * @since      1.0.6
    1212 *
    1313 * @package    Europarcel
     
    2929 * based on WooCommerce shipping instance configuration.
    3030 *
    31  * @since      1.0.5
     31 * @since      1.0.6
    3232 * @package    Europarcel
    3333 * @subpackage Europarcel/includes
     
    3939     * The WooCommerce shipping instance ID
    4040     *
    41      * @since    1.0.5
     41     * @since    1.0.6
    4242     * @access   private
    4343     * @var      int    $instance_id    WooCommerce shipping method instance ID
     
    5151     * including carrier info, addresses, content details, and extra options.
    5252     *
    53      * @since    1.0.5
     53     * @since    1.0.6
    5454     * @access   private
    5555     * @var      array    $request_data    Complete shipping request data
     
    117117     * parcel specifications.
    118118     *
    119      * @since    1.0.5
     119     * @since    1.0.6
    120120     * @param    int     $instance_id     WooCommerce shipping method instance ID
    121121     * @param    bool    $allow_locker    Whether to allow locker delivery services
     
    176176     * Set the carrier ID for the shipping request
    177177     *
    178      * @since    1.0.5
     178     * @since    1.0.6
    179179     * @param    int    $carrier_id    The carrier ID from EuroParcel
    180180     */
     
    186186     * Set the service ID for the shipping request
    187187     *
    188      * @since    1.0.5
     188     * @since    1.0.6
    189189     * @param    int    $service_id    The service ID (1=standard, 2=locker)
    190190     */
     
    196196     * Set the delivery address for the shipping request
    197197     *
    198      * @since    1.0.5
     198     * @since    1.0.6
    199199     * @param    array    $delivery_address    Complete delivery address data
    200200     */
     
    208208     * Returns the prepared shipping request data ready for EuroParcel API calls.
    209209     *
    210      * @since    1.0.5
     210     * @since    1.0.6
    211211     * @return   array    Complete shipping request data
    212212     */
  • europarcel-com/trunk/includes/class-europarcel-shipping.php

    r3406532 r3408287  
    1313 *
    1414 * @link       https://eawb.ro
    15  * @since      1.0.5
     15 * @since      1.0.6
    1616 *
    1717 * @package    Europarcel
     
    2929 * and both standard and locker delivery options.
    3030 *
    31  * @since      1.0.5
     31 * @since      1.0.6
    3232 * @package    Europarcel
    3333 * @subpackage Europarcel/includes
     
    4242     * instance ID, method title, description, and supported features.
    4343     *
    44      * @since    1.0.5
     44     * @since    1.0.6
    4545     * @param    int    $instance_id    WooCommerce shipping zone instance ID
    4646     */
     
    6767     * and initializes the admin form fields.
    6868     *
    69      * @since    1.0.5
     69     * @since    1.0.6
    7070     */
    7171    public function init() {
     
    8686     * Dynamically loads customer information when API key is provided.
    8787     *
    88      * @since    1.0.5
     88     * @since    1.0.6
    8989     */
    9090    public function init_form_fields() {
     
    275275     * Validates nonce for security and processes each form field.
    276276     *
    277      * @since    1.0.5
     277     * @since    1.0.6
    278278     * @return   bool    True if options were saved successfully, false otherwise
    279279     */
     
    315315     * Creates shipping rates for both standard and locker delivery options.
    316316     *
    317      * @since    1.0.5
     317     * @since    1.0.6
    318318     * @param    array    $package    WooCommerce package data with contents and destination
    319319     */
  • europarcel-com/trunk/languages/europarcel-com-ro_RO.po

    r3406532 r3408287  
    44msgid ""
    55msgstr ""
    6 "Project-Id-Version: EuroParcel Integration for WooCommerce 1.0.5\n"
     6"Project-Id-Version: EuroParcel Integration for WooCommerce 1.0.6\n"
    77"Report-Msgid-Bugs-To: [email protected]\n"
    88"POT-Creation-Date: 2025-11-27 19:43+0200\n"
  • europarcel-com/trunk/uninstall.php

    r3406532 r3408287  
    1010 *
    1111 * @link       https://eawb.ro
    12  * @since      1.0.5
     12 * @since      1.0.6
    1313 *
    1414 * @package    Europarcel
Note: See TracChangeset for help on using the changeset viewer.