Plugin Directory

Changeset 3369389


Ignore:
Timestamp:
09/29/2025 03:30:07 AM (6 months ago)
Author:
freightexchange
Message:

Added the checks to stop calling the API if the destination postcode and suburb is missing

Location:
freightexchange/tags/1.8.12
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • freightexchange/tags/1.8.12/freight-exchange.php

    r2978445 r3369389  
    1919}
    2020if ( ! defined( 'FX_API_URL' ) ) {
    21     define("FX_API_URL",'https://portal-api.freightexchange.com.au/portal/api/v2/quote');
     21    define("FX_API_URL",'https://api.freightexchange.com.au/portal/api/v2/quote');
    2222}
    2323
     
    224224                // get shipping rates
    225225                public function freightexchange_api( $package, $saved_quoteId ) {
    226                    
     226                    $response_data = array();
    227227                    if ( empty( $package ) ) {
    228228                        return array();
     
    359359                    }
    360360                    fe_error_log($log_msg);
    361                    
     361                    if ( ! empty( $destination['city']) and ! empty( $destination['postcode'])) {
    362362                    $response_hooks = wp_remote_request( $send_url, array(
    363363                        'method'    => $api_method,
     
    372372                   
    373373                    $response_code = wp_remote_retrieve_response_code( $response_hooks );
    374                     $response_data = array();
     374                   
    375375                   
    376376                    if( 200 == $response_code ){
     
    385385                        fe_error_log( $log_msg );
    386386                    }
    387                    
     387                    }   
    388388                    return $response_data;
    389389                }
     390               
    390391            }
    391392        }
  • freightexchange/tags/1.8.12/readme.txt

    r3326055 r3369389  
    66Tested up to: 6.8
    77Requires PHP: 7.3
    8 Stable tag: 1.8.11
     8Stable tag: 1.8.12
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1081082023.09.05 - Version 1.8.11
    109109 * Tweak - Allowed Local Pickup Shipping options to be available always
     110
     1112025.09.26 - Version 1.8.12
     112 * Tweak - Added the checks to stop calling the API if the destination postcode and suburb is missing
    110113 
    111114== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.