Plugin Directory

Changeset 2997508


Ignore:
Timestamp:
11/17/2023 09:46:29 AM (2 years ago)
Author:
shipdepot
Message:

Update version 1.2.2 fix some bugs

Location:
ship-depot/trunk
Files:
7 edited

Legend:

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

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

    r2938579 r2997508  
    5454  align-items: flex-start;
    5555  width: 100%;
     56  flex-wrap: wrap;
    5657}
    5758
    5859#shipping_fee_content div.courier-fee img {
    5960  width: var(--img-service-width);
    60   margin-top: 3px;
     61  margin: 5px 0 10px 0;
    6162}
    6263
  • ship-depot/trunk/helper/class-function-helper.php

    r2993025 r2997508  
    6060        {
    6161            if (!isset($valueCheck)) return true;
    62             if (is_null(($valueCheck) || empty($valueCheck))) return true;
    63             if (!$valueCheck) return true;
     62            if (is_null($valueCheck) || $valueCheck == '') return true;
    6463            return false;
    6564        }
  • ship-depot/trunk/includes/Settings/class-ship-depot-settings-backend.php

    r2992887 r2997508  
    419419                        }
    420420
    421                         Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $fee_index_id . ' data: ' . print_r(sanitize_text_field($_POST[$fee_index_id]), true));
     421                        Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $fee_index_id . ' data: ' . print_r(($_POST[$fee_index_id]), true));
    422422                        //Order conditions
    423423                        $fee->ListOrderConditions = [];
     
    425425                            foreach ($_POST[$fee_index_id]['if'] as $index => $id) {
    426426                                $if_id = sanitize_text_field($id);
    427                                 Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' data: ' . print_r(sanitize_text_field($_POST[$fee_index_id][$if_id]), true));
     427                                Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' data: ' . print_r(($_POST[$fee_index_id][$if_id]), true));
    428428                                $if = new Ship_Depot_Fee_Markup_Order_Condition();
    429429                                $idx = intval($index);
     
    432432                                switch ($if->Type) {
    433433                                    case "total_amount":
    434                                         $if->FromValue = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($_POST[$fee_index_id][$if_id]['from'])) ? -9999 : str_replace('.', '', sanitize_text_field($_POST[$fee_index_id][$if_id]['from']));
    435                                         $if->ToValue = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($_POST[$fee_index_id][$if_id]['to'])) ? -9999 : str_replace('.', '', sanitize_text_field($_POST[$fee_index_id][$if_id]['to']));
     434                                        $from = sanitize_text_field($_POST[$fee_index_id][$if_id]['from']);
     435                                        $to = sanitize_text_field($_POST[$fee_index_id][$if_id]['to']);
     436                                        Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' from: ' . print_r($from, true));
     437                                        Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' to: ' . print_r($to, true));
     438                                        Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' check_null_or_empty to: ' . print_r(Ship_Depot_Helper::check_null_or_empty(($to)), true));
     439                                        Ship_Depot_Logger::wrlog('[save_fee_modify] ' . $if_id . ' check_null_or_empty from: ' . print_r(Ship_Depot_Helper::check_null_or_empty(($from)), true));
     440                                        $if->FromValue = Ship_Depot_Helper::check_null_or_empty($from) ? -9999 : intval(str_replace('.', '', $from));
     441                                        $if->ToValue = Ship_Depot_Helper::check_null_or_empty($to) ? -9999 : intval(str_replace('.', '', $to));
    436442                                        break;
    437443                                    case "item_existed":
  • ship-depot/trunk/page/admin/settings/sd-couriers.php

    r2992887 r2997508  
    230230                    <!-- Ship from station -->
    231231                    <div class="row">
    232                         <div class="div-pick-station">
     232                        <div class="div-pick-station<?php echo $st_courier->IsUsed ? '' : ' disable-element' ?>">
    233233                            <input type="hidden" class="courier_data" name="<?php echo esc_attr($courier->CourierID) ?>[Data]" value="<?php echo esc_attr(Ship_Depot_Helper::ParseObjectToJsonHTML($courier_only)) ?>" />
    234234                            <p><?php esc_html_e('Hình thức gửi hàng', 'ship-depot-translate') ?></p>
  • ship-depot/trunk/readme.txt

    r2993025 r2997508  
    55Tested up to: 6.3.2
    66Requires PHP: 7.4.3
    7 Stable tag: 1.2.1
     7Stable tag: 1.2.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565
    6666== Changelog ==
     67= 1.2.2 =
     68* Sửa một số lỗi nhỏ.
     69
    6770= 1.2.1 =
    6871* Sửa một số lỗi nhỏ.
  • ship-depot/trunk/rest-api/class-shipdepot-webhook.php

    r2992887 r2997508  
    6060            ]);
    6161
    62             register_rest_route('shipdepot/webhook/v1', '/Test', [
    63                 'methods' => 'POST',
    64                 'callback' => [$this, 'sd_update_shipping_status'],
     62            register_rest_route('shipdepot/webhook/v1', '/PostHello', [
     63                'methods' => 'POST',
     64                'callback' => [$this, 'sd_post_hello'],
     65                'permission_callback' => '__return_true'
     66            ]);
     67
     68            register_rest_route('shipdepot/webhook/v1', '/GetHello', [
     69                'methods' => 'GET',
     70                'callback' => [$this, 'sd_get_hello'],
    6571                'permission_callback' => '__return_true'
    6672            ]);
     
    329335            return 'OK';
    330336        }
     337
     338        function sd_post_hello($request)
     339        {
     340            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_post_hello] Begin');
     341            $params = wp_parse_args($request->get_params(), '');
     342            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_post_hello] params: ' . print_r($params, true));
     343            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_post_hello] End');
     344
     345            nocache_headers();
     346            $result = new WP_REST_Response($params, 200);
     347            return $result;
     348        }
     349
     350        function sd_get_hello($request)
     351        {
     352            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_get_hello] Begin');
     353            $params = wp_parse_args($request->get_params(), '');
     354            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_get_hello] params: ' . print_r($params, true));
     355            Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_get_hello] End');
     356
     357            nocache_headers();
     358            $reponse = new stdClass();
     359            $reponse->message = 'ShipDepot Hello!';
     360            $reponse->params = $params;
     361            $result = new WP_REST_Response($reponse, 200);
     362            return $result;
     363        }
    331364    }
    332365    new Ship_Depot_Webhook();
Note: See TracChangeset for help on using the changeset viewer.