Changeset 3204044
- Timestamp:
- 12/07/2024 11:34:10 AM (16 months ago)
- Location:
- cod24-shipping
- Files:
-
- 22 added
- 1 deleted
- 5 edited
-
tags/3.4.2/readme.txt (deleted)
-
tags/3.4.3 (added)
-
tags/3.4.3/assets (added)
-
tags/3.4.3/assets/css (added)
-
tags/3.4.3/assets/css/cod24-woo-admin.css (added)
-
tags/3.4.3/assets/css/sweetalert2.css (added)
-
tags/3.4.3/assets/index.php (added)
-
tags/3.4.3/assets/js (added)
-
tags/3.4.3/assets/js/city-select.js (added)
-
tags/3.4.3/assets/js/cod24-shcod-fee.js (added)
-
tags/3.4.3/assets/js/cod24-woo-admin.js (added)
-
tags/3.4.3/assets/js/sweetalert2.js (added)
-
tags/3.4.3/cod24-shipping.php (added)
-
tags/3.4.3/inc (added)
-
tags/3.4.3/inc/class-cod24-api.php (added)
-
tags/3.4.3/inc/class-cod24-pishtaz.php (added)
-
tags/3.4.3/inc/class-cod24-settings.php (added)
-
tags/3.4.3/inc/class-cod24-shcod.php (added)
-
tags/3.4.3/inc/class-cod24-special.php (added)
-
tags/3.4.3/inc/class-cod24-woo.php (added)
-
tags/3.4.3/inc/index.php (added)
-
tags/3.4.3/index.php (added)
-
tags/3.4.3/readme.txt (added)
-
trunk/assets/js/cod24-woo-admin.js (modified) (1 diff)
-
trunk/cod24-shipping.php (modified) (1 diff)
-
trunk/inc/class-cod24-api.php (modified) (2 diffs)
-
trunk/inc/class-cod24-woo.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cod24-shipping/trunk/assets/js/cod24-woo-admin.js
r3191219 r3204044 232 232 function getSelectedOrderIDs() { 233 233 var orderIDs = []; 234 $('input[name="id[]"]:checked ').each(function () {234 $('input[name="id[]"]:checked, input[name="post[]"]:checked').each(function () { 235 235 orderIDs.push($(this).val()); 236 236 }); 237 238 237 239 return orderIDs; 238 240 } -
cod24-shipping/trunk/cod24-shipping.php
r3199995 r3204044 3 3 Plugin Name: COD24 Shipping For Woocommerce 4 4 Description: This plugin is adding COD24 shipping methods to woocommerce. 5 Version: 3.4. 25 Version: 3.4.3 6 6 Author: COD24 7 7 Author URI: https://cod24.ir -
cod24-shipping/trunk/inc/class-cod24-api.php
r3191219 r3204044 866 866 867 867 $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'; 869 869 $body = []; 870 870 … … 998 998 public static function find_city( $user_city_name ) 999 999 { 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 1000 1005 $sanitize_user_city_name = self::sanitize_first_last_space_character( $user_city_name ); 1006 1001 1007 $data = self::get_all_cities(); 1002 1008 -
cod24-shipping/trunk/inc/class-cod24-woo.php
r3199995 r3204044 6 6 * Package: COD24 Shipping 7 7 * Author: COD24 8 * Last Modified Time: 2024/1 1/30 20:11:488 * Last Modified Time: 2024/12/04 00:20:50 9 9 * License: GPL-2.0+ 10 10 * License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 465 465 } 466 466 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 } 471 474 } 472 475 … … 480 483 } 481 484 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 } 488 494 } 489 495 … … 497 503 } 498 504 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 } 511 520 } 512 521 … … 520 529 } 521 530 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 } 526 538 } 527 539 -
cod24-shipping/trunk/readme.txt
r3199995 r3204044 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 3.4. 26 Stable tag: 3.4.3 7 7 License: GPL-2.0+ 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.