Plugin Directory

Changeset 2884676


Ignore:
Timestamp:
03/22/2023 07:06:14 AM (3 years ago)
Author:
RistoNiinemets
Message:

Add version 1.7.1

Location:
estonian-shipping-methods-for-woocommerce
Files:
43 added
7 edited

Legend:

Unmodified
Added
Removed
  • estonian-shipping-methods-for-woocommerce/trunk/estonian-shipping-methods-for-woocommerce.php

    r2883818 r2884676  
    44 * Plugin URI: https://github.com/KonektOU/estonian-shipping-methods-for-woocommerce
    55 * Description: Extends WooCommerce with most commonly used Estonian shipping methods.
    6  * Version: 1.7
     6 * Version: 1.7.1
    77 * Author: Konekt OÜ
    88 * Author URI: https://www.konekt.ee
     
    1212 * Domain Path: /languages
    1313 * WC requires at least: 3.3
    14  * WC tested up to: 7.2
     14 * WC tested up to: 7.5.1
    1515 *
    1616 * @package Estonian_Shipping_Methods_For_WooCommerce
  • estonian-shipping-methods-for-woocommerce/trunk/includes/abstracts/class-wc-estonian-shipping-method-smartpost.php

    r2883818 r2884676  
    6262
    6363    /**
     64     * Prefix for terminal number in new system
     65     *
     66     * @var string
     67     */
     68    public $country_prefix = '01007';
     69
     70    /**
    6471     * Class constructor
    6572     */
     
    105112        return apply_filters( "wc_shipping_{$this->id}_terminals", $terminals, $this->get_shipping_country() );
    106113    }
     114
     115    /**
     116     * Get selected terminal ID from order meta
     117     *
     118     * @param  integer $order_id Order ID.
     119     *
     120     * @return integer           Selected terminal
     121     */
     122    public function get_order_terminal( $order_id ) {
     123        $order = wc_get_order( $order_id );
     124
     125        if ( $order ) {
     126            $terminal_id = $order->get_meta( $this->field_name, true );
     127
     128            if ( strlen( $terminal_id ) < 5 ) {
     129                return $this->get_prefixed_order_terminal( $terminal_id );
     130            }
     131        }
     132
     133        return false;
     134    }
     135
     136    /**
     137     * Prepend country prefix to terminal ID
     138     *
     139     * @param integer $terminal_id Terminal ID.
     140     *
     141     * @return integer
     142     */
     143    public function get_prefixed_order_terminal( $terminal_id ) {
     144        return $this->country_prefix . $terminal_id;
     145    }
    107146}
  • estonian-shipping-methods-for-woocommerce/trunk/includes/methods/class-wc-estonian-shipping-method-smartpost-estonia.php

    r2883818 r2884676  
    2424
    2525        // Set country.
    26         $this->country = 'EE';
     26        $this->country        = 'EE';
     27        $this->country_prefix = '01007';
    2728
    2829        // Add/merge form fields.
  • estonian-shipping-methods-for-woocommerce/trunk/includes/methods/class-wc-estonian-shipping-method-smartpost-finland.php

    r2883818 r2884676  
    2323        parent::__construct();
    2424
    25         $this->country = 'FI';
     25        // Set country.
     26        $this->country        = 'FI';
     27        $this->country_prefix = '';
    2628
    2729        // Add/merge form fields.
  • estonian-shipping-methods-for-woocommerce/trunk/includes/methods/class-wc-estonian-shipping-method-smartpost-latvia.php

    r2883818 r2884676  
    2424
    2525        // Set country.
    26         $this->country = 'LV';
     26        $this->country        = 'LV';
     27        $this->country_prefix = '01008';
    2728    }
    2829
  • estonian-shipping-methods-for-woocommerce/trunk/includes/methods/class-wc-estonian-shipping-method-smartpost-lithuania.php

    r2883818 r2884676  
    2424
    2525        // Set country.
    26         $this->country = 'LT';
     26        $this->country        = 'LT';
     27        $this->country_prefix = '01009';
    2728    }
    2829
  • estonian-shipping-methods-for-woocommerce/trunk/readme.txt

    r2883818 r2884676  
    44Requires at least: 4.1
    55Tested up to: 6.1.1
    6 Stable tag: 1.7
     6Stable tag: 1.7.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717*   Omniva parcel terminals (Estonia, Latvia, Lithuania)
    1818*   Omniva post offices (Estonia)
    19 *   SmartPOST parcel terminals (Estonia, Finland)
     19*   SmartPOST parcel terminals (Estonia, Finland, Latvia, Lithuania)
    2020*   SmartPOST courier
    2121*   Collect.net packrobots (Estonia)
     
    5252== Changelog ==
    5353
     54= 1.7.1 =
     55* Add support for older orders locations (SmartPost)
     56
    5457= 1.7 =
    5558* Use DPD API for pickup locations instead of soon-to-be-deprecated FTP json
    5659* Use Smartpost API for pickup locations
    5760* Add Smartpost Latvia
    58 * Add Smartpost Lithuanie
     61* Add Smartpost Lithuania
    5962
    6063= 1.6.2 =
Note: See TracChangeset for help on using the changeset viewer.