Plugin Directory

Changeset 3465519


Ignore:
Timestamp:
02/20/2026 06:10:17 AM (6 weeks ago)
Author:
enituretechnology
Message:

1.2.11 - 2026-02-20

  • Update: Added a dropdown setting to support both Legacy API and New API selection within the plugin settings.

Ticket 41254731381

Location:
ltl-freight-quotes-tql-edition
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ltl-freight-quotes-tql-edition/tags/1.2.11/admin/assets/en-tql-admin.css

    r3454346 r3465519  
    8585}
    8686
    87 .en_connection_error {
     87#en_tql_connection_settings .en_connection_error {
    8888    color: #ff0000;
    8989    font-size: 13px;
    9090    font-weight: normal !important;
    9191    padding-left: 10px;
    92 }
     92    display: inline-block;
     93    margin-top: 10px;
     94}
     95
    9396label[for="en_connection_settings_client_id_tql"]:after,
    9497label[for="en_connection_settings_trax_username_tql"]:after,
    9598label[for="en_connection_settings_trax_password_tql"]:after,
    9699label[for="en_connection_settings_subscription_key_tql"]:after,
    97 label[for="en_connection_settings_license_key_tql"]:after {
     100label[for="en_connection_settings_license_key_tql"]:after,
     101label[for="en_connection_settings_old_api_client_id_tql"]:after,
     102label[for="en_connection_settings_old_api_client_secret_tql"]:after,
     103label[for="en_connection_settings_old_api_trax_username_tql"]:after,
     104label[for="en_connection_settings_old_api_trax_password_tql"]:after,
     105label[for="en_connection_settings_old_api_subscription_key_tql"]:after {
    98106    content: " *";
    99107    color: red;
  • ltl-freight-quotes-tql-edition/tags/1.2.11/admin/assets/en-tql-admin.js

    r3454346 r3465519  
    141141    // Connection Settings Tab
    142142    if (jQuery('#en_tql_connection_settings').length > 0) {
    143         jQuery('#en_connection_settings_client_id_tql').attr('title', 'Client Id');
    144         jQuery('#en_connection_settings_trax_username_tql').attr('title', 'Trax Username');
    145         jQuery('#en_connection_settings_trax_password_tql').attr('title', 'Trax Password');
    146         jQuery('#en_connection_settings_subscription_key_tql').attr('title', 'Subscription Key');
     143        jQuery('#en_connection_settings_client_id_tql, #en_connection_settings_old_api_client_id_tql').attr('title', 'Client ID');
     144        jQuery('#en_connection_settings_old_api_client_secret_tql').attr('title', 'Client Secret');
     145        jQuery('#en_connection_settings_trax_username_tql, #en_connection_settings_old_api_trax_username_tql').attr('title', 'Username');
     146        jQuery('#en_connection_settings_trax_password_tql, #en_connection_settings_old_api_trax_password_tql').attr('title', 'Password');
     147        jQuery('#en_connection_settings_subscription_key_tql, #en_connection_settings_old_api_subscription_key_tql').attr('title', 'Subscription Key');
    147148        jQuery('#en_connection_settings_license_key_tql').attr('title', 'Eniture API Key');
    148149
     
    173174            if (event.target.id == 'en_tql_test_connection') {
    174175                let connection_fields = jQuery('#en_tql_connection_settings input').serialize();
    175                 let client_id = jQuery('#en_connection_settings_client_id_tql').val();
    176                 let user_name = jQuery('#en_connection_settings_trax_username_tql').val();
    177                 let password = jQuery('#en_connection_settings_trax_password_tql').val();
    178                 let subscription_key = jQuery('#en_connection_settings_subscription_key_tql').val();
    179                 let license_key = jQuery('#en_connection_settings_license_key_tql').val();
    180 
    181                 var dataString = 'en_connection_settings_client_id_tql=' + client_id
     176                const api_selected = jQuery('#en_connection_settings_api_tql').val();
     177                const api_prefix = api_selected == 'tql_old_api' ? 'old_api_' : '';
     178                const client_id = jQuery(`#en_connection_settings_${api_prefix}client_id_tql`).val();
     179                const client_secret = jQuery(`#en_connection_settings_${api_prefix}client_secret_tql`).val();
     180                const user_name = jQuery(`#en_connection_settings_${api_prefix}trax_username_tql`).val();
     181                const password = jQuery(`#en_connection_settings_${api_prefix}trax_password_tql`).val();
     182                const subscription_key = jQuery(`#en_connection_settings_${api_prefix}subscription_key_tql`).val();
     183                const license_key = jQuery('#en_connection_settings_license_key_tql').val();
     184
     185                let dataString = 'en_connection_settings_client_id_tql=' + client_id
    182186                    + '&en_connection_settings_trax_username_tql=' + user_name
    183187                    + '&en_connection_settings_trax_password_tql=' + password
    184188                    + '&en_connection_settings_subscription_key_tql=' + subscription_key
    185                     + '&en_connection_settings_license_key_tql=' + license_key;
    186                 let postForm = {
     189                    + '&en_connection_settings_license_key_tql=' + license_key
     190                    + '&en_connection_settings_api_tql=' + api_selected;
     191
     192                if (api_selected == 'tql_old_api') {
     193                    dataString += '&en_connection_settings_old_api_client_secret_tql=' + client_secret;
     194                }
     195
     196                const postForm = {
    187197                    'action': 'en_tql_test_connection',
    188198                    'en_post_data': dataString,
     
    190200                };
    191201
    192                 let params = {
    193                     en_ajax_loading_id: '#en_connection_settings_client_id_tql,#en_connection_settings_trax_username_tql,#en_connection_settings_trax_password_tql,#en_connection_settings_subscription_key_tql,#en_connection_settings_license_key_tql',
     202                const params = {
     203                    en_ajax_loading_id: '#en_connection_settings_client_id_tql,#en_connection_settings_trax_username_tql,#en_connection_settings_trax_password_tql,#en_connection_settings_subscription_key_tql,#en_connection_settings_license_key_tql, #en_connection_settings_old_api_client_id_tql, #en_connection_settings_old_api_client_secret_tql, #en_connection_settings_old_api_trax_username_tql, #en_connection_settings_old_api_trax_password_tql, #en_connection_settings_old_api_subscription_key_tql',
    194204                };
    195205
     
    310320    // Cut-off time and shipment offset days settings
    311321    tqlCutOffTimeAndShipDateSettings();
     322    // New API
     323    tqlHandleAPISelection();
     324    jQuery('#en_connection_settings_api_tql').on('change', tqlHandleAPISelection);
    312325});
    313326
     
    864877    }
    865878}
     879
     880if (typeof tqlHandleAPISelection != 'function') {
     881    function tqlHandleAPISelection() {
     882        const apiTql = jQuery('#en_connection_settings_api_tql').val();
     883   
     884        if (apiTql == 'tql_new_api') {
     885            jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', '');
     886            jQuery('.en_connection_settings_new_api_fields')
     887                .removeAttr('data-optional')
     888                .removeAttr('optional')
     889                .removeData('optional');
     890   
     891            jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', 'none');
     892            jQuery('.en_connection_settings_old_api_fields')
     893                .attr('data-optional', 1)
     894                .attr('optional', 1)
     895                .data('optional', 1);
     896        } else {
     897            jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', '');
     898            jQuery('.en_connection_settings_old_api_fields')
     899                .removeAttr('data-optional')
     900                .removeAttr('optional')
     901                .removeData('optional');
     902           
     903            jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', 'none');
     904            jQuery('.en_connection_settings_new_api_fields')
     905                .attr('data-optional', 1)
     906                .attr('optional', 1)
     907                .data('optional', 1);
     908        }
     909    }
     910}
  • ltl-freight-quotes-tql-edition/tags/1.2.11/admin/tab/connection-settings/en-connection-ajax.php

    r3454346 r3465519  
    4747            }
    4848
     49            if (isset($en_connection_request['api']) && $en_connection_request['api'] == 'tql_new_api') {
     50                unset($en_connection_request['clientSecret']);
     51            }
     52           
     53            unset($en_connection_request['_clientId'], $en_connection_request['_username'], $en_connection_request['_password'], $en_connection_request['_subscriptionKey'], $en_connection_request['api']);
     54
    4955            $en_connection_request['carrierMode'] = 'test';
    5056            $en_connection_request = apply_filters('en_tql_add_connection_request', $en_connection_request);
  • ltl-freight-quotes-tql-edition/tags/1.2.11/admin/tab/connection-settings/en-connection-settings.php

    r3454346 r3465519  
    6666                    self::$get_connection_details[$value['eniture_action']] = $saved_connection_detail : '';
    6767            }
     68
     69            if (isset($connection_request['api']) && $connection_request['api'] == 'tql_new_api') {
     70                unset($connection_request['clientSecret']);
     71            }
     72           
     73            unset($connection_request['_clientId'], $connection_request['_username'], $connection_request['_password'], $connection_request['_subscriptionKey'], $connection_request['api']);
    6874
    6975            add_filter('en_tql_reason_quotes_not_returned', [__CLASS__, 'en_tql_reason_quotes_not_returned'], 99, 1);
     
    112118        static public function en_set_connection_settings_detail()
    113119        {
     120            if (empty(get_option('en_connection_settings_api_tql'))) {
     121                update_option('en_connection_settings_api_tql', 'tql_new_api');
     122            }
     123
    114124            return
    115125                [
     126                    'en_connection_settings_api_tql' => array(
     127                        'eniture_action' => 'api',
     128                        'name' => __('Which API will you connect to? ', 'woocommerce-settings-tql'),
     129                        'type' => 'select',
     130                        'default' => 'tql_new_api',
     131                        'id' => 'en_connection_settings_api_tql',
     132                        'options' => array(
     133                            'tql_old_api' => __('Legacy API', 'woocommerce-settings-tql'),
     134                            'tql_new_api' => __('New API', 'woocommerce-settings-tql'),
     135                        )
     136                    ),
     137
     138                    // Old API
     139                    'en_connection_settings_old_api_client_id_tql' => [
     140                        'eniture_action' => '_clientId',
     141                        'name' => __('Client ID ', 'woocommerce-settings-tql'),
     142                        'type' => 'text',
     143                        'id' => 'en_connection_settings_old_api_client_id_tql',
     144                        'class' => 'en_connection_settings_old_api_fields'
     145                    ],
     146                    'en_connection_settings_old_api_client_secret_tql' => [
     147                        'eniture_action' => 'clientSecret',
     148                        'name' => __('Client Secret ', 'woocommerce-settings-tql'),
     149                        'type' => 'text',
     150                        'id' => 'en_connection_settings_old_api_client_secret_tql',
     151                        'class' => 'en_connection_settings_old_api_fields'
     152                    ],
     153                    'en_connection_settings_old_api_username_tql' => [
     154                        'eniture_action' => '_username',
     155                        'name' => __('Username ', 'woocommerce-settings-tql'),
     156                        'type' => 'text',
     157                        'id' => 'en_connection_settings_old_api_trax_username_tql',
     158                        'class' => 'en_connection_settings_old_api_fields'
     159                    ],
     160                    'en_connection_settings_old_api_password_tql' => [
     161                        'eniture_action' => '_password',
     162                        'name' => __('Password ', 'woocommerce-settings-tql'),
     163                        'type' => 'text',
     164                        'id' => 'en_connection_settings_old_api_trax_password_tql',
     165                        'class' => 'en_connection_settings_old_api_fields'
     166                    ],
     167                    'en_connection_settings_old_api_subscription_key_tql' => [
     168                        'eniture_action' => '_subscriptionKey',
     169                        'name' => __('Subscription Key ', 'woocommerce-settings-tql'),
     170                        'type' => 'text',
     171                        'id' => 'en_connection_settings_old_api_subscription_key_tql',
     172                        'class' => 'en_connection_settings_old_api_fields'
     173                    ],
     174
     175                    // New API
    116176                    'en_connection_settings_client_id_tql' => [
    117177                        'eniture_action' => 'clientId',
    118                         'name' => __('Client Id ', 'woocommerce-settings-tql'),
    119                         'type' => 'text',
    120                         'desc' => __('', 'woocommerce-settings-tql'),
    121                         'id' => 'en_connection_settings_client_id_tql'
     178                        'name' => __('Client ID ', 'woocommerce-settings-tql'),
     179                        'type' => 'text',
     180                        'desc' => __('', 'woocommerce-settings-tql'),
     181                        'id' => 'en_connection_settings_client_id_tql',
     182                        'class' => 'en_connection_settings_new_api_fields'
    122183                    ],
    123184                    'en_connection_settings_trax_username_tql' => [
    124185                        'eniture_action' => 'traxUsername',
    125                         'name' => __('Trax Username ', 'woocommerce-settings-tql'),
    126                         'type' => 'text',
    127                         'desc' => __('', 'woocommerce-settings-tql'),
    128                         'id' => 'en_connection_settings_trax_username_tql'
     186                        'name' => __('Username ', 'woocommerce-settings-tql'),
     187                        'type' => 'text',
     188                        'desc' => __('', 'woocommerce-settings-tql'),
     189                        'id' => 'en_connection_settings_trax_username_tql',
     190                        'class' => 'en_connection_settings_new_api_fields'
    129191                    ],
    130192                    'en_connection_settings_trax_password_tql' => [
    131193                        'eniture_action' => 'traxPassword',
    132                         'name' => __('Trax Password ', 'woocommerce-settings-tql'),
    133                         'type' => 'text',
    134                         'desc' => __('', 'woocommerce-settings-tql'),
    135                         'id' => 'en_connection_settings_trax_password_tql'
     194                        'name' => __('Password ', 'woocommerce-settings-tql'),
     195                        'type' => 'text',
     196                        'desc' => __('', 'woocommerce-settings-tql'),
     197                        'id' => 'en_connection_settings_trax_password_tql',
     198                        'class' => 'en_connection_settings_new_api_fields'
    136199                    ],
    137200                    'en_connection_settings_subscription_key_tql' => [
     
    140203                        'type' => 'text',
    141204                        'desc' => __('', 'woocommerce-settings-tql'),
    142                         'id' => 'en_connection_settings_subscription_key_tql'
     205                        'id' => 'en_connection_settings_subscription_key_tql',
     206                        'class' => 'en_connection_settings_new_api_fields'
    143207                    ],
    144208                    'en_connection_settings_license_key_tql' => [
  • ltl-freight-quotes-tql-edition/tags/1.2.11/admin/tab/location/includes/en-location-ajax.php

    r3454346 r3465519  
    179179                parse_str($fullstring, $post_data);
    180180                if (isset($post_data['en_wd_origin_markup'])) {
    181                     $post_data['en_wd_origin_markup'] = str_replace('%25', '%', $post_data['en_wd_origin_markup']);
     181                    $post_data['origin_markup'] = str_replace('%25', '%', $post_data['en_wd_origin_markup']);
     182                    unset($post_data['en_wd_origin_markup']);
    182183                }
    183184            }
     
    188189            (!isset($post_data['suppress_local_delivery'])) ? $post_data['suppress_local_delivery'] = 'no' : '';
    189190
    190            
    191             $post_data['origin_markup'] = isset($temp['en_wd_origin_markup']) ? $temp['en_wd_origin_markup'] : '';
    192             unset($post_data['en_wd_origin_markup']);
    193191            $resi_lfg_pickup = ['residential_pickup_parcel', 'residential_pickup', 'liftgate_pickup'];
    194192            foreach ($resi_lfg_pickup as $value) {
  • ltl-freight-quotes-tql-edition/tags/1.2.11/en-install.php

    r3454346 r3465519  
    5454        ]);
    5555
    56         wp_enqueue_script('EnTqlAdminJs', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.js', [], '1.0.7');
     56        wp_enqueue_script('EnTqlAdminJs', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.js', [], '1.0.8');
    5757        wp_localize_script('EnTqlAdminJs', 'en_tql_admin_script', [
    5858            'pluginsUrl' => EN_TQL_PLUGIN_URL,
     
    7676        wp_enqueue_style('EnTqlLocationStyle');
    7777
    78         wp_register_style('EnTqlAdminCss', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.css', false, '1.0.7');
     78        wp_register_style('EnTqlAdminCss', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.css', false, '1.0.8');
    7979        wp_enqueue_style('EnTqlAdminCss');
    8080
  • ltl-freight-quotes-tql-edition/tags/1.2.11/http/en-curl.php

    r3454346 r3465519  
    170170
    171171            $cachable_data['clientId'] = isset($request_data['clientId']) ? $request_data['clientId'] : '';
     172            $cachable_data['clientSecret'] = isset($request_data['clientSecret']) ? $request_data['clientSecret'] : '';
    172173            $cachable_data['traxUsername'] = isset($request_data['traxUsername']) ? $request_data['traxUsername'] : '';
    173174            $cachable_data['traxPassword'] = isset($request_data['traxPassword']) ? $request_data['traxPassword'] : '';
  • ltl-freight-quotes-tql-edition/tags/1.2.11/ltl-freight-quotes-tql-edition.php

    r3454354 r3465519  
    44 * Plugin URI: https://eniture.com/products/
    55 * Description: Dynamically retrieves your negotiated shipping rates from TQL and displays the results in the WooCommerce shopping cart.
    6  * Version: 1.2.10
     6 * Version: 1.2.11
    77 * Author: Eniture Technology
    88 * Author URI: http://eniture.com/
  • ltl-freight-quotes-tql-edition/tags/1.2.11/readme.txt

    r3454354 r3465519  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 1.2.10
     6Stable tag: 1.2.11
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    147147== Changelog ==
    148148
     149= 1.2.11 - 2026-02-20 =
     150* Update: Added a dropdown setting to support both Legacy API and New API selection within the plugin settings.
     151
    149152= 1.2.10 - 2026-02-05 =
    150153* Update: Introduced **bulk delete functionality** for warehouse and dropship locations to simplify location management.
  • ltl-freight-quotes-tql-edition/tags/1.2.11/server/api/en-response.php

    r3454346 r3465519  
    140140                }
    141141
    142                 self::en_arrange_rates(self::en_sanitize_rate('q', []), $origin_level_markup, $product_level_markup);
     142                self::en_arrange_rates(self::en_sanitize_rate('q', []), $origin_level_markup, $product_level_markup, $key);
    143143            }
    144144
     
    261261         * @param array $rates
    262262         */
    263         static public function en_arrange_rates($rates, $origin_level_markup = '', $product_level_markup = '')
     263        static public function en_arrange_rates($rates, $origin_level_markup = '', $product_level_markup = '', $shipment_zip = '')
    264264        {
    265265            $en_rates = [];
     
    301301                $en_total_net_charge = self::en_sanitize_rate('customerRate', 0);
    302302                $carrier_scac = self::en_sanitize_rate('scac', '');
    303                 if ($en_total_net_charge > 0 && in_array($carrier_scac, $enable_carriers)) {
     303                $standard_service = self::en_sanitize_rate('serviceLevel', '') == 'Standard';
     304                if ($en_total_net_charge > 0 && in_array($carrier_scac, $enable_carriers) && $standard_service) {
    304305                   
    305306                    // Product level markup
     
    419420                            $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['en_fdo_meta_data']['accessorials']['notify'] = true;
    420421                        }
    421                         if (in_array('H', $accessorial)) {
     422                        if (in_array('H', $accessorial) && isset(self::$en_package['hazmat'][$shipment_zip]) && self::$en_package['hazmat'][$shipment_zip]) {
    422423                            $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['en_fdo_meta_data']['accessorials']['hazmat'] = true;
    423424                        }
  • ltl-freight-quotes-tql-edition/tags/1.2.11/server/package/en-package.php

    r3454346 r3465519  
    189189                        }
    190190                    }
     191
    191192                    foreach ($en_product_fields as $en_field_key => $en_custom_product) {
    192193
    193194                        self::$en_step_for_package = $en_custom_product;
    194 
    195195                        self::$product_key_name = self::en_sanitize_package('id', '');
    196196
     
    212212                            (!is_array($en_location_value) &&
    213213                                    strlen($en_location_value) > EN_TQL_DECLARED_ZERO) ? $product_item[$is_line_item] = $en_location_value : "";
     214
     215                            if ($is_line_item == 'isHazmatLineItem' && $en_location_value == 'Y') {
     216                                self::$en_request['hazmat'][$origin_zip_code] = EN_TQL_DECLARED_TRUE;
     217                            }
    214218
    215219                            if (isset($en_location_value['senderZip']) &&
  • ltl-freight-quotes-tql-edition/trunk/admin/assets/en-tql-admin.css

    r3454346 r3465519  
    8585}
    8686
    87 .en_connection_error {
     87#en_tql_connection_settings .en_connection_error {
    8888    color: #ff0000;
    8989    font-size: 13px;
    9090    font-weight: normal !important;
    9191    padding-left: 10px;
    92 }
     92    display: inline-block;
     93    margin-top: 10px;
     94}
     95
    9396label[for="en_connection_settings_client_id_tql"]:after,
    9497label[for="en_connection_settings_trax_username_tql"]:after,
    9598label[for="en_connection_settings_trax_password_tql"]:after,
    9699label[for="en_connection_settings_subscription_key_tql"]:after,
    97 label[for="en_connection_settings_license_key_tql"]:after {
     100label[for="en_connection_settings_license_key_tql"]:after,
     101label[for="en_connection_settings_old_api_client_id_tql"]:after,
     102label[for="en_connection_settings_old_api_client_secret_tql"]:after,
     103label[for="en_connection_settings_old_api_trax_username_tql"]:after,
     104label[for="en_connection_settings_old_api_trax_password_tql"]:after,
     105label[for="en_connection_settings_old_api_subscription_key_tql"]:after {
    98106    content: " *";
    99107    color: red;
  • ltl-freight-quotes-tql-edition/trunk/admin/assets/en-tql-admin.js

    r3454346 r3465519  
    141141    // Connection Settings Tab
    142142    if (jQuery('#en_tql_connection_settings').length > 0) {
    143         jQuery('#en_connection_settings_client_id_tql').attr('title', 'Client Id');
    144         jQuery('#en_connection_settings_trax_username_tql').attr('title', 'Trax Username');
    145         jQuery('#en_connection_settings_trax_password_tql').attr('title', 'Trax Password');
    146         jQuery('#en_connection_settings_subscription_key_tql').attr('title', 'Subscription Key');
     143        jQuery('#en_connection_settings_client_id_tql, #en_connection_settings_old_api_client_id_tql').attr('title', 'Client ID');
     144        jQuery('#en_connection_settings_old_api_client_secret_tql').attr('title', 'Client Secret');
     145        jQuery('#en_connection_settings_trax_username_tql, #en_connection_settings_old_api_trax_username_tql').attr('title', 'Username');
     146        jQuery('#en_connection_settings_trax_password_tql, #en_connection_settings_old_api_trax_password_tql').attr('title', 'Password');
     147        jQuery('#en_connection_settings_subscription_key_tql, #en_connection_settings_old_api_subscription_key_tql').attr('title', 'Subscription Key');
    147148        jQuery('#en_connection_settings_license_key_tql').attr('title', 'Eniture API Key');
    148149
     
    173174            if (event.target.id == 'en_tql_test_connection') {
    174175                let connection_fields = jQuery('#en_tql_connection_settings input').serialize();
    175                 let client_id = jQuery('#en_connection_settings_client_id_tql').val();
    176                 let user_name = jQuery('#en_connection_settings_trax_username_tql').val();
    177                 let password = jQuery('#en_connection_settings_trax_password_tql').val();
    178                 let subscription_key = jQuery('#en_connection_settings_subscription_key_tql').val();
    179                 let license_key = jQuery('#en_connection_settings_license_key_tql').val();
    180 
    181                 var dataString = 'en_connection_settings_client_id_tql=' + client_id
     176                const api_selected = jQuery('#en_connection_settings_api_tql').val();
     177                const api_prefix = api_selected == 'tql_old_api' ? 'old_api_' : '';
     178                const client_id = jQuery(`#en_connection_settings_${api_prefix}client_id_tql`).val();
     179                const client_secret = jQuery(`#en_connection_settings_${api_prefix}client_secret_tql`).val();
     180                const user_name = jQuery(`#en_connection_settings_${api_prefix}trax_username_tql`).val();
     181                const password = jQuery(`#en_connection_settings_${api_prefix}trax_password_tql`).val();
     182                const subscription_key = jQuery(`#en_connection_settings_${api_prefix}subscription_key_tql`).val();
     183                const license_key = jQuery('#en_connection_settings_license_key_tql').val();
     184
     185                let dataString = 'en_connection_settings_client_id_tql=' + client_id
    182186                    + '&en_connection_settings_trax_username_tql=' + user_name
    183187                    + '&en_connection_settings_trax_password_tql=' + password
    184188                    + '&en_connection_settings_subscription_key_tql=' + subscription_key
    185                     + '&en_connection_settings_license_key_tql=' + license_key;
    186                 let postForm = {
     189                    + '&en_connection_settings_license_key_tql=' + license_key
     190                    + '&en_connection_settings_api_tql=' + api_selected;
     191
     192                if (api_selected == 'tql_old_api') {
     193                    dataString += '&en_connection_settings_old_api_client_secret_tql=' + client_secret;
     194                }
     195
     196                const postForm = {
    187197                    'action': 'en_tql_test_connection',
    188198                    'en_post_data': dataString,
     
    190200                };
    191201
    192                 let params = {
    193                     en_ajax_loading_id: '#en_connection_settings_client_id_tql,#en_connection_settings_trax_username_tql,#en_connection_settings_trax_password_tql,#en_connection_settings_subscription_key_tql,#en_connection_settings_license_key_tql',
     202                const params = {
     203                    en_ajax_loading_id: '#en_connection_settings_client_id_tql,#en_connection_settings_trax_username_tql,#en_connection_settings_trax_password_tql,#en_connection_settings_subscription_key_tql,#en_connection_settings_license_key_tql, #en_connection_settings_old_api_client_id_tql, #en_connection_settings_old_api_client_secret_tql, #en_connection_settings_old_api_trax_username_tql, #en_connection_settings_old_api_trax_password_tql, #en_connection_settings_old_api_subscription_key_tql',
    194204                };
    195205
     
    310320    // Cut-off time and shipment offset days settings
    311321    tqlCutOffTimeAndShipDateSettings();
     322    // New API
     323    tqlHandleAPISelection();
     324    jQuery('#en_connection_settings_api_tql').on('change', tqlHandleAPISelection);
    312325});
    313326
     
    864877    }
    865878}
     879
     880if (typeof tqlHandleAPISelection != 'function') {
     881    function tqlHandleAPISelection() {
     882        const apiTql = jQuery('#en_connection_settings_api_tql').val();
     883   
     884        if (apiTql == 'tql_new_api') {
     885            jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', '');
     886            jQuery('.en_connection_settings_new_api_fields')
     887                .removeAttr('data-optional')
     888                .removeAttr('optional')
     889                .removeData('optional');
     890   
     891            jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', 'none');
     892            jQuery('.en_connection_settings_old_api_fields')
     893                .attr('data-optional', 1)
     894                .attr('optional', 1)
     895                .data('optional', 1);
     896        } else {
     897            jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', '');
     898            jQuery('.en_connection_settings_old_api_fields')
     899                .removeAttr('data-optional')
     900                .removeAttr('optional')
     901                .removeData('optional');
     902           
     903            jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', 'none');
     904            jQuery('.en_connection_settings_new_api_fields')
     905                .attr('data-optional', 1)
     906                .attr('optional', 1)
     907                .data('optional', 1);
     908        }
     909    }
     910}
  • ltl-freight-quotes-tql-edition/trunk/admin/tab/connection-settings/en-connection-ajax.php

    r3454346 r3465519  
    4747            }
    4848
     49            if (isset($en_connection_request['api']) && $en_connection_request['api'] == 'tql_new_api') {
     50                unset($en_connection_request['clientSecret']);
     51            }
     52           
     53            unset($en_connection_request['_clientId'], $en_connection_request['_username'], $en_connection_request['_password'], $en_connection_request['_subscriptionKey'], $en_connection_request['api']);
     54
    4955            $en_connection_request['carrierMode'] = 'test';
    5056            $en_connection_request = apply_filters('en_tql_add_connection_request', $en_connection_request);
  • ltl-freight-quotes-tql-edition/trunk/admin/tab/connection-settings/en-connection-settings.php

    r3454346 r3465519  
    6666                    self::$get_connection_details[$value['eniture_action']] = $saved_connection_detail : '';
    6767            }
     68
     69            if (isset($connection_request['api']) && $connection_request['api'] == 'tql_new_api') {
     70                unset($connection_request['clientSecret']);
     71            }
     72           
     73            unset($connection_request['_clientId'], $connection_request['_username'], $connection_request['_password'], $connection_request['_subscriptionKey'], $connection_request['api']);
    6874
    6975            add_filter('en_tql_reason_quotes_not_returned', [__CLASS__, 'en_tql_reason_quotes_not_returned'], 99, 1);
     
    112118        static public function en_set_connection_settings_detail()
    113119        {
     120            if (empty(get_option('en_connection_settings_api_tql'))) {
     121                update_option('en_connection_settings_api_tql', 'tql_new_api');
     122            }
     123
    114124            return
    115125                [
     126                    'en_connection_settings_api_tql' => array(
     127                        'eniture_action' => 'api',
     128                        'name' => __('Which API will you connect to? ', 'woocommerce-settings-tql'),
     129                        'type' => 'select',
     130                        'default' => 'tql_new_api',
     131                        'id' => 'en_connection_settings_api_tql',
     132                        'options' => array(
     133                            'tql_old_api' => __('Legacy API', 'woocommerce-settings-tql'),
     134                            'tql_new_api' => __('New API', 'woocommerce-settings-tql'),
     135                        )
     136                    ),
     137
     138                    // Old API
     139                    'en_connection_settings_old_api_client_id_tql' => [
     140                        'eniture_action' => '_clientId',
     141                        'name' => __('Client ID ', 'woocommerce-settings-tql'),
     142                        'type' => 'text',
     143                        'id' => 'en_connection_settings_old_api_client_id_tql',
     144                        'class' => 'en_connection_settings_old_api_fields'
     145                    ],
     146                    'en_connection_settings_old_api_client_secret_tql' => [
     147                        'eniture_action' => 'clientSecret',
     148                        'name' => __('Client Secret ', 'woocommerce-settings-tql'),
     149                        'type' => 'text',
     150                        'id' => 'en_connection_settings_old_api_client_secret_tql',
     151                        'class' => 'en_connection_settings_old_api_fields'
     152                    ],
     153                    'en_connection_settings_old_api_username_tql' => [
     154                        'eniture_action' => '_username',
     155                        'name' => __('Username ', 'woocommerce-settings-tql'),
     156                        'type' => 'text',
     157                        'id' => 'en_connection_settings_old_api_trax_username_tql',
     158                        'class' => 'en_connection_settings_old_api_fields'
     159                    ],
     160                    'en_connection_settings_old_api_password_tql' => [
     161                        'eniture_action' => '_password',
     162                        'name' => __('Password ', 'woocommerce-settings-tql'),
     163                        'type' => 'text',
     164                        'id' => 'en_connection_settings_old_api_trax_password_tql',
     165                        'class' => 'en_connection_settings_old_api_fields'
     166                    ],
     167                    'en_connection_settings_old_api_subscription_key_tql' => [
     168                        'eniture_action' => '_subscriptionKey',
     169                        'name' => __('Subscription Key ', 'woocommerce-settings-tql'),
     170                        'type' => 'text',
     171                        'id' => 'en_connection_settings_old_api_subscription_key_tql',
     172                        'class' => 'en_connection_settings_old_api_fields'
     173                    ],
     174
     175                    // New API
    116176                    'en_connection_settings_client_id_tql' => [
    117177                        'eniture_action' => 'clientId',
    118                         'name' => __('Client Id ', 'woocommerce-settings-tql'),
    119                         'type' => 'text',
    120                         'desc' => __('', 'woocommerce-settings-tql'),
    121                         'id' => 'en_connection_settings_client_id_tql'
     178                        'name' => __('Client ID ', 'woocommerce-settings-tql'),
     179                        'type' => 'text',
     180                        'desc' => __('', 'woocommerce-settings-tql'),
     181                        'id' => 'en_connection_settings_client_id_tql',
     182                        'class' => 'en_connection_settings_new_api_fields'
    122183                    ],
    123184                    'en_connection_settings_trax_username_tql' => [
    124185                        'eniture_action' => 'traxUsername',
    125                         'name' => __('Trax Username ', 'woocommerce-settings-tql'),
    126                         'type' => 'text',
    127                         'desc' => __('', 'woocommerce-settings-tql'),
    128                         'id' => 'en_connection_settings_trax_username_tql'
     186                        'name' => __('Username ', 'woocommerce-settings-tql'),
     187                        'type' => 'text',
     188                        'desc' => __('', 'woocommerce-settings-tql'),
     189                        'id' => 'en_connection_settings_trax_username_tql',
     190                        'class' => 'en_connection_settings_new_api_fields'
    129191                    ],
    130192                    'en_connection_settings_trax_password_tql' => [
    131193                        'eniture_action' => 'traxPassword',
    132                         'name' => __('Trax Password ', 'woocommerce-settings-tql'),
    133                         'type' => 'text',
    134                         'desc' => __('', 'woocommerce-settings-tql'),
    135                         'id' => 'en_connection_settings_trax_password_tql'
     194                        'name' => __('Password ', 'woocommerce-settings-tql'),
     195                        'type' => 'text',
     196                        'desc' => __('', 'woocommerce-settings-tql'),
     197                        'id' => 'en_connection_settings_trax_password_tql',
     198                        'class' => 'en_connection_settings_new_api_fields'
    136199                    ],
    137200                    'en_connection_settings_subscription_key_tql' => [
     
    140203                        'type' => 'text',
    141204                        'desc' => __('', 'woocommerce-settings-tql'),
    142                         'id' => 'en_connection_settings_subscription_key_tql'
     205                        'id' => 'en_connection_settings_subscription_key_tql',
     206                        'class' => 'en_connection_settings_new_api_fields'
    143207                    ],
    144208                    'en_connection_settings_license_key_tql' => [
  • ltl-freight-quotes-tql-edition/trunk/admin/tab/location/includes/en-location-ajax.php

    r3454346 r3465519  
    179179                parse_str($fullstring, $post_data);
    180180                if (isset($post_data['en_wd_origin_markup'])) {
    181                     $post_data['en_wd_origin_markup'] = str_replace('%25', '%', $post_data['en_wd_origin_markup']);
     181                    $post_data['origin_markup'] = str_replace('%25', '%', $post_data['en_wd_origin_markup']);
     182                    unset($post_data['en_wd_origin_markup']);
    182183                }
    183184            }
     
    188189            (!isset($post_data['suppress_local_delivery'])) ? $post_data['suppress_local_delivery'] = 'no' : '';
    189190
    190            
    191             $post_data['origin_markup'] = isset($temp['en_wd_origin_markup']) ? $temp['en_wd_origin_markup'] : '';
    192             unset($post_data['en_wd_origin_markup']);
    193191            $resi_lfg_pickup = ['residential_pickup_parcel', 'residential_pickup', 'liftgate_pickup'];
    194192            foreach ($resi_lfg_pickup as $value) {
  • ltl-freight-quotes-tql-edition/trunk/en-install.php

    r3454346 r3465519  
    5454        ]);
    5555
    56         wp_enqueue_script('EnTqlAdminJs', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.js', [], '1.0.7');
     56        wp_enqueue_script('EnTqlAdminJs', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.js', [], '1.0.8');
    5757        wp_localize_script('EnTqlAdminJs', 'en_tql_admin_script', [
    5858            'pluginsUrl' => EN_TQL_PLUGIN_URL,
     
    7676        wp_enqueue_style('EnTqlLocationStyle');
    7777
    78         wp_register_style('EnTqlAdminCss', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.css', false, '1.0.7');
     78        wp_register_style('EnTqlAdminCss', EN_TQL_DIR_FILE . '/admin/assets/en-tql-admin.css', false, '1.0.8');
    7979        wp_enqueue_style('EnTqlAdminCss');
    8080
  • ltl-freight-quotes-tql-edition/trunk/http/en-curl.php

    r3454346 r3465519  
    170170
    171171            $cachable_data['clientId'] = isset($request_data['clientId']) ? $request_data['clientId'] : '';
     172            $cachable_data['clientSecret'] = isset($request_data['clientSecret']) ? $request_data['clientSecret'] : '';
    172173            $cachable_data['traxUsername'] = isset($request_data['traxUsername']) ? $request_data['traxUsername'] : '';
    173174            $cachable_data['traxPassword'] = isset($request_data['traxPassword']) ? $request_data['traxPassword'] : '';
  • ltl-freight-quotes-tql-edition/trunk/ltl-freight-quotes-tql-edition.php

    r3454354 r3465519  
    44 * Plugin URI: https://eniture.com/products/
    55 * Description: Dynamically retrieves your negotiated shipping rates from TQL and displays the results in the WooCommerce shopping cart.
    6  * Version: 1.2.10
     6 * Version: 1.2.11
    77 * Author: Eniture Technology
    88 * Author URI: http://eniture.com/
  • ltl-freight-quotes-tql-edition/trunk/readme.txt

    r3454354 r3465519  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 1.2.10
     6Stable tag: 1.2.11
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    147147== Changelog ==
    148148
     149= 1.2.11 - 2026-02-20 =
     150* Update: Added a dropdown setting to support both Legacy API and New API selection within the plugin settings.
     151
    149152= 1.2.10 - 2026-02-05 =
    150153* Update: Introduced **bulk delete functionality** for warehouse and dropship locations to simplify location management.
  • ltl-freight-quotes-tql-edition/trunk/server/api/en-response.php

    r3454346 r3465519  
    140140                }
    141141
    142                 self::en_arrange_rates(self::en_sanitize_rate('q', []), $origin_level_markup, $product_level_markup);
     142                self::en_arrange_rates(self::en_sanitize_rate('q', []), $origin_level_markup, $product_level_markup, $key);
    143143            }
    144144
     
    261261         * @param array $rates
    262262         */
    263         static public function en_arrange_rates($rates, $origin_level_markup = '', $product_level_markup = '')
     263        static public function en_arrange_rates($rates, $origin_level_markup = '', $product_level_markup = '', $shipment_zip = '')
    264264        {
    265265            $en_rates = [];
     
    301301                $en_total_net_charge = self::en_sanitize_rate('customerRate', 0);
    302302                $carrier_scac = self::en_sanitize_rate('scac', '');
    303                 if ($en_total_net_charge > 0 && in_array($carrier_scac, $enable_carriers)) {
     303                $standard_service = self::en_sanitize_rate('serviceLevel', '') == 'Standard';
     304                if ($en_total_net_charge > 0 && in_array($carrier_scac, $enable_carriers) && $standard_service) {
    304305                   
    305306                    // Product level markup
     
    419420                            $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['en_fdo_meta_data']['accessorials']['notify'] = true;
    420421                        }
    421                         if (in_array('H', $accessorial)) {
     422                        if (in_array('H', $accessorial) && isset(self::$en_package['hazmat'][$shipment_zip]) && self::$en_package['hazmat'][$shipment_zip]) {
    422423                            $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['en_fdo_meta_data']['accessorials']['hazmat'] = true;
    423424                        }
  • ltl-freight-quotes-tql-edition/trunk/server/package/en-package.php

    r3454346 r3465519  
    189189                        }
    190190                    }
     191
    191192                    foreach ($en_product_fields as $en_field_key => $en_custom_product) {
    192193
    193194                        self::$en_step_for_package = $en_custom_product;
    194 
    195195                        self::$product_key_name = self::en_sanitize_package('id', '');
    196196
     
    212212                            (!is_array($en_location_value) &&
    213213                                    strlen($en_location_value) > EN_TQL_DECLARED_ZERO) ? $product_item[$is_line_item] = $en_location_value : "";
     214
     215                            if ($is_line_item == 'isHazmatLineItem' && $en_location_value == 'Y') {
     216                                self::$en_request['hazmat'][$origin_zip_code] = EN_TQL_DECLARED_TRUE;
     217                            }
    214218
    215219                            if (isset($en_location_value['senderZip']) &&
Note: See TracChangeset for help on using the changeset viewer.