Plugin Directory

Changeset 3404077


Ignore:
Timestamp:
11/27/2025 12:30:57 PM (4 months ago)
Author:
shipo
Message:

Bug fix for checkout locker

Location:
shipo/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • shipo/trunk/assets/js/map.js

    r3403157 r3404077  
    104104        });
    105105
     106        var input_system = jQuery('<input>', {
     107            type: 'hidden',
     108            name: 'shipo_locker_system_id',
     109            value: marker_data.details.system_id
     110        });
     111
    106112        // Append to your container
    107113        html += input.prop('outerHTML');
     114        html += input_system.prop('outerHTML');
    108115    }
    109116    else {
  • shipo/trunk/includes/class-shipo-checkout.php

    r3403157 r3404077  
    167167        if (!empty($shipping_method_id) && isset($_POST['shipo_locker'])) {
    168168            $locker_data = sanitize_text_field(wp_unslash($_POST['shipo_locker']));
    169 
     169            $system_id = isset($_POST['shipo_locker_system_id']) ? sanitize_text_field(wp_unslash($_POST['shipo_locker_system_id'])) : '';
     170
     171            $order->update_meta_data('_shipo_locker_data_json', urldecode($locker_data));
     172            $order->update_meta_data('_shipo_locker_data_system_id', $system_id);
     173           
    170174            if (!empty($locker_data)) {
    171                 // Decode the JSON data§
    172                 $order->update_meta_data('_shipo_locker_data_json', json_encode(urldecode($locker_data)));
    173 
     175           
     176                // Decode the locker data
    174177                $locker_obj = json_decode(urldecode($locker_data), true);
    175178                if ($locker_obj && is_array($locker_obj)) {
    176179                    $locker_details = isset($locker_obj['details']) ? $locker_obj['details'] : [];
    177                    
     180
    178181                    // Save the locker data in the order's meta data - sanitizing each value
    179182                    if (isset($locker_obj['position'])) {
     
    741744        $shipping_methods = $order->get_shipping_methods();
    742745        $shipo_data = [];
     746        $is_shipo = false;
    743747       
    744748        foreach ($shipping_methods as $shipping_method) {
  • shipo/trunk/includes/class-shipo-order.php

    r3395057 r3404077  
    102102       
    103103        if($recipient_address_type == 'locker') {
    104             $shipment_data["recipient_address_id"] = (int)$this->order->get_meta('_shipo_locker_system_id');
     104            $shipment_data["recipient_address_id"] = $this->order->get_meta('_shipo_locker_system_id');
     105            $shipment_data["locker_data"] = json_decode($this->order->get_meta('_shipo_locker_data_json'), true);
     106            $shipment_data["locker_system_id"] = json_decode($this->order->get_meta('_shipo_locker_data_system_id'), true);
    105107        }
    106108       
  • shipo/trunk/includes/class-shipo-wc-shipping.php

    r3395057 r3404077  
    242242            }
    243243        }
    244         else {
    245             $this->add_rate(array(
    246                 'id' => $this->id . ':no_rates',
    247                 'label' => __('Livrare prin curier', 'shipo'),
    248                 'cost' => 0,
    249             ));
    250         }
    251244    }
    252245   
  • shipo/trunk/readme.txt

    r3403157 r3404077  
    44Requires at least: 4.7
    55Tested up to: 6.8
    6 Stable tag: 1.1
     6Stable tag: 1.2
    77Requires PHP: 8.0
    88License: GPLv2 or later
     
    4646Fix locker missing coordinates message
    4747Fix locker data selector
     48
     49= 1.2 =
     50
     51Bug fix
  • shipo/trunk/shipo.php

    r3403157 r3404077  
    33 * Plugin Name: Shipo
    44 * Description: Shipo connects your webshop with top couriers instantly, no contract. Ship to address or locker, pay only when parcels are delivered.
    5  * Version: 1.1
     5 * Version: 1.2
    66 * Author: Shipo
    77 * Author URI: https://shipo.ro
     
    1616
    1717// Define plugin constants
    18 define('SHIPO_PLUGIN_VERSION', '1.1.0');
     18define('SHIPO_PLUGIN_VERSION', '1.2.0');
    1919define('SHIPO_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('SHIPO_PLUGIN_URL', plugin_dir_url(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.