Plugin Directory

Changeset 3015313


Ignore:
Timestamp:
12/29/2023 04:11:00 AM (2 years ago)
Author:
shipdepot
Message:

Update version 1.2.9

Location:
ship-depot/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ship-depot/trunk/Ship_Depot_init.php

    r3014866 r3015313  
    55 * Plugin URI:        https://shipdepot.vn/
    66 * Description:       Ship Depot support shipping couriers in Vietnam like GHN, GHTK, AhaMove.
    7  * Version:           1.2.8
     7 * Version:           1.2.9
    88 * Author:            ShipDepot.vn
    99 * Text Domain:       ship-depot-translate
     
    3535
    3636if (!defined('SHIP_DEPOT_VERSION')) {
    37     define('SHIP_DEPOT_VERSION', '1.2.8');
     37    define('SHIP_DEPOT_VERSION', '1.2.9');
    3838}
    3939
  • ship-depot/trunk/helper/class-function-helper.php

    r3014867 r3015313  
    400400                    // Ship_Depot_Logger::wrlog('HPOS usage is enabled');
    401401                    // HPOS usage is enabled.
    402                     //Arrange meta boxes
     402                    // Arrange meta boxes
    403403                    return true;
    404404                } else {
  • ship-depot/trunk/includes/Address/class-address-helper.php

    r2999836 r3015313  
    77    if (!Ship_Depot_Helper::check_null_or_empty($json_provinces)) {
    88      $all_pros = json_decode($json_provinces);
     9      if ($all_pros != null) {
     10        foreach ($all_pros as $province) {
     11          (new self)->sort_districts($province);
     12        }
     13      }
    914      return $all_pros;
    1015    }
     
    2429    foreach ($all_province as $province) {
    2530      if ($province->Code == $province_code) {
     31        (new self)->sort_districts($province);
    2632        return $province;
    2733      }
     
    3642    foreach ($all_province as $province) {
    3743      if ($province->LocationISN == $province_isn) {
     44        (new self)->sort_districts($province);
    3845        return $province;
    3946      }
     
    4653    $province = self::get_province_by_id($province_code);
    4754    if (is_null($province) || !$province) return false;
    48     //Ship_Depot_Logger::wrlog('[get_all_district] districts: ' . print_r($province->ListDistricts, true));
     55    // Ship_Depot_Logger::wrlog('[get_all_district] districts: ' . print_r($province->ListDistricts, true));
    4956    return $province->ListDistricts;
    5057  }
     
    5461    $province = self::get_province_by_isn($province_isn);
    5562    if (is_null($province) || !$province) return false;
    56     //Ship_Depot_Logger::wrlog('[get_all_district] districts: ' . print_r($province->ListDistricts, true));
     63    // Ship_Depot_Logger::wrlog('[get_all_district_by_province_isn] districts: ' . print_r($province->ListDistricts, true));
    5764    return $province->ListDistricts;
    5865  }
     
    113120    $list_return = [];
    114121    if (is_null($list_object) || !$list_object) return $list_return;
    115     if($sortBigCT){
     122    if ($sortBigCT) {
    116123      $list_big_ct = [];
    117124      foreach ($list_object as $obj) {
    118         if(in_array($obj->Code, explode(',', BIG_CITY_CODE))){
     125        if (in_array($obj->Code, explode(',', BIG_CITY_CODE))) {
    119126          $list_big_ct[$obj->Code] = $obj->Name;
    120         }else{
     127        } else {
    121128          $list_return[$obj->Code] = $obj->Name;
    122129        }
    123130      }
    124131      $list_return = $list_big_ct + $list_return;
    125     }else{
     132    } else {
    126133      foreach ($list_object as $obj) {
    127134        $list_return[$obj->Code] = $obj->Name;
    128135      }
    129136    }
    130    
     137
    131138    //Ship_Depot_Logger::wrlog('[sanitize_address_to_array] list_return: ' . print_r($list_return, true));
    132139    return $list_return;
     
    177184    }
    178185  }
     186
     187  function sort_districts($province)
     188  {
     189    if ($province != null && $province->ListDistricts != null && count($province->ListDistricts) > 0)
     190      usort($province->ListDistricts, function ($a, $b) {
     191        return strcmp($b->Name, $a->Name);
     192      });
     193  }
    179194}
  • ship-depot/trunk/readme.txt

    r3014866 r3015313  
    55Tested up to: 6.4.2
    66Requires PHP: 7.4.3
    7 Stable tag: 1.2.8
     7Stable tag: 1.2.9
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565
    6666== Changelog ==
     67= 1.2.9 =
     68* Sắp xếp lại danh sách quận huyện.
     69
    6770= 1.2.8 =
    6871* Thêm chức năng tự động Ngừng kích hoạt (Deactive) plugin Ship Depot sau khi Ngừng kích hoạt plugin WooCommerce (Deactive).
Note: See TracChangeset for help on using the changeset viewer.