Plugin Directory

Changeset 3204044


Ignore:
Timestamp:
12/07/2024 11:34:10 AM (16 months ago)
Author:
cod24
Message:
  • Bug fixes and improvemnets
Location:
cod24-shipping
Files:
22 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • cod24-shipping/trunk/assets/js/cod24-woo-admin.js

    r3191219 r3204044  
    232232    function getSelectedOrderIDs() {
    233233        var orderIDs = [];
    234         $('input[name="id[]"]:checked').each(function () {
     234        $('input[name="id[]"]:checked, input[name="post[]"]:checked').each(function () {
    235235            orderIDs.push($(this).val());
    236236        });
     237       
     238       
    237239        return orderIDs;
    238240    }
  • cod24-shipping/trunk/cod24-shipping.php

    r3199995 r3204044  
    33Plugin Name: COD24 Shipping For Woocommerce
    44Description: This plugin is adding COD24 shipping methods to woocommerce.
    5 Version: 3.4.2
     5Version: 3.4.3
    66Author: COD24
    77Author URI: https://cod24.ir
  • cod24-shipping/trunk/inc/class-cod24-api.php

    r3191219 r3204044  
    866866           
    867867            $api_protocol = ( get_option('cod24_shipping_api_secure_connection_enabled')=='yes' ) ? 'https://' : 'http://';
    868             $url  = $api_protocol.'cod24-learn.s3.ir-thr-at1.arvanstorage.ir/Cities.json';
     868            $url  = $api_protocol.'apicod24.s3.ir-thr-at1.arvanstorage.ir/Cities.json';
    869869            $body = [];
    870870
     
    998998        public static function find_city( $user_city_name )
    999999        {
     1000            // convert user city characters from arabic to persian
     1001            $arabic = array('ي', 'ك');
     1002            $farsi = array('ی', 'ک');
     1003            $user_city_name=str_replace($arabic, $farsi, $user_city_name);
     1004       
    10001005            $sanitize_user_city_name = self::sanitize_first_last_space_character( $user_city_name );
     1006       
    10011007            $data = self::get_all_cities();
    10021008
  • cod24-shipping/trunk/inc/class-cod24-woo.php

    r3199995 r3204044  
    66 * Package: COD24 Shipping
    77 * Author: COD24
    8  * Last Modified Time: 2024/11/30 20:11:48
     8 * Last Modified Time: 2024/12/04 00:20:50
    99 * License: GPL-2.0+
    1010 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    465465            }
    466466
    467             $user_total_weight = floatval( sanitize_text_field( $_POST['total_weight'] ) );
    468             $order = wc_get_order( $order_id );
    469             $order->update_meta_data( '_custom_total_weight', $user_total_weight );
    470             $order->save();
     467            if( isset( $_POST['total_weight'] ) && !empty( $_POST['total_weight'] ) )
     468            {
     469                $user_total_weight = floatval( sanitize_text_field( $_POST['total_weight'] ) );
     470                $order = wc_get_order( $order_id );
     471                $order->update_meta_data( '_custom_total_weight', $user_total_weight );
     472                $order->save();
     473            }
    471474        }
    472475       
     
    480483            }
    481484           
    482             $order = wc_get_order( $order_id );
    483             if( isset( $_POST['non_standard_package'] ) && sanitize_text_field( $_POST['non_standard_package'] ) == 'yes' )
    484                 $order->update_meta_data( '_cod24_non_standard_package', 'yes' );
    485             else
    486                 $order->update_meta_data( '_cod24_non_standard_package', 'no' );
    487             $order->save();
     485            if( isset( $_POST['non_standard_package'] ) && !empty( $_POST['non_standard_package'] ) )
     486            {
     487                $order = wc_get_order( $order_id );
     488                if( isset( $_POST['non_standard_package'] ) && sanitize_text_field( $_POST['non_standard_package'] ) == 'yes' )
     489                    $order->update_meta_data( '_cod24_non_standard_package', 'yes' );
     490                else
     491                    $order->update_meta_data( '_cod24_non_standard_package', 'no' );
     492                $order->save();
     493            }
    488494        }
    489495
     
    497503            }
    498504
    499             $order = wc_get_order( $order_id );
    500             $carton_sizes = COD24_API::get_carton_sizes();
    501             $user_carton_size = sanitize_text_field( $_POST['carton_size'] );
    502             if( in_array( $user_carton_size, array_keys( $carton_sizes ) ) )
    503             {
    504                 $order->update_meta_data( '_cod24_carton_size', $user_carton_size );
    505             }
    506             else
    507             {
    508                 $order->update_meta_data( '_cod24_carton_size', $user_carton_size );
    509             }
    510             $order->save();
     505            if( isset( $_POST['carton_size'] ) && !empty( $_POST['carton_size'] ) && sanitize_text_field( $_POST['carton_size'] ) != 'none' )
     506            {
     507                $order = wc_get_order( $order_id );
     508                $carton_sizes = COD24_API::get_carton_sizes();
     509                $user_carton_size = sanitize_text_field( $_POST['carton_size'] );
     510                if( in_array( $user_carton_size, array_keys( $carton_sizes ) ) )
     511                {
     512                    $order->update_meta_data( '_cod24_carton_size', $user_carton_size );
     513                }
     514                else
     515                {
     516                    $order->update_meta_data( '_cod24_carton_size', $user_carton_size );
     517                }
     518                $order->save();
     519            }
    511520        }
    512521
     
    520529            }
    521530
    522             $order = wc_get_order( $order_id );
    523             $user_content_parcel = wp_kses_post( $_POST['content_parcel'] );
    524             $order->update_meta_data( '_cod24_content_parcel', $user_content_parcel );
    525             $order->save();
     531            if( isset( $_POST['content_parcel'] ) && !empty( $_POST['content_parcel'] ) )
     532            {
     533                $order = wc_get_order( $order_id );
     534                $user_content_parcel = wp_kses_post( $_POST['content_parcel'] );
     535                $order->update_meta_data( '_cod24_content_parcel', $user_content_parcel );
     536                $order->save();
     537            }
    526538        }
    527539
  • cod24-shipping/trunk/readme.txt

    r3199995 r3204044  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 3.4.2
     6Stable tag: 3.4.3
    77License: GPL-2.0+
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.