Plugin Directory

Changeset 2993025


Ignore:
Timestamp:
11/09/2023 09:39:53 AM (2 years ago)
Author:
shipdepot
Message:

Update version 1.2.1
Fix some bugs

Location:
ship-depot/trunk
Files:
6 edited

Legend:

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

    r2992887 r2993025  
    55 * Plugin URI:        https://shipdepot.vn/
    66 * Description:       Ship Depot support shipping couriers in Vietnam like GHN, GHTK, AhaMove.
    7  * Version:           1.2.0
     7 * Version:           1.2.1
    88 * Author:            ShipDepot.vn
    99 * Text Domain:       ship-depot-translate
     
    3535
    3636if (!defined('SHIP_DEPOT_VERSION')) {
    37     define('SHIP_DEPOT_VERSION', '1.2.0');
     37    define('SHIP_DEPOT_VERSION', '1.2.1');
    3838}
    3939
  • ship-depot/trunk/assets/js/admin-order-detail.js

    r2992960 r2993025  
    6565                    let json = ParseObjToHTMLJson(serv);
    6666                    inHTML += `<div class="service-fee-info">
    67                                             <input type="hidden" id="${serv.ServiceCode}" name="shipdepot[radio_shipping_fee][${serv.ServiceCode}]" value="${json}"/>
    68                                             <input type="radio" id="rd_${serv.ServiceCode}" name="shipdepot[radio_shipping_fee]" class="radio_shipping_fee${clss}" value="${serv.ServiceCode}" /> `;
     67                                    <input type="hidden" id="${serv.ServiceCode}" name="shipdepot[radio_shipping_fee][${serv.ServiceCode}]" value="${json}"/>
     68                                    <input type="radio" id="rd_${serv.ServiceCode}" name="shipdepot[radio_shipping_fee]" class="radio_shipping_fee${clss}" value="${serv.ServiceCode}" /> `;
    6969                    inHTML += `<div class="service-fee-description"><label for="rd_${serv.ServiceCode}" class="service-name">${serv.ServiceName}</label>`;
    7070                    let mainSFee = serv.ShopMarkupShippingFee.IsActive ? serv.ShopMarkupShippingFee : serv.ShipDepotMarkupShippingFee;
  • ship-depot/trunk/helper/class-default-data.php

    r2992892 r2993025  
    11<?php
    22defined('ABSPATH') || exit;
     3
     4use Automattic\WooCommerce\Utilities\OrderUtil;
    35
    46if (!class_exists('Ship_Depot_Default_Data')) {
  • ship-depot/trunk/helper/class-function-get-data.php

    r2992887 r2993025  
    193193        {
    194194            $cod_failed = new Ship_Depot_COD_Failed();
    195             $selected_courier = $this->get_selected_courier();
    196             if (is_null($this->post_data) || Ship_Depot_Helper::check_null_or_empty($selected_courier) || !isset($this->post_data['shipdepot']) || !isset($this->post_data['shipdepot'][$selected_courier]) || !isset($this->post_data['shipdepot'][$selected_courier]['courier_info'])) {
    197                 return $cod_failed;
    198             }
    199             $json_selected_courier = sanitize_text_field($this->post_data['shipdepot'][$selected_courier]['courier_info']);
    200             if (!Ship_Depot_Helper::check_null_or_empty($json_selected_courier)) {
    201                 $selected_courier_info = new Ship_Depot_Courier_Response(Ship_Depot_Helper::CleanJsonFromHTMLAndDecode($json_selected_courier));
    202                 $cod_failed = $selected_courier_info->CODFailed;
    203             }
     195            $setting_courier = json_decode(get_option('sd_setting_courier'));
     196            foreach ($setting_courier as $cour_obj) {
     197                $cour = new Ship_Depot_Courier($cour_obj);
     198                if ($cour->CourierID == GHN_COURIER_CODE) {
     199                    $cod_failed = $cour->CODFailed;
     200                    break;
     201                }
     202            }
     203            // $selected_courier = $this->get_selected_courier();
     204            // if (is_null($this->post_data) || Ship_Depot_Helper::check_null_or_empty($selected_courier) || !isset($this->post_data['shipdepot']) || !isset($this->post_data['shipdepot'][$selected_courier]) || !isset($this->post_data['shipdepot'][$selected_courier]['courier_info'])) {
     205            //     return $cod_failed;
     206            // }
     207            // $json_selected_courier = sanitize_text_field($this->post_data['shipdepot'][$selected_courier]['courier_info']);
     208            // if (!Ship_Depot_Helper::check_null_or_empty($json_selected_courier)) {
     209            //     $selected_courier_info = new Ship_Depot_Courier_Response(Ship_Depot_Helper::CleanJsonFromHTMLAndDecode($json_selected_courier));
     210            //     $cod_failed = $selected_courier_info->CODFailed;
     211            // }
    204212            return $cod_failed;
    205213        }
  • ship-depot/trunk/helper/class-function-helper.php

    r2992887 r2993025  
    193193            $output = wp_remote_retrieve_body($response);
    194194            $result = new stdClass();
    195             Ship_Depot_Logger::wrlog('[http_get] http_code: ' . print_r($http_code, true));
    196             Ship_Depot_Logger::wrlog('[http_get] output: ' . print_r($output, true));
     195            Ship_Depot_Logger::wrlog('[http_post] http_code: ' . print_r($http_code, true));
     196            Ship_Depot_Logger::wrlog('[http_post] output: ' . print_r($output, true));
    197197            if (is_wp_error($response)) {
    198198                Ship_Depot_Logger::wrlog("[http_post] Reponse WP Error.");
  • ship-depot/trunk/readme.txt

    r2992887 r2993025  
    55Tested up to: 6.3.2
    66Requires PHP: 7.4.3
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565
    6666== Changelog ==
     67= 1.2.1 =
     68* Sửa một số lỗi nhỏ.
     69
    6770= 1.2.0 =
    6871* Bổ sung hỗ trợ cho chức năng High-performance order storage của WooCommerce. 
Note: See TracChangeset for help on using the changeset viewer.