Changeset 3452463
- Timestamp:
- 02/03/2026 12:01:26 AM (8 weeks ago)
- Location:
- live-rates-for-shipstation
- Files:
-
- 10 edited
- 1 copied
-
tags/1.2.1 (copied) (copied from live-rates-for-shipstation/trunk)
-
tags/1.2.1/changelog.txt (modified) (1 diff)
-
tags/1.2.1/core/classes/shipping-calculator.php (modified) (8 diffs)
-
tags/1.2.1/core/settings-shipstation.php (modified) (1 diff)
-
tags/1.2.1/live-rates-for-shipstation.php (modified) (2 diffs)
-
tags/1.2.1/readme.txt (modified) (3 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/core/classes/shipping-calculator.php (modified) (8 diffs)
-
trunk/core/settings-shipstation.php (modified) (1 diff)
-
trunk/live-rates-for-shipstation.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
live-rates-for-shipstation/tags/1.2.1/changelog.txt
r3452263 r3452463 3 3 This is a brief text document keeping track of changes to the plugin. For a full history, see the Github Repository. 4 4 5 = 1.2.1 = 6 7 Relase Date: February 02, 2026. 8 9 * Overview 10 * Patches an issue where adjustments would overwrite the shipping cost. 11 * Thanks to use @nextphase for reporting this issue! 12 5 13 = 1.2.0 = 6 14 7 Relase Date: Eventually.15 Relase Date: February 02, 2026. 8 16 9 17 * Overview -
live-rates-for-shipstation/tags/1.2.1/core/classes/shipping-calculator.php
r3452263 r3452463 929 929 930 930 // Cost 931 $this->rates[ $hash ]['cost'][] = $rate['cost']; 932 931 $this->rates[ $hash ]['cost'] = array_merge( $this->rates[ $hash ]['cost'], (array)$rate['cost'] ); 932 933 // Metadata 933 934 if( ! empty( $this->rates[ $hash ]['meta_data'] ) ) { 934 935 … … 982 983 $wc_rate = array( 983 984 'label' => ( ! empty( $service_arr['nickname'] ) ) ? $service_arr['nickname'] : $shiprate['name'], 984 'cost' => floatval( $shiprate['cost']),985 'cost' => array( floatval( $shiprate['cost'] ) ), 985 986 'meta_data' => array( 986 987 'carrier' => $shiprate['carrier_name'], … … 1000 1001 if( 'individual' === $this->get( 'packing', 'individual' ) ) { 1001 1002 $quantity = $this->get_cartitem_val( array_key_first( $package ), 'quantity', 1 ); 1002 $wc_rate['cost'] = floatval( $shiprate['cost'] ) * absint( $quantity);1003 $wc_rate['cost'] = array( floatval( $shiprate['cost'] ) * absint( $quantity ) ); 1003 1004 $wc_rate['meta_data']['rates']['qty'] = $quantity; 1004 1005 } … … 1009 1010 // Add any Other Costs. 1010 1011 $this->process_other_adjustments( $wc_rate, $shiprate, $package ); 1011 1012 // Ensure the cost is an array.1013 $wc_rate['cost'] = (array)$wc_rate['cost'];1014 1012 1015 1013 return $wc_rate; … … 1032 1030 $service_arr = ( isset( $services[ $shiprate['carrier_id'] ] ) ) ? $services[ $shiprate['carrier_id'] ][ $shiprate['code'] ] : array(); 1033 1031 1034 // Service Specific - Could be 0.1035 if( isset( $service_arr['adjustment'] ) ) {1032 // Service Specific Adjustments 1033 if( ! empty( $service_arr['adjustment_type'] ) ) { 1036 1034 1037 1035 $adjustment = floatval( $service_arr['adjustment'] ); 1038 1036 $adjustment_type = ( isset( $service_arr['adjustment_type'] ) ) ? $service_arr['adjustment_type'] : 'percentage'; 1039 1037 1040 if( ! empty( $adjustment_type ) && $adjustment >0 ) {1038 if( $adjustment >= 0 ) { 1041 1039 1042 1040 $adjustment_cost = ( 'percentage' == $adjustment_type ) ? ( floatval( $shiprate['cost'] ) * ( floatval( $adjustment ) / 100 ) ) : floatval( $adjustment ); 1043 $wc_rate['cost'] = $adjustment_cost;1041 $wc_rate['cost'][] = $adjustment_cost; 1044 1042 $wc_rate['meta_data']['rates']['adjustment'] = array( 1045 1043 'type' => $adjustment_type, … … 1051 1049 1052 1050 // Global 1053 } else {1054 1055 $global_adjustment = floatval( $this->get( 'ssopt.global_a sjustment', 0 ) );1051 } else if( $this->get( 'ssopt.global_adjustment_type' ) ) { 1052 1053 $global_adjustment = floatval( $this->get( 'ssopt.global_adjustment', 0 ) ); 1056 1054 $global_adjustment_type = $this->get( 'ssopt.global_adjustment_type' ); 1057 $global_adjustment_type = ( empty( $global_adjustment_type ) && ! empty( $global_adjustment ) ) ? 'percentage' : $global_adjustment_type; 1058 1059 if( ! empty( $global_adjustment_type ) && $global_adjustment > 0 ) { 1055 1056 if( $global_adjustment > 0 ) { 1060 1057 1061 1058 $adjustment_cost = ( 'percentage' === $global_adjustment_type ) ? ( floatval( $shiprate['cost'] ) * ( floatval( $global_adjustment ) / 100 ) ) : floatval( $global_adjustment ); 1062 $wc_rate['cost'] = $adjustment_cost;1059 $wc_rate['cost'][] = $adjustment_cost; 1063 1060 $wc_rate['meta_data']['rates']['adjustment'] = array( 1064 1061 'type' => $global_adjustment_type, 1065 1062 'rate' => $global_adjustment, 1066 'cost' => $adjustment_cost,1067 1063 'global'=> true, 1068 1064 ); … … 1091 1087 foreach( $shiprate['other_costs'] as $slug => $cost_arr ) { 1092 1088 if( empty( $cost_arr['amount'] ) ) continue; 1093 $wc_rate['cost'] += floatval( $cost_arr['amount'] );1089 $wc_rate['cost'][] = floatval( $cost_arr['amount'] ); 1094 1090 $other[ $slug ] = $cost_arr['amount']; 1095 1091 } … … 1098 1094 // Maybe a package price 1099 1095 if( 'wc-box-packer' === $this->get( 'packing', 'individual' ) && isset( $package['price'] ) && ! empty( $package['price'] ) ) { 1100 $wc_rate['cost'] += floatval( $package['price'] );1096 $wc_rate['cost'][] = floatval( $package['price'] ); 1101 1097 $other['box_price'] = $package['price']; 1102 1098 } -
live-rates-for-shipstation/tags/1.2.1/core/settings-shipstation.php
r3452263 r3452463 287 287 public function append_shipstation_integration_settings( $fields ) { 288 288 289 if( ! ( isset( $_GET, $_GET['section'] ) && 'shipstation' === $_GET['section'] ) ) { 290 return; 291 } 292 289 293 $carriers = array( 290 294 '' => esc_html__( 'ShipStation carriers may still be loading...', 'live-rates-for-shipstation' ), -
live-rates-for-shipstation/tags/1.2.1/live-rates-for-shipstation.php
r3452263 r3452463 4 4 * Plugin URI: https://iqcomputing.com/contact/ 5 5 * Description: ShipStation shipping method with live rates. 6 * Version: 1.2. 06 * Version: 1.2.1 7 7 * Requires at least: 6.2 8 8 * Author: IQComputing … … 26 26 * @var String 27 27 */ 28 protected static $version = '1.2. 0';28 protected static $version = '1.2.1'; 29 29 30 30 -
live-rates-for-shipstation/tags/1.2.1/readme.txt
r3452263 r3452463 4 4 Requires at least: 5.9 5 5 Tested up to: 6.8 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 License: GPLv3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 51 51 == Changelog == 52 52 53 = 1.2.1 (2026-02-02) = 54 * Patches an issue with adjustments not adjusting. (Thanks @nextphase)! 55 53 56 = 1.2.0 (2026-02-02) = 54 57 * Adds Warehouse Support (Global and Zone based). … … 66 69 * Added verification to logs to prevent edge-case errors. 67 70 * Big Shipping Method changes coming in next version to account for Unit Tests. Calculations will move to their own class instance. See the experimental branch for more info. 68 69 = 1.1.1 (2025-12-04) =70 * Fixed JS conflict with WordPress 6.9 (nice!) -
live-rates-for-shipstation/trunk/changelog.txt
r3452263 r3452463 3 3 This is a brief text document keeping track of changes to the plugin. For a full history, see the Github Repository. 4 4 5 = 1.2.1 = 6 7 Relase Date: February 02, 2026. 8 9 * Overview 10 * Patches an issue where adjustments would overwrite the shipping cost. 11 * Thanks to use @nextphase for reporting this issue! 12 5 13 = 1.2.0 = 6 14 7 Relase Date: Eventually.15 Relase Date: February 02, 2026. 8 16 9 17 * Overview -
live-rates-for-shipstation/trunk/core/classes/shipping-calculator.php
r3452263 r3452463 929 929 930 930 // Cost 931 $this->rates[ $hash ]['cost'][] = $rate['cost']; 932 931 $this->rates[ $hash ]['cost'] = array_merge( $this->rates[ $hash ]['cost'], (array)$rate['cost'] ); 932 933 // Metadata 933 934 if( ! empty( $this->rates[ $hash ]['meta_data'] ) ) { 934 935 … … 982 983 $wc_rate = array( 983 984 'label' => ( ! empty( $service_arr['nickname'] ) ) ? $service_arr['nickname'] : $shiprate['name'], 984 'cost' => floatval( $shiprate['cost']),985 'cost' => array( floatval( $shiprate['cost'] ) ), 985 986 'meta_data' => array( 986 987 'carrier' => $shiprate['carrier_name'], … … 1000 1001 if( 'individual' === $this->get( 'packing', 'individual' ) ) { 1001 1002 $quantity = $this->get_cartitem_val( array_key_first( $package ), 'quantity', 1 ); 1002 $wc_rate['cost'] = floatval( $shiprate['cost'] ) * absint( $quantity);1003 $wc_rate['cost'] = array( floatval( $shiprate['cost'] ) * absint( $quantity ) ); 1003 1004 $wc_rate['meta_data']['rates']['qty'] = $quantity; 1004 1005 } … … 1009 1010 // Add any Other Costs. 1010 1011 $this->process_other_adjustments( $wc_rate, $shiprate, $package ); 1011 1012 // Ensure the cost is an array.1013 $wc_rate['cost'] = (array)$wc_rate['cost'];1014 1012 1015 1013 return $wc_rate; … … 1032 1030 $service_arr = ( isset( $services[ $shiprate['carrier_id'] ] ) ) ? $services[ $shiprate['carrier_id'] ][ $shiprate['code'] ] : array(); 1033 1031 1034 // Service Specific - Could be 0.1035 if( isset( $service_arr['adjustment'] ) ) {1032 // Service Specific Adjustments 1033 if( ! empty( $service_arr['adjustment_type'] ) ) { 1036 1034 1037 1035 $adjustment = floatval( $service_arr['adjustment'] ); 1038 1036 $adjustment_type = ( isset( $service_arr['adjustment_type'] ) ) ? $service_arr['adjustment_type'] : 'percentage'; 1039 1037 1040 if( ! empty( $adjustment_type ) && $adjustment >0 ) {1038 if( $adjustment >= 0 ) { 1041 1039 1042 1040 $adjustment_cost = ( 'percentage' == $adjustment_type ) ? ( floatval( $shiprate['cost'] ) * ( floatval( $adjustment ) / 100 ) ) : floatval( $adjustment ); 1043 $wc_rate['cost'] = $adjustment_cost;1041 $wc_rate['cost'][] = $adjustment_cost; 1044 1042 $wc_rate['meta_data']['rates']['adjustment'] = array( 1045 1043 'type' => $adjustment_type, … … 1051 1049 1052 1050 // Global 1053 } else {1054 1055 $global_adjustment = floatval( $this->get( 'ssopt.global_a sjustment', 0 ) );1051 } else if( $this->get( 'ssopt.global_adjustment_type' ) ) { 1052 1053 $global_adjustment = floatval( $this->get( 'ssopt.global_adjustment', 0 ) ); 1056 1054 $global_adjustment_type = $this->get( 'ssopt.global_adjustment_type' ); 1057 $global_adjustment_type = ( empty( $global_adjustment_type ) && ! empty( $global_adjustment ) ) ? 'percentage' : $global_adjustment_type; 1058 1059 if( ! empty( $global_adjustment_type ) && $global_adjustment > 0 ) { 1055 1056 if( $global_adjustment > 0 ) { 1060 1057 1061 1058 $adjustment_cost = ( 'percentage' === $global_adjustment_type ) ? ( floatval( $shiprate['cost'] ) * ( floatval( $global_adjustment ) / 100 ) ) : floatval( $global_adjustment ); 1062 $wc_rate['cost'] = $adjustment_cost;1059 $wc_rate['cost'][] = $adjustment_cost; 1063 1060 $wc_rate['meta_data']['rates']['adjustment'] = array( 1064 1061 'type' => $global_adjustment_type, 1065 1062 'rate' => $global_adjustment, 1066 'cost' => $adjustment_cost,1067 1063 'global'=> true, 1068 1064 ); … … 1091 1087 foreach( $shiprate['other_costs'] as $slug => $cost_arr ) { 1092 1088 if( empty( $cost_arr['amount'] ) ) continue; 1093 $wc_rate['cost'] += floatval( $cost_arr['amount'] );1089 $wc_rate['cost'][] = floatval( $cost_arr['amount'] ); 1094 1090 $other[ $slug ] = $cost_arr['amount']; 1095 1091 } … … 1098 1094 // Maybe a package price 1099 1095 if( 'wc-box-packer' === $this->get( 'packing', 'individual' ) && isset( $package['price'] ) && ! empty( $package['price'] ) ) { 1100 $wc_rate['cost'] += floatval( $package['price'] );1096 $wc_rate['cost'][] = floatval( $package['price'] ); 1101 1097 $other['box_price'] = $package['price']; 1102 1098 } -
live-rates-for-shipstation/trunk/core/settings-shipstation.php
r3452263 r3452463 287 287 public function append_shipstation_integration_settings( $fields ) { 288 288 289 if( ! ( isset( $_GET, $_GET['section'] ) && 'shipstation' === $_GET['section'] ) ) { 290 return; 291 } 292 289 293 $carriers = array( 290 294 '' => esc_html__( 'ShipStation carriers may still be loading...', 'live-rates-for-shipstation' ), -
live-rates-for-shipstation/trunk/live-rates-for-shipstation.php
r3452263 r3452463 4 4 * Plugin URI: https://iqcomputing.com/contact/ 5 5 * Description: ShipStation shipping method with live rates. 6 * Version: 1.2. 06 * Version: 1.2.1 7 7 * Requires at least: 6.2 8 8 * Author: IQComputing … … 26 26 * @var String 27 27 */ 28 protected static $version = '1.2. 0';28 protected static $version = '1.2.1'; 29 29 30 30 -
live-rates-for-shipstation/trunk/readme.txt
r3452263 r3452463 4 4 Requires at least: 5.9 5 5 Tested up to: 6.8 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 License: GPLv3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 51 51 == Changelog == 52 52 53 = 1.2.1 (2026-02-02) = 54 * Patches an issue with adjustments not adjusting. (Thanks @nextphase)! 55 53 56 = 1.2.0 (2026-02-02) = 54 57 * Adds Warehouse Support (Global and Zone based). … … 66 69 * Added verification to logs to prevent edge-case errors. 67 70 * Big Shipping Method changes coming in next version to account for Unit Tests. Calculations will move to their own class instance. See the experimental branch for more info. 68 69 = 1.1.1 (2025-12-04) =70 * Fixed JS conflict with WordPress 6.9 (nice!)
Note: See TracChangeset
for help on using the changeset viewer.