Plugin Directory

Changeset 3452463


Ignore:
Timestamp:
02/03/2026 12:01:26 AM (8 weeks ago)
Author:
IQComputing
Message:

Update to version 1.2.1 from GitHub

Location:
live-rates-for-shipstation
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • live-rates-for-shipstation/tags/1.2.1/changelog.txt

    r3452263 r3452463  
    33This is a brief text document keeping track of changes to the plugin. For a full history, see the Github Repository.
    44
     5= 1.2.1 =
     6
     7Relase 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
    513= 1.2.0 =
    614
    7 Relase Date: Eventually.
     15Relase Date: February 02, 2026.
    816
    917* Overview
  • live-rates-for-shipstation/tags/1.2.1/core/classes/shipping-calculator.php

    r3452263 r3452463  
    929929
    930930                    // 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
    933934                    if( ! empty( $this->rates[ $hash ]['meta_data'] ) ) {
    934935
     
    982983        $wc_rate = array(
    983984            'label'     => ( ! empty( $service_arr['nickname'] ) ) ? $service_arr['nickname'] : $shiprate['name'],
    984             'cost'      => floatval( $shiprate['cost'] ),
     985            'cost'      => array( floatval( $shiprate['cost'] ) ),
    985986            'meta_data' => array(
    986987                'carrier' => $shiprate['carrier_name'],
     
    10001001        if( 'individual' === $this->get( 'packing', 'individual' ) ) {
    10011002            $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 ) );
    10031004            $wc_rate['meta_data']['rates']['qty'] = $quantity;
    10041005        }
     
    10091010        // Add any Other Costs.
    10101011        $this->process_other_adjustments( $wc_rate, $shiprate, $package );
    1011 
    1012         // Ensure the cost is an array.
    1013         $wc_rate['cost'] = (array)$wc_rate['cost'];
    10141012
    10151013        return $wc_rate;
     
    10321030        $service_arr = ( isset( $services[ $shiprate['carrier_id'] ] ) ) ? $services[ $shiprate['carrier_id'] ][ $shiprate['code'] ] : array();
    10331031
    1034         // Service Specific - Could be 0.
    1035         if( isset( $service_arr['adjustment'] ) ) {
     1032        // Service Specific Adjustments
     1033        if( ! empty( $service_arr['adjustment_type'] ) ) {
    10361034
    10371035            $adjustment = floatval( $service_arr['adjustment'] );
    10381036            $adjustment_type = ( isset( $service_arr['adjustment_type'] ) ) ? $service_arr['adjustment_type'] : 'percentage';
    10391037
    1040             if( ! empty( $adjustment_type ) && $adjustment > 0 ) {
     1038            if( $adjustment >= 0 ) {
    10411039
    10421040                $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;
    10441042                $wc_rate['meta_data']['rates']['adjustment'] = array(
    10451043                    'type' => $adjustment_type,
     
    10511049
    10521050        // Global
    1053         } else {
    1054 
    1055             $global_adjustment      = floatval( $this->get( 'ssopt.global_asjustment', 0 ) );
     1051        } else if( $this->get( 'ssopt.global_adjustment_type' ) ) {
     1052
     1053            $global_adjustment      = floatval( $this->get( 'ssopt.global_adjustment', 0 ) );
    10561054            $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 ) {
    10601057
    10611058                $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;
    10631060                $wc_rate['meta_data']['rates']['adjustment'] = array(
    10641061                    'type' => $global_adjustment_type,
    10651062                    'rate' => $global_adjustment,
    1066                     'cost' => $adjustment_cost,
    10671063                    'global'=> true,
    10681064                );
     
    10911087            foreach( $shiprate['other_costs'] as $slug => $cost_arr ) {
    10921088                if( empty( $cost_arr['amount'] ) ) continue;
    1093                 $wc_rate['cost'] += floatval( $cost_arr['amount'] );
     1089                $wc_rate['cost'][] = floatval( $cost_arr['amount'] );
    10941090                $other[ $slug ] = $cost_arr['amount'];
    10951091            }
     
    10981094        // Maybe a package price
    10991095        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'] );
    11011097            $other['box_price'] = $package['price'];
    11021098        }
  • live-rates-for-shipstation/tags/1.2.1/core/settings-shipstation.php

    r3452263 r3452463  
    287287    public function append_shipstation_integration_settings( $fields ) {
    288288
     289        if( ! ( isset( $_GET, $_GET['section'] ) && 'shipstation' === $_GET['section'] ) ) {
     290            return;
     291        }
     292
    289293        $carriers = array(
    290294            '' => 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  
    44 * Plugin URI: https://iqcomputing.com/contact/
    55 * Description: ShipStation shipping method with live rates.
    6  * Version: 1.2.0
     6 * Version: 1.2.1
    77 * Requires at least: 6.2
    88 * Author: IQComputing
     
    2626     * @var String
    2727     */
    28     protected static $version = '1.2.0';
     28    protected static $version = '1.2.1';
    2929
    3030
  • live-rates-for-shipstation/tags/1.2.1/readme.txt

    r3452263 r3452463  
    44Requires at least: 5.9
    55Tested up to: 6.8
    6 Stable tag: 1.2.0
     6Stable tag: 1.2.1
    77License: GPLv3 or later
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5151== Changelog ==
    5252
     53= 1.2.1 (2026-02-02) =
     54* Patches an issue with adjustments not adjusting. (Thanks @nextphase)!
     55
    5356= 1.2.0 (2026-02-02) =
    5457* Adds Warehouse Support (Global and Zone based).
     
    6669* Added verification to logs to prevent edge-case errors.
    6770* 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  
    33This is a brief text document keeping track of changes to the plugin. For a full history, see the Github Repository.
    44
     5= 1.2.1 =
     6
     7Relase 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
    513= 1.2.0 =
    614
    7 Relase Date: Eventually.
     15Relase Date: February 02, 2026.
    816
    917* Overview
  • live-rates-for-shipstation/trunk/core/classes/shipping-calculator.php

    r3452263 r3452463  
    929929
    930930                    // 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
    933934                    if( ! empty( $this->rates[ $hash ]['meta_data'] ) ) {
    934935
     
    982983        $wc_rate = array(
    983984            'label'     => ( ! empty( $service_arr['nickname'] ) ) ? $service_arr['nickname'] : $shiprate['name'],
    984             'cost'      => floatval( $shiprate['cost'] ),
     985            'cost'      => array( floatval( $shiprate['cost'] ) ),
    985986            'meta_data' => array(
    986987                'carrier' => $shiprate['carrier_name'],
     
    10001001        if( 'individual' === $this->get( 'packing', 'individual' ) ) {
    10011002            $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 ) );
    10031004            $wc_rate['meta_data']['rates']['qty'] = $quantity;
    10041005        }
     
    10091010        // Add any Other Costs.
    10101011        $this->process_other_adjustments( $wc_rate, $shiprate, $package );
    1011 
    1012         // Ensure the cost is an array.
    1013         $wc_rate['cost'] = (array)$wc_rate['cost'];
    10141012
    10151013        return $wc_rate;
     
    10321030        $service_arr = ( isset( $services[ $shiprate['carrier_id'] ] ) ) ? $services[ $shiprate['carrier_id'] ][ $shiprate['code'] ] : array();
    10331031
    1034         // Service Specific - Could be 0.
    1035         if( isset( $service_arr['adjustment'] ) ) {
     1032        // Service Specific Adjustments
     1033        if( ! empty( $service_arr['adjustment_type'] ) ) {
    10361034
    10371035            $adjustment = floatval( $service_arr['adjustment'] );
    10381036            $adjustment_type = ( isset( $service_arr['adjustment_type'] ) ) ? $service_arr['adjustment_type'] : 'percentage';
    10391037
    1040             if( ! empty( $adjustment_type ) && $adjustment > 0 ) {
     1038            if( $adjustment >= 0 ) {
    10411039
    10421040                $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;
    10441042                $wc_rate['meta_data']['rates']['adjustment'] = array(
    10451043                    'type' => $adjustment_type,
     
    10511049
    10521050        // Global
    1053         } else {
    1054 
    1055             $global_adjustment      = floatval( $this->get( 'ssopt.global_asjustment', 0 ) );
     1051        } else if( $this->get( 'ssopt.global_adjustment_type' ) ) {
     1052
     1053            $global_adjustment      = floatval( $this->get( 'ssopt.global_adjustment', 0 ) );
    10561054            $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 ) {
    10601057
    10611058                $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;
    10631060                $wc_rate['meta_data']['rates']['adjustment'] = array(
    10641061                    'type' => $global_adjustment_type,
    10651062                    'rate' => $global_adjustment,
    1066                     'cost' => $adjustment_cost,
    10671063                    'global'=> true,
    10681064                );
     
    10911087            foreach( $shiprate['other_costs'] as $slug => $cost_arr ) {
    10921088                if( empty( $cost_arr['amount'] ) ) continue;
    1093                 $wc_rate['cost'] += floatval( $cost_arr['amount'] );
     1089                $wc_rate['cost'][] = floatval( $cost_arr['amount'] );
    10941090                $other[ $slug ] = $cost_arr['amount'];
    10951091            }
     
    10981094        // Maybe a package price
    10991095        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'] );
    11011097            $other['box_price'] = $package['price'];
    11021098        }
  • live-rates-for-shipstation/trunk/core/settings-shipstation.php

    r3452263 r3452463  
    287287    public function append_shipstation_integration_settings( $fields ) {
    288288
     289        if( ! ( isset( $_GET, $_GET['section'] ) && 'shipstation' === $_GET['section'] ) ) {
     290            return;
     291        }
     292
    289293        $carriers = array(
    290294            '' => esc_html__( 'ShipStation carriers may still be loading...', 'live-rates-for-shipstation' ),
  • live-rates-for-shipstation/trunk/live-rates-for-shipstation.php

    r3452263 r3452463  
    44 * Plugin URI: https://iqcomputing.com/contact/
    55 * Description: ShipStation shipping method with live rates.
    6  * Version: 1.2.0
     6 * Version: 1.2.1
    77 * Requires at least: 6.2
    88 * Author: IQComputing
     
    2626     * @var String
    2727     */
    28     protected static $version = '1.2.0';
     28    protected static $version = '1.2.1';
    2929
    3030
  • live-rates-for-shipstation/trunk/readme.txt

    r3452263 r3452463  
    44Requires at least: 5.9
    55Tested up to: 6.8
    6 Stable tag: 1.2.0
     6Stable tag: 1.2.1
    77License: GPLv3 or later
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5151== Changelog ==
    5252
     53= 1.2.1 (2026-02-02) =
     54* Patches an issue with adjustments not adjusting. (Thanks @nextphase)!
     55
    5356= 1.2.0 (2026-02-02) =
    5457* Adds Warehouse Support (Global and Zone based).
     
    6669* Added verification to logs to prevent edge-case errors.
    6770* 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.