Changeset 3462301
- Timestamp:
- 02/16/2026 08:40:57 AM (6 weeks ago)
- Location:
- ltl-freight-quotes-day-ross-edition
- Files:
-
- 24 edited
- 1 copied
-
tags/2.2.1 (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk)
-
tags/2.2.1/admin/assets/en-dayross-admin.css (modified) (1 diff)
-
tags/2.2.1/admin/assets/en-dayross-admin.js (modified) (5 diffs)
-
tags/2.2.1/admin/tab/connection-settings/en-connection-ajax.php (modified) (2 diffs)
-
tags/2.2.1/admin/tab/connection-settings/en-connection-settings.php (modified) (2 diffs)
-
tags/2.2.1/admin/tab/logs/en-logs.php (modified) (3 diffs)
-
tags/2.2.1/en-install.php (modified) (2 diffs)
-
tags/2.2.1/ltl-freight-quotes-dayross-edition.php (modified) (1 diff)
-
tags/2.2.1/readme.txt (modified) (2 diffs)
-
tags/2.2.1/server/api/en-response.php (modified) (8 diffs)
-
tags/2.2.1/server/common/en-quote-settings.php (modified) (1 diff)
-
tags/2.2.1/server/en-shipping-rates.php (modified) (2 diffs)
-
tags/2.2.1/server/package/en-package.php (modified) (8 diffs)
-
trunk/admin/assets/en-dayross-admin.css (modified) (1 diff)
-
trunk/admin/assets/en-dayross-admin.js (modified) (5 diffs)
-
trunk/admin/tab/connection-settings/en-connection-ajax.php (modified) (2 diffs)
-
trunk/admin/tab/connection-settings/en-connection-settings.php (modified) (2 diffs)
-
trunk/admin/tab/logs/en-logs.php (modified) (3 diffs)
-
trunk/en-install.php (modified) (2 diffs)
-
trunk/ltl-freight-quotes-dayross-edition.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/server/api/en-response.php (modified) (8 diffs)
-
trunk/server/common/en-quote-settings.php (modified) (1 diff)
-
trunk/server/en-shipping-rates.php (modified) (2 diffs)
-
trunk/server/package/en-package.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ltl-freight-quotes-day-ross-edition/tags/2.2.1/admin/assets/en-dayross-admin.css
r3428882 r3462301 97 97 label[for="en_connection_settings_password_dayross"]:after, 98 98 label[for="en_connection_settings_account_number_dayross"]:after, 99 label[for="en_connection_settings_license_key_dayross"]:after { 99 label[for="en_connection_settings_license_key_dayross"]:after, 100 label[for="en_connection_settings_client_id_dayross"]:after, 101 label[for="en_connection_settings_client_secret_dayross"]:after, 102 label[for="en_connection_settings_new_api_username_dayross"]:after, 103 label[for="en_connection_settings_new_api_password_dayross"]:after, 104 label[for="en_connection_settings_new_api_account_number_dayross"]:after { 100 105 content: " *"; 101 106 color: red; -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/admin/assets/en-dayross-admin.js
r3428882 r3462301 191 191 jQuery('#en_connection_settings_account_number_dayross').attr('title', 'Bill To Account Number'); 192 192 jQuery('#en_connection_settings_license_key_dayross').attr('title', 'Eniture API Key'); 193 // New API 194 jQuery('#en_connection_settings_client_id_dayross').attr('title', 'Client ID'); 195 jQuery('#en_connection_settings_client_secret_dayross').attr('title', 'Client Secret'); 196 jQuery('#en_connection_settings_new_api_username_dayross').attr('title', 'Email'); 197 jQuery('#en_connection_settings_new_api_password_dayross').attr('title', 'Passsword'); 198 jQuery('#en_connection_settings_new_api_account_number_dayross').attr('title', 'Bill To Account Number'); 199 jQuery('#en_connection_settings_client_id_dayross, #en_connection_settings_client_secret_dayross').attr('maxlength', '50'); 200 jQuery('#en_connection_settings_username_dayross, #en_connection_settings_new_api_username_dayross').attr('maxlength', '254'); 201 jQuery('#en_connection_settings_password_dayross, #en_connection_settings_new_api_password_dayross, #en_connection_settings_account_number_dayross, #en_connection_settings_new_api_account_number_dayross').attr('maxlength', '128'); 193 202 194 203 jQuery('#en_dayross_connection_settings').before("<div class='en_warning_message'><p>Note! You must have an LTL Freight enabled Day & Ross account to use this application. If you do not have one, call 877.226.9950, or <a href='https://www.dayross.com/' target='_blank' >register</a> online.</p></div>"); … … 219 228 let postForm = { 220 229 'action': 'en_dayross_test_connection', 221 'en_post_data': window.btoa(jQuery('#en_dayross_connection_settings input ').serialize()),230 'en_post_data': window.btoa(jQuery('#en_dayross_connection_settings input, #en_dayross_connection_settings select').serialize()), 222 231 'wp_nonce': en_dayross_admin_script.nonce 223 232 }; 224 233 225 234 let params = { 226 en_ajax_loading_id: '#en_connection_settings_ username_dayross,#en_connection_settings_password_dayross,#en_connection_settings_account_number_dayross,#en_connection_settings_license_key_dayross',235 en_ajax_loading_id: '#en_connection_settings_client_id_dayross, #en_connection_settings_client_secret_dayross, #en_connection_settings_new_api_username_dayross, #en_connection_settings_new_api_password_dayross,#en_connection_settings_new_api_account_number_dayross, #en_connection_settings_username_dayross,#en_connection_settings_password_dayross,#en_connection_settings_account_number_dayross,#en_connection_settings_license_key_dayross', 227 236 }; 228 237 … … 341 350 // Backup rates settings 342 351 dayrossBackupRatesSettings(); 352 353 // New API 354 handleAPISelection(); 355 jQuery('#en_connection_settings_api_dayross').on('change', handleAPISelection); 343 356 }); 344 357 … … 471 484 jQuery(en_error_element).html(''); 472 485 473 optional = (optional === undefined ) ? 0 : 1;486 optional = (optional === undefined || !optional) ? 0 : 1; 474 487 errorText = (errorText != undefined) ? errorText : ''; 475 488 … … 734 747 } 735 748 } 749 750 if (typeof handleAPISelection != 'function') { 751 function handleAPISelection() { 752 const apiDayross = jQuery('#en_connection_settings_api_dayross').val(); 753 754 if (apiDayross == 'dayross_new_api') { 755 jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', ''); 756 jQuery('.en_connection_settings_new_api_fields') 757 .removeAttr('data-optional') 758 .removeAttr('optional') 759 .removeData('optional'); 760 761 jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', 'none'); 762 jQuery('.en_connection_settings_old_api_fields') 763 .attr('data-optional', 1) 764 .attr('optional', 1) 765 .data('optional', 1); 766 } else { 767 jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', ''); 768 jQuery('.en_connection_settings_old_api_fields') 769 .removeAttr('data-optional') 770 .removeAttr('optional') 771 .removeData('optional'); 772 773 jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', 'none'); 774 jQuery('.en_connection_settings_new_api_fields') 775 .attr('data-optional', 1) 776 .attr('optional', 1) 777 .data('optional', 1); 778 } 779 } 780 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/admin/tab/connection-settings/en-connection-ajax.php
r3259053 r3462301 44 44 } 45 45 46 $api_selected = isset($en_post_data['en_connection_settings_api_dayross']) ? $en_post_data['en_connection_settings_api_dayross'] : ''; 47 46 48 $en_request_indexing = json_decode(EN_DAYROSS_SET_CONNECTION_SETTINGS, true); 47 49 $en_connection_request = json_decode(EN_DAYROSS_GET_CONNECTION_SETTINGS, true); … … 50 52 $en_connection_request[$en_request_indexing[$en_request_name]['eniture_action']] = $en_request_value; 51 53 } 54 55 // Handle New API 56 if ($api_selected && $api_selected == 'dayross_new_api') { 57 $en_connection_request['requestForNewAPI'] = 1; 58 $en_connection_request['emailAddress'] = $en_connection_request['_emailAddress']; 59 $en_connection_request['password'] = $en_connection_request['_password']; 60 $en_connection_request['billToAccountNumber'] = $en_connection_request['_billToAccountNumber']; 61 } else { 62 unset($en_connection_request['clientId'], $en_connection_request['clientSecret'], $en_connection_request['requestForNewAPI']); 63 } 64 65 // Remove unnecessary parameters 66 unset($en_connection_request['api'], $en_connection_request['_emailAddress'], $en_connection_request['_password'], $en_connection_request['_billToAccountNumber']); 52 67 53 68 $en_connection_request['dimWeightBaseAccount'] = (!empty($en_connection_request['dimWeightBaseAccount']) && 'dims' == $en_connection_request['dimWeightBaseAccount'])?'1':'0'; -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/admin/tab/connection-settings/en-connection-settings.php
r3154394 r3462301 64 64 self::$get_connection_details[$value['eniture_action']] = $saved_connection_detail : ''; 65 65 } 66 67 // Handle New API 68 if (isset($connection_request['api']) && $connection_request['api'] == 'dayross_old_api') { 69 unset($connection_request['api'], $connection_request['clientId'], $connection_request['clientSecret']); 70 } else { 71 $connection_request['requestForNewAPI'] = 1; 72 $connection_request['emailAddress'] = $connection_request['_emailAddress']; 73 $connection_request['password'] = $connection_request['_password']; 74 $connection_request['billToAccountNumber'] = $connection_request['_billToAccountNumber']; 75 } 76 77 // Remove unnecessary parameters 78 unset($connection_request['api'], $connection_request['_emailAddress'], $connection_request['_password'], $connection_request['_billToAccountNumber']); 66 79 67 80 $connection_request['dimWeightBaseAccount'] = (!empty($connection_request['dimWeightBaseAccount']) && 'dims' == $connection_request['dimWeightBaseAccount'])?'1':'0'; … … 107 120 static public function en_set_connection_settings_detail() 108 121 { 122 if (empty(get_option('en_connection_settings_api_dayross'))) { 123 update_option('en_connection_settings_api_dayross', 'dayross_old_api'); 124 } 125 109 126 return 110 127 [ 128 'en_connection_settings_api_dayross' => array( 129 'eniture_action' => 'api', 130 'name' => __('Which API will you connect to? ', 'woocommerce-settings-dayross'), 131 'type' => 'select', 132 'default' => 'dayross_old_api', 133 'id' => 'en_connection_settings_api_dayross', 134 'options' => array( 135 'dayross_old_api' => __('Legacy API', 'woocommerce-settings-dayross'), 136 'dayross_new_api' => __('New API', 'woocommerce-settings-dayross'), 137 ) 138 ), 139 140 // New API 141 'en_connection_settings_client_id_dayross' => [ 142 'eniture_action' => 'clientId', 143 'name' => __('Client ID ', 'woocommerce-settings-dayross'), 144 'type' => 'text', 145 'id' => 'en_connection_settings_client_id_dayross', 146 'class' => 'en_connection_settings_new_api_fields' 147 ], 148 'en_connection_settings_client_secret_dayross' => [ 149 'eniture_action' => 'clientSecret', 150 'name' => __('Client Secret ', 'woocommerce-settings-dayross'), 151 'type' => 'text', 152 'id' => 'en_connection_settings_client_secret_dayross', 153 'class' => 'en_connection_settings_new_api_fields' 154 ], 155 'en_connection_settings_new_api_username_dayross' => [ 156 'eniture_action' => '_emailAddress', 157 'name' => __('Email ', 'woocommerce-settings-dayross'), 158 'type' => 'text', 159 'id' => 'en_connection_settings_new_api_username_dayross', 160 'class' => 'en_connection_settings_new_api_fields' 161 ], 162 'en_connection_settings_new_api_password_dayross' => [ 163 'eniture_action' => '_password', 164 'name' => __('Password ', 'woocommerce-settings-dayross'), 165 'type' => 'text', 166 'id' => 'en_connection_settings_new_api_password_dayross', 167 'class' => 'en_connection_settings_new_api_fields' 168 ], 169 'en_connection_settings_new_api_account_number_dayross' => [ 170 'eniture_action' => '_billToAccountNumber', 171 'name' => __('Bill To Account Number ', 'woocommerce-settings-dayross'), 172 'type' => 'text', 173 'id' => 'en_connection_settings_new_api_account_number_dayross', 174 'class' => 'en_connection_settings_new_api_fields' 175 ], 176 177 // Old API 111 178 'en_connection_settings_username_dayross' => [ 112 179 'eniture_action' => 'emailAddress', 113 180 'name' => __('Email ', 'woocommerce-settings-dayross'), 114 181 'type' => 'text', 115 'desc' => __('', 'woocommerce-settings-dayross'), 116 'id' => 'en_connection_settings_username_dayross' 117 ], 118 182 'id' => 'en_connection_settings_username_dayross', 183 'class' => 'en_connection_settings_old_api_fields' 184 ], 119 185 'en_connection_settings_password_dayross' => [ 120 186 'eniture_action' => 'password', 121 187 'name' => __('Password ', 'woocommerce-settings-dayross'), 122 188 'type' => 'text', 123 'desc' => __('', 'woocommerce-settings-dayross'), 124 'id' => 'en_connection_settings_password_dayross' 125 ], 126 189 'id' => 'en_connection_settings_password_dayross', 190 'class' => 'en_connection_settings_old_api_fields' 191 ], 127 192 'en_connection_settings_account_number_dayross' => [ 128 193 'eniture_action' => 'billToAccountNumber', 129 194 'name' => __('Bill To Account Number ', 'woocommerce-settings-dayross'), 130 195 'type' => 'text', 131 ' desc' => __('', 'woocommerce-settings-dayross'),132 ' id' => 'en_connection_settings_account_number_dayross'196 'id' => 'en_connection_settings_account_number_dayross', 197 'class' => 'en_connection_settings_old_api_fields' 133 198 ], 134 199 -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/admin/tab/logs/en-logs.php
r3154394 r3462301 42 42 'licenseKey' => get_option('en_connection_settings_license_key_dayross'), 43 43 'lastLogs' => '25', 44 'carrierName' => 'dayross',44 'carrierName' => get_option('en_connection_settings_api_dayross') == 'dayross_new_api' ? 'Dayross LTL New API' : 'dayross', 45 45 ); 46 46 … … 106 106 // Formatting for showing all items on show more items button click 107 107 foreach ($formatted_info as $key => $value) { 108 $formattedSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' </p>';108 $formattedSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' ' . $value['origin']['senderCountryCode'] . '</p>'; 109 109 110 110 foreach ($value['items'] as $item) { … … 117 117 // Formatting for showingitems on hide more items button click 118 118 foreach ($hidden_formatted_info as $key => $value) { 119 $hiddenSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' </p>';119 $hiddenSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' ' . $value['origin']['senderCountryCode'] . '</p>'; 120 120 121 121 foreach ($value['items'] as $item) { -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/en-install.php
r3428882 r3462301 57 57 ]); 58 58 59 wp_enqueue_script('EnDayrossAdminJs', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.js', [], '1.1. 4');59 wp_enqueue_script('EnDayrossAdminJs', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.js', [], '1.1.5'); 60 60 wp_localize_script('EnDayrossAdminJs', 'en_dayross_admin_script', [ 61 61 'pluginsUrl' => EN_DAYROSS_PLUGIN_URL, … … 83 83 wp_enqueue_style('EnDayrossLocationStyle'); 84 84 85 wp_register_style('EnDayrossAdminCss', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.css', false, '1. 0.9');85 wp_register_style('EnDayrossAdminCss', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.css', false, '1.1.0'); 86 86 wp_enqueue_style('EnDayrossAdminCss'); 87 87 -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/ltl-freight-quotes-dayross-edition.php
r3428882 r3462301 4 4 * Plugin URI: https://eniture.com/products/ 5 5 * Description: Dynamically retrieves your negotiated shipping rates from Day & Ross and displays the results in the WooCommerce shopping cart. 6 * Version: 2.2. 06 * Version: 2.2.1 7 7 * Author: Eniture Technology 8 8 * Author URI: http://eniture.com/ 9 9 * Text Domain: eniture-technology 10 * License: GPL version 2 or later - http://www.eniture.com/ 11 * WC requires at least: 6.4 12 * WC tested up to: 10.4.3 10 * License: GPLv2 or later 11 * Requires Plugins: woocommerce 13 12 */ 14 13 -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/readme.txt
r3428882 r3462301 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 2.2. 06 Stable tag: 2.2.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 149 149 == Changelog == 150 150 151 = 2.2.1 - 2026-02-16 = 152 * Update: Added support for the Day & Ross new API in the plugin. 153 151 154 = 2.2.0 - 2025-12-29 = 152 155 * Update: Added **location-specific Residential and Liftgate Pickup** feature. -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/server/api/en-response.php
r3428882 r3462301 99 99 self::$en_step_for_rates = $value; 100 100 101 // Severity check 102 $severity = self::en_sanitize_rate('severity', ''); 103 if (is_string($severity) && strlen($severity) > 0 && strtolower($severity) == 'error') { 104 return []; 105 } 106 101 107 $residential_detecion_flag = get_option("en_woo_addons_auto_residential_detecion_flag"); 102 108 $auto_renew_plan = get_option("auto_residential_delivery_plan_auto_renew"); … … 113 119 114 120 $instor_pickup_local_delivery = self::en_sanitize_rate('InstorPickupLocalDelivery', []); 115 116 $rates_with_liftgate = self::en_sanitize_rate('quotesWithLiftgate', []);117 121 $rate_with_liftgate = 0; 118 if (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']['TotalCharges'])) { 119 $quote_result = $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 120 $rate_with_liftgate = $quote_result['TotalCharges']; 121 $surcharge_with_liftgate = (isset($quote_result['completeAccessorialCharges'])) ? $quote_result['completeAccessorialCharges'] : []; 122 } elseif (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['GetRate2Response'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']['TotalAmount'])) { 123 $service_levels = $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 124 $rate_with_liftgate = $service_levels['TotalAmount']; 125 $surcharge_with_liftgate = (isset($service_levels['ShipmentCharges']['ShipmentCharge'])) ? $service_levels['ShipmentCharges']['ShipmentCharge'] : []; 122 $new_api_enabled = get_option('en_connection_settings_api_dayross') == 'dayross_new_api'; 123 124 if ($new_api_enabled) { 125 $simple_rates = isset($value['quotesWithoutLiftgate']) ? self::en_sanitize_rate('quotesWithoutLiftgate', []) : (isset($value['q']) ? self::en_sanitize_rate('q', []) : []); 126 $rates_with_liftgate = isset($value['quotesWithoutLiftgate']) && isset($value['q']) ? self::en_sanitize_rate('q', []) : []; 127 128 if (isset($rates_with_liftgate['totalCharges'])) { 129 $rate_with_liftgate = $rates_with_liftgate['totalCharges']; 130 } 131 } else { 132 $rates_with_liftgate = self::en_sanitize_rate('quotesWithLiftgate', []); 133 if (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']['TotalCharges'])) { 134 $quote_result = $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 135 $rate_with_liftgate = $quote_result['TotalCharges']; 136 } elseif (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['GetRate2Response'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']['TotalAmount'])) { 137 $service_levels = $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 138 $rate_with_liftgate = $service_levels['TotalAmount']; 139 } 140 141 $simple_rates = self::en_sanitize_rate('q', []); 126 142 } 127 143 128 144 // Standard Packaging 129 145 self::$standard_packaging = self::en_sanitize_rate('standardPackagingData', []); 130 $severity = self::en_sanitize_rate('severity', '');131 if (is_string($severity) && strlen($severity) > 0 && strtolower($severity) == 'error') {132 return [];133 }134 $simple_rates = self::en_sanitize_rate('q', []);135 146 136 147 $origin_level_markup = isset($en_package['originAddress'][$key]['origin_markup']) ? $en_package['originAddress'][$key]['origin_markup'] : 0; … … 208 219 * @param string $index 209 220 * @param dynamic $is_not_matched 210 * @return dynamic mixed221 * @return dynamic|string|array mixed 211 222 */ 212 223 static public function en_sanitize_rate($index, $is_not_matched) … … 252 263 foreach ($accessorials as $index => $accessorial) { 253 264 if ($shipment_ca) { 254 $key = (isset($accessorial['Description'])) ? $accessorial['Description'] : '';255 $amount = (isset($accessorial['Amount'])) ? $accessorial['Amount'] : 0;265 $key = (isset($accessorial['Description'])) ? $accessorial['Description'] : (isset($accessorial['description']) ? $accessorial['description'] : ''); 266 $amount = (isset($accessorial['Amount'])) ? $accessorial['Amount'] : (isset($accessorial['chargeAmount']) ? $accessorial['chargeAmount'] : 0); 256 267 } else { 257 268 $key = (isset($accessorial['reqAccessorial'])) ? $accessorial['reqAccessorial'] : ''; … … 282 293 $rates = []; 283 294 $shipment_ca = false; 284 if (isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['CreateUSQuoteResponse'], $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult'])) { 285 $rates = $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 286 $deliveryDate = ''; 287 extract($rates); 288 $rates['deliveryTimestamp'] = $deliveryDate; 289 } elseif ((isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['GetRate2Response'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']))) { 290 $rates = $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 291 $TotalAmount = $deliveryDate = $ShipmentCharges = ''; 292 extract($rates); 293 $rates['TotalCharges'] = $TotalAmount; 294 $rates['deliveryTimestamp'] = $deliveryDate; 295 $rates['completeAccessorialCharges'] = (isset($ShipmentCharges['ShipmentCharge'])) ? $ShipmentCharges['ShipmentCharge'] : []; 295 $new_api_enabled = get_option('en_connection_settings_api_dayross') == 'dayross_new_api'; 296 297 if ($new_api_enabled) { 298 $rates = $dayross_rate; 299 $rates['TotalCharges'] = isset($rates['totalCharges']) ? $rates['totalCharges'] : ''; 300 $rates['deliveryTimestamp'] = isset($rates['deliveryDate']) ? $rates['deliveryDate'] : ''; 301 $rates['completeAccessorialCharges'] = isset($rates['aCharges']) ? $rates['aCharges'] : []; 296 302 $shipment_ca = true; 297 } 298 299 $overlength_fees = $handling_fee = $en_settings_label = $rating_method = $transit_days = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 303 } else { 304 if (isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['CreateUSQuoteResponse'], $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult'])) { 305 $rates = $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 306 $deliveryDate = ''; 307 extract($rates); 308 $rates['deliveryTimestamp'] = $deliveryDate; 309 } elseif ((isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['GetRate2Response'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']))) { 310 $rates = $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 311 $TotalAmount = $deliveryDate = $ShipmentCharges = ''; 312 extract($rates); 313 $rates['TotalCharges'] = $TotalAmount; 314 $rates['deliveryTimestamp'] = $deliveryDate; 315 $rates['completeAccessorialCharges'] = (isset($ShipmentCharges['ShipmentCharge'])) ? $ShipmentCharges['ShipmentCharge'] : []; 316 $shipment_ca = true; 317 } 318 } 319 320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 321 $overlength_fees = []; 300 322 self::$en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 301 323 self::$en_accessorial = json_decode(EN_DAYROSS_ACCESSORIAL, true); … … 352 374 $label = isset($is_valid_label) && $is_valid_label ? $en_settings_label : 'Freight'; 353 375 $calculated_transit_date = self::en_sanitize_rate('deliveryTimestamp', ''); 354 $label = ($rating_method != "average_rate" && 355 is_string($calculated_transit_date) && 356 self::$en_is_shipment == 'en_single_shipment' && 357 strlen($calculated_transit_date) > 0 && 358 $transit_days == "yes") ? 359 $label . ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')' : $label; 376 $append_transit = ''; 377 378 if ($rating_method != "average_rate" && is_string($calculated_transit_date) && self::$en_is_shipment == 'en_single_shipment' && strlen($calculated_transit_date) > 0 && $transit_days == "yes") { 379 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 380 } 360 381 361 382 // make data for order widget detail … … 415 436 'surcharges' => self::en_get_accessorials_prices(self::en_sanitize_rate('completeAccessorialCharges', ''), $shipment_ca), 416 437 'meta_data' => $meta_data, 417 'transit_days' => $transit_days 438 'transit_days' => $transit_days, 439 'append_transit' => $append_transit 418 440 ]; 419 441 … … 506 528 ]; 507 529 } 508 509 530 } 510 531 -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/server/common/en-quote-settings.php
r3428882 r3462301 27 27 $en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 28 28 $en_settings['liftgate_delivery_option'] == 'yes' ? $accessorials['liftGateAsAnOption'] = '1' : ""; 29 $en_settings['liftgate_delivery'] == 'yes' ? $accessorials['accessorials']['TLGDEL'] = 'Tailgate Delivery' : ""; 29 $lfg_acc = get_option('en_connection_settings_api_dayross') == 'dayross_new_api' ? 'TLGDL' : 'TLGDEL'; 30 $en_settings['liftgate_delivery'] == 'yes' ? $accessorials['accessorials'][$lfg_acc] = 'Tailgate Delivery' : ""; 30 31 $en_settings['residential_delivery'] == 'yes' ? $accessorials['accessorials']['PRESDL'] = 'Private Residence Delivery' : ""; 31 32 $accessorials['handlingUnitWeight'] = $en_settings['handling_unit_weight']; -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/server/en-shipping-rates.php
r3428882 r3462301 160 160 $response = \EnDayrossCurl\EnDayrossCurl::en_dayross_sent_http_request(EN_DAYROSS_HITTING_API_URL, $en_package, 'POST', 'Quotes'); 161 161 } 162 163 164 162 } 165 166 }else { 163 } else { 167 164 return $response = []; 168 165 } 166 169 167 // Get Small package quotes charges. 170 168 $en_small_package_quotes = EnDayrossSPQ\EnDayrossSPQ::en_small_package_quotes($package, $this->small_package); … … 222 220 } 223 221 $rate['label'] .= (!empty($label_sufex)) ? ' with ' . implode(' and ', $label_sufex) : ''; 222 $rate['label'] .= !empty($rate['append_transit']) ? $rate['append_transit'] : ''; 224 223 isset($rate['cost']) && $en_small_package_charges > 0 ? 225 224 $rate['cost'] = $rate['cost'] + $en_small_package_charges : 0; -
ltl-freight-quotes-day-ross-edition/tags/2.2.1/server/package/en-package.php
r3428882 r3462301 24 24 25 25 static public $post_id; 26 static public $parent_id; 26 27 static public $locations; 27 28 static public $product_key_name; … … 35 36 // Images for FDO 36 37 static public $en_fdo_image_urls = []; 38 static public $has_nesting = false; 37 39 38 40 /** … … 110 112 self::$post_id = (isset($product['variation_id']) && $product['variation_id'] > 0) ? 111 113 $product['variation_id'] : $product_data->get_id(); 112 $parent_id = self::$post_id;114 self::$parent_id = $parent_id = self::$post_id; 113 115 if(isset($product['variation_id']) && $product['variation_id'] > 0){ 114 116 $variation = wc_get_product($product['variation_id']); 115 $parent_id = $variation->get_parent_id();117 self::$parent_id = $parent_id = $variation->get_parent_id(); 116 118 } 117 119 $haz_status = ''; … … 121 123 if ($dr_plan != 0 && $dr_plan != 1) { 122 124 $haz_array = get_post_meta(self::$post_id, '_hazardousmaterials'); 125 // check if parent has hazardous materials 126 if (isset($haz_array[0]) && empty($haz_array[0]) && self::$parent_id != self::$post_id) { 127 $haz_array = get_post_meta(self::$parent_id, '_hazardousmaterials'); 128 } 129 123 130 isset($haz_array[0]) && $haz_array[0] == 'yes' ? $haz_status = 'Y' : $haz_status = ''; 124 131 } … … 130 137 if ($dr_plan == 3) { 131 138 $nested_mat = get_post_meta(self::$post_id, '_nestedMaterials'); 132 isset($nested_mat[0]) && $nested_mat[0] == 'yes' ? $doNesting = 1 : $doNesting = ''; 139 if (isset($nested_mat[0]) && empty($nested_mat[0]) && self::$parent_id != self::$post_id) { 140 $nested_mat = get_post_meta(self::$parent_id, '_nestedMaterials'); 141 } 142 143 isset($nested_mat[0]) && $nested_mat[0] == 'yes' ? self::$has_nesting = $doNesting = 1 : $doNesting = ''; 133 144 134 145 $nested_percen = get_post_meta(self::$post_id, '_nestedPercentage'); … … 136 147 137 148 $nested_dim = get_post_meta(self::$post_id, '_nestedDimension'); 149 if (isset($nested_dim[0]) && empty($nested_dim[0]) && self::$parent_id != self::$post_id) { 150 $nested_dim = get_post_meta(self::$parent_id, '_nestedDimension'); 151 } 152 138 153 !empty($nested_dim) ? $nested_dimension = $nested_dim[0] : $nested_dimension = 0; 139 154 140 155 $max_nested_item = get_post_meta(self::$post_id, '_maxNestedItems'); 156 if (isset($max_nested_item[0]) && empty($max_nested_item[0]) && self::$parent_id != self::$post_id) { 157 $max_nested_item = get_post_meta(self::$parent_id, '_maxNestedItems'); 158 } 159 141 160 !empty($max_nested_item) ? $max_nested_items = $max_nested_item[0] : $max_nested_items = 0; 142 161 … … 373 392 self::$en_request = array_merge(self::$en_request, self::$receiver_address); 374 393 self::$en_request['instorPickupLocalDelEnable'] = self::$instore_pickup_local_delivery; 394 self::$en_request['doNesting'] = self::$has_nesting ? 1 : ''; 375 395 376 396 self::$en_request['shipment_type'] = (isset(self::$en_request['LTL_FREIGHT'])) ? … … 612 632 case '_dropship_location': 613 633 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 634 // check for parent id 635 if (empty($enable_dropship) && self::$parent_id > 0 && self::$parent_id != self::$post_id) { 636 self::$post_id = self::$parent_id; 637 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 638 } 639 614 640 switch ($enable_dropship) { 615 641 case 'yes': -
ltl-freight-quotes-day-ross-edition/trunk/admin/assets/en-dayross-admin.css
r3428882 r3462301 97 97 label[for="en_connection_settings_password_dayross"]:after, 98 98 label[for="en_connection_settings_account_number_dayross"]:after, 99 label[for="en_connection_settings_license_key_dayross"]:after { 99 label[for="en_connection_settings_license_key_dayross"]:after, 100 label[for="en_connection_settings_client_id_dayross"]:after, 101 label[for="en_connection_settings_client_secret_dayross"]:after, 102 label[for="en_connection_settings_new_api_username_dayross"]:after, 103 label[for="en_connection_settings_new_api_password_dayross"]:after, 104 label[for="en_connection_settings_new_api_account_number_dayross"]:after { 100 105 content: " *"; 101 106 color: red; -
ltl-freight-quotes-day-ross-edition/trunk/admin/assets/en-dayross-admin.js
r3428882 r3462301 191 191 jQuery('#en_connection_settings_account_number_dayross').attr('title', 'Bill To Account Number'); 192 192 jQuery('#en_connection_settings_license_key_dayross').attr('title', 'Eniture API Key'); 193 // New API 194 jQuery('#en_connection_settings_client_id_dayross').attr('title', 'Client ID'); 195 jQuery('#en_connection_settings_client_secret_dayross').attr('title', 'Client Secret'); 196 jQuery('#en_connection_settings_new_api_username_dayross').attr('title', 'Email'); 197 jQuery('#en_connection_settings_new_api_password_dayross').attr('title', 'Passsword'); 198 jQuery('#en_connection_settings_new_api_account_number_dayross').attr('title', 'Bill To Account Number'); 199 jQuery('#en_connection_settings_client_id_dayross, #en_connection_settings_client_secret_dayross').attr('maxlength', '50'); 200 jQuery('#en_connection_settings_username_dayross, #en_connection_settings_new_api_username_dayross').attr('maxlength', '254'); 201 jQuery('#en_connection_settings_password_dayross, #en_connection_settings_new_api_password_dayross, #en_connection_settings_account_number_dayross, #en_connection_settings_new_api_account_number_dayross').attr('maxlength', '128'); 193 202 194 203 jQuery('#en_dayross_connection_settings').before("<div class='en_warning_message'><p>Note! You must have an LTL Freight enabled Day & Ross account to use this application. If you do not have one, call 877.226.9950, or <a href='https://www.dayross.com/' target='_blank' >register</a> online.</p></div>"); … … 219 228 let postForm = { 220 229 'action': 'en_dayross_test_connection', 221 'en_post_data': window.btoa(jQuery('#en_dayross_connection_settings input ').serialize()),230 'en_post_data': window.btoa(jQuery('#en_dayross_connection_settings input, #en_dayross_connection_settings select').serialize()), 222 231 'wp_nonce': en_dayross_admin_script.nonce 223 232 }; 224 233 225 234 let params = { 226 en_ajax_loading_id: '#en_connection_settings_ username_dayross,#en_connection_settings_password_dayross,#en_connection_settings_account_number_dayross,#en_connection_settings_license_key_dayross',235 en_ajax_loading_id: '#en_connection_settings_client_id_dayross, #en_connection_settings_client_secret_dayross, #en_connection_settings_new_api_username_dayross, #en_connection_settings_new_api_password_dayross,#en_connection_settings_new_api_account_number_dayross, #en_connection_settings_username_dayross,#en_connection_settings_password_dayross,#en_connection_settings_account_number_dayross,#en_connection_settings_license_key_dayross', 227 236 }; 228 237 … … 341 350 // Backup rates settings 342 351 dayrossBackupRatesSettings(); 352 353 // New API 354 handleAPISelection(); 355 jQuery('#en_connection_settings_api_dayross').on('change', handleAPISelection); 343 356 }); 344 357 … … 471 484 jQuery(en_error_element).html(''); 472 485 473 optional = (optional === undefined ) ? 0 : 1;486 optional = (optional === undefined || !optional) ? 0 : 1; 474 487 errorText = (errorText != undefined) ? errorText : ''; 475 488 … … 734 747 } 735 748 } 749 750 if (typeof handleAPISelection != 'function') { 751 function handleAPISelection() { 752 const apiDayross = jQuery('#en_connection_settings_api_dayross').val(); 753 754 if (apiDayross == 'dayross_new_api') { 755 jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', ''); 756 jQuery('.en_connection_settings_new_api_fields') 757 .removeAttr('data-optional') 758 .removeAttr('optional') 759 .removeData('optional'); 760 761 jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', 'none'); 762 jQuery('.en_connection_settings_old_api_fields') 763 .attr('data-optional', 1) 764 .attr('optional', 1) 765 .data('optional', 1); 766 } else { 767 jQuery('.en_connection_settings_old_api_fields').closest('tr').css('display', ''); 768 jQuery('.en_connection_settings_old_api_fields') 769 .removeAttr('data-optional') 770 .removeAttr('optional') 771 .removeData('optional'); 772 773 jQuery('.en_connection_settings_new_api_fields').closest('tr').css('display', 'none'); 774 jQuery('.en_connection_settings_new_api_fields') 775 .attr('data-optional', 1) 776 .attr('optional', 1) 777 .data('optional', 1); 778 } 779 } 780 } -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/connection-settings/en-connection-ajax.php
r3259053 r3462301 44 44 } 45 45 46 $api_selected = isset($en_post_data['en_connection_settings_api_dayross']) ? $en_post_data['en_connection_settings_api_dayross'] : ''; 47 46 48 $en_request_indexing = json_decode(EN_DAYROSS_SET_CONNECTION_SETTINGS, true); 47 49 $en_connection_request = json_decode(EN_DAYROSS_GET_CONNECTION_SETTINGS, true); … … 50 52 $en_connection_request[$en_request_indexing[$en_request_name]['eniture_action']] = $en_request_value; 51 53 } 54 55 // Handle New API 56 if ($api_selected && $api_selected == 'dayross_new_api') { 57 $en_connection_request['requestForNewAPI'] = 1; 58 $en_connection_request['emailAddress'] = $en_connection_request['_emailAddress']; 59 $en_connection_request['password'] = $en_connection_request['_password']; 60 $en_connection_request['billToAccountNumber'] = $en_connection_request['_billToAccountNumber']; 61 } else { 62 unset($en_connection_request['clientId'], $en_connection_request['clientSecret'], $en_connection_request['requestForNewAPI']); 63 } 64 65 // Remove unnecessary parameters 66 unset($en_connection_request['api'], $en_connection_request['_emailAddress'], $en_connection_request['_password'], $en_connection_request['_billToAccountNumber']); 52 67 53 68 $en_connection_request['dimWeightBaseAccount'] = (!empty($en_connection_request['dimWeightBaseAccount']) && 'dims' == $en_connection_request['dimWeightBaseAccount'])?'1':'0'; -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/connection-settings/en-connection-settings.php
r3154394 r3462301 64 64 self::$get_connection_details[$value['eniture_action']] = $saved_connection_detail : ''; 65 65 } 66 67 // Handle New API 68 if (isset($connection_request['api']) && $connection_request['api'] == 'dayross_old_api') { 69 unset($connection_request['api'], $connection_request['clientId'], $connection_request['clientSecret']); 70 } else { 71 $connection_request['requestForNewAPI'] = 1; 72 $connection_request['emailAddress'] = $connection_request['_emailAddress']; 73 $connection_request['password'] = $connection_request['_password']; 74 $connection_request['billToAccountNumber'] = $connection_request['_billToAccountNumber']; 75 } 76 77 // Remove unnecessary parameters 78 unset($connection_request['api'], $connection_request['_emailAddress'], $connection_request['_password'], $connection_request['_billToAccountNumber']); 66 79 67 80 $connection_request['dimWeightBaseAccount'] = (!empty($connection_request['dimWeightBaseAccount']) && 'dims' == $connection_request['dimWeightBaseAccount'])?'1':'0'; … … 107 120 static public function en_set_connection_settings_detail() 108 121 { 122 if (empty(get_option('en_connection_settings_api_dayross'))) { 123 update_option('en_connection_settings_api_dayross', 'dayross_old_api'); 124 } 125 109 126 return 110 127 [ 128 'en_connection_settings_api_dayross' => array( 129 'eniture_action' => 'api', 130 'name' => __('Which API will you connect to? ', 'woocommerce-settings-dayross'), 131 'type' => 'select', 132 'default' => 'dayross_old_api', 133 'id' => 'en_connection_settings_api_dayross', 134 'options' => array( 135 'dayross_old_api' => __('Legacy API', 'woocommerce-settings-dayross'), 136 'dayross_new_api' => __('New API', 'woocommerce-settings-dayross'), 137 ) 138 ), 139 140 // New API 141 'en_connection_settings_client_id_dayross' => [ 142 'eniture_action' => 'clientId', 143 'name' => __('Client ID ', 'woocommerce-settings-dayross'), 144 'type' => 'text', 145 'id' => 'en_connection_settings_client_id_dayross', 146 'class' => 'en_connection_settings_new_api_fields' 147 ], 148 'en_connection_settings_client_secret_dayross' => [ 149 'eniture_action' => 'clientSecret', 150 'name' => __('Client Secret ', 'woocommerce-settings-dayross'), 151 'type' => 'text', 152 'id' => 'en_connection_settings_client_secret_dayross', 153 'class' => 'en_connection_settings_new_api_fields' 154 ], 155 'en_connection_settings_new_api_username_dayross' => [ 156 'eniture_action' => '_emailAddress', 157 'name' => __('Email ', 'woocommerce-settings-dayross'), 158 'type' => 'text', 159 'id' => 'en_connection_settings_new_api_username_dayross', 160 'class' => 'en_connection_settings_new_api_fields' 161 ], 162 'en_connection_settings_new_api_password_dayross' => [ 163 'eniture_action' => '_password', 164 'name' => __('Password ', 'woocommerce-settings-dayross'), 165 'type' => 'text', 166 'id' => 'en_connection_settings_new_api_password_dayross', 167 'class' => 'en_connection_settings_new_api_fields' 168 ], 169 'en_connection_settings_new_api_account_number_dayross' => [ 170 'eniture_action' => '_billToAccountNumber', 171 'name' => __('Bill To Account Number ', 'woocommerce-settings-dayross'), 172 'type' => 'text', 173 'id' => 'en_connection_settings_new_api_account_number_dayross', 174 'class' => 'en_connection_settings_new_api_fields' 175 ], 176 177 // Old API 111 178 'en_connection_settings_username_dayross' => [ 112 179 'eniture_action' => 'emailAddress', 113 180 'name' => __('Email ', 'woocommerce-settings-dayross'), 114 181 'type' => 'text', 115 'desc' => __('', 'woocommerce-settings-dayross'), 116 'id' => 'en_connection_settings_username_dayross' 117 ], 118 182 'id' => 'en_connection_settings_username_dayross', 183 'class' => 'en_connection_settings_old_api_fields' 184 ], 119 185 'en_connection_settings_password_dayross' => [ 120 186 'eniture_action' => 'password', 121 187 'name' => __('Password ', 'woocommerce-settings-dayross'), 122 188 'type' => 'text', 123 'desc' => __('', 'woocommerce-settings-dayross'), 124 'id' => 'en_connection_settings_password_dayross' 125 ], 126 189 'id' => 'en_connection_settings_password_dayross', 190 'class' => 'en_connection_settings_old_api_fields' 191 ], 127 192 'en_connection_settings_account_number_dayross' => [ 128 193 'eniture_action' => 'billToAccountNumber', 129 194 'name' => __('Bill To Account Number ', 'woocommerce-settings-dayross'), 130 195 'type' => 'text', 131 ' desc' => __('', 'woocommerce-settings-dayross'),132 ' id' => 'en_connection_settings_account_number_dayross'196 'id' => 'en_connection_settings_account_number_dayross', 197 'class' => 'en_connection_settings_old_api_fields' 133 198 ], 134 199 -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/logs/en-logs.php
r3154394 r3462301 42 42 'licenseKey' => get_option('en_connection_settings_license_key_dayross'), 43 43 'lastLogs' => '25', 44 'carrierName' => 'dayross',44 'carrierName' => get_option('en_connection_settings_api_dayross') == 'dayross_new_api' ? 'Dayross LTL New API' : 'dayross', 45 45 ); 46 46 … … 106 106 // Formatting for showing all items on show more items button click 107 107 foreach ($formatted_info as $key => $value) { 108 $formattedSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' </p>';108 $formattedSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' ' . $value['origin']['senderCountryCode'] . '</p>'; 109 109 110 110 foreach ($value['items'] as $item) { … … 117 117 // Formatting for showingitems on hide more items button click 118 118 foreach ($hidden_formatted_info as $key => $value) { 119 $hiddenSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' </p>';119 $hiddenSenderAddress .= '<p>' . $value['origin']['senderCity'] . ', ' . $value['origin']['senderState'] . ' ' . $value['origin']['senderZip'] . ' ' . $value['origin']['senderCountryCode'] . '</p>'; 120 120 121 121 foreach ($value['items'] as $item) { -
ltl-freight-quotes-day-ross-edition/trunk/en-install.php
r3428882 r3462301 57 57 ]); 58 58 59 wp_enqueue_script('EnDayrossAdminJs', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.js', [], '1.1. 4');59 wp_enqueue_script('EnDayrossAdminJs', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.js', [], '1.1.5'); 60 60 wp_localize_script('EnDayrossAdminJs', 'en_dayross_admin_script', [ 61 61 'pluginsUrl' => EN_DAYROSS_PLUGIN_URL, … … 83 83 wp_enqueue_style('EnDayrossLocationStyle'); 84 84 85 wp_register_style('EnDayrossAdminCss', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.css', false, '1. 0.9');85 wp_register_style('EnDayrossAdminCss', EN_DAYROSS_DIR_FILE . '/admin/assets/en-dayross-admin.css', false, '1.1.0'); 86 86 wp_enqueue_style('EnDayrossAdminCss'); 87 87 -
ltl-freight-quotes-day-ross-edition/trunk/ltl-freight-quotes-dayross-edition.php
r3428882 r3462301 4 4 * Plugin URI: https://eniture.com/products/ 5 5 * Description: Dynamically retrieves your negotiated shipping rates from Day & Ross and displays the results in the WooCommerce shopping cart. 6 * Version: 2.2. 06 * Version: 2.2.1 7 7 * Author: Eniture Technology 8 8 * Author URI: http://eniture.com/ 9 9 * Text Domain: eniture-technology 10 * License: GPL version 2 or later - http://www.eniture.com/ 11 * WC requires at least: 6.4 12 * WC tested up to: 10.4.3 10 * License: GPLv2 or later 11 * Requires Plugins: woocommerce 13 12 */ 14 13 -
ltl-freight-quotes-day-ross-edition/trunk/readme.txt
r3428882 r3462301 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 2.2. 06 Stable tag: 2.2.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 149 149 == Changelog == 150 150 151 = 2.2.1 - 2026-02-16 = 152 * Update: Added support for the Day & Ross new API in the plugin. 153 151 154 = 2.2.0 - 2025-12-29 = 152 155 * Update: Added **location-specific Residential and Liftgate Pickup** feature. -
ltl-freight-quotes-day-ross-edition/trunk/server/api/en-response.php
r3428882 r3462301 99 99 self::$en_step_for_rates = $value; 100 100 101 // Severity check 102 $severity = self::en_sanitize_rate('severity', ''); 103 if (is_string($severity) && strlen($severity) > 0 && strtolower($severity) == 'error') { 104 return []; 105 } 106 101 107 $residential_detecion_flag = get_option("en_woo_addons_auto_residential_detecion_flag"); 102 108 $auto_renew_plan = get_option("auto_residential_delivery_plan_auto_renew"); … … 113 119 114 120 $instor_pickup_local_delivery = self::en_sanitize_rate('InstorPickupLocalDelivery', []); 115 116 $rates_with_liftgate = self::en_sanitize_rate('quotesWithLiftgate', []);117 121 $rate_with_liftgate = 0; 118 if (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']['TotalCharges'])) { 119 $quote_result = $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 120 $rate_with_liftgate = $quote_result['TotalCharges']; 121 $surcharge_with_liftgate = (isset($quote_result['completeAccessorialCharges'])) ? $quote_result['completeAccessorialCharges'] : []; 122 } elseif (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['GetRate2Response'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']['TotalAmount'])) { 123 $service_levels = $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 124 $rate_with_liftgate = $service_levels['TotalAmount']; 125 $surcharge_with_liftgate = (isset($service_levels['ShipmentCharges']['ShipmentCharge'])) ? $service_levels['ShipmentCharges']['ShipmentCharge'] : []; 122 $new_api_enabled = get_option('en_connection_settings_api_dayross') == 'dayross_new_api'; 123 124 if ($new_api_enabled) { 125 $simple_rates = isset($value['quotesWithoutLiftgate']) ? self::en_sanitize_rate('quotesWithoutLiftgate', []) : (isset($value['q']) ? self::en_sanitize_rate('q', []) : []); 126 $rates_with_liftgate = isset($value['quotesWithoutLiftgate']) && isset($value['q']) ? self::en_sanitize_rate('q', []) : []; 127 128 if (isset($rates_with_liftgate['totalCharges'])) { 129 $rate_with_liftgate = $rates_with_liftgate['totalCharges']; 130 } 131 } else { 132 $rates_with_liftgate = self::en_sanitize_rate('quotesWithLiftgate', []); 133 if (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse'], $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']['TotalCharges'])) { 134 $quote_result = $rates_with_liftgate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 135 $rate_with_liftgate = $quote_result['TotalCharges']; 136 } elseif (isset($rates_with_liftgate['soapBody'], $rates_with_liftgate['soapBody']['GetRate2Response'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels'], $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']['TotalAmount'])) { 137 $service_levels = $rates_with_liftgate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 138 $rate_with_liftgate = $service_levels['TotalAmount']; 139 } 140 141 $simple_rates = self::en_sanitize_rate('q', []); 126 142 } 127 143 128 144 // Standard Packaging 129 145 self::$standard_packaging = self::en_sanitize_rate('standardPackagingData', []); 130 $severity = self::en_sanitize_rate('severity', '');131 if (is_string($severity) && strlen($severity) > 0 && strtolower($severity) == 'error') {132 return [];133 }134 $simple_rates = self::en_sanitize_rate('q', []);135 146 136 147 $origin_level_markup = isset($en_package['originAddress'][$key]['origin_markup']) ? $en_package['originAddress'][$key]['origin_markup'] : 0; … … 208 219 * @param string $index 209 220 * @param dynamic $is_not_matched 210 * @return dynamic mixed221 * @return dynamic|string|array mixed 211 222 */ 212 223 static public function en_sanitize_rate($index, $is_not_matched) … … 252 263 foreach ($accessorials as $index => $accessorial) { 253 264 if ($shipment_ca) { 254 $key = (isset($accessorial['Description'])) ? $accessorial['Description'] : '';255 $amount = (isset($accessorial['Amount'])) ? $accessorial['Amount'] : 0;265 $key = (isset($accessorial['Description'])) ? $accessorial['Description'] : (isset($accessorial['description']) ? $accessorial['description'] : ''); 266 $amount = (isset($accessorial['Amount'])) ? $accessorial['Amount'] : (isset($accessorial['chargeAmount']) ? $accessorial['chargeAmount'] : 0); 256 267 } else { 257 268 $key = (isset($accessorial['reqAccessorial'])) ? $accessorial['reqAccessorial'] : ''; … … 282 293 $rates = []; 283 294 $shipment_ca = false; 284 if (isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['CreateUSQuoteResponse'], $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult'])) { 285 $rates = $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 286 $deliveryDate = ''; 287 extract($rates); 288 $rates['deliveryTimestamp'] = $deliveryDate; 289 } elseif ((isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['GetRate2Response'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']))) { 290 $rates = $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 291 $TotalAmount = $deliveryDate = $ShipmentCharges = ''; 292 extract($rates); 293 $rates['TotalCharges'] = $TotalAmount; 294 $rates['deliveryTimestamp'] = $deliveryDate; 295 $rates['completeAccessorialCharges'] = (isset($ShipmentCharges['ShipmentCharge'])) ? $ShipmentCharges['ShipmentCharge'] : []; 295 $new_api_enabled = get_option('en_connection_settings_api_dayross') == 'dayross_new_api'; 296 297 if ($new_api_enabled) { 298 $rates = $dayross_rate; 299 $rates['TotalCharges'] = isset($rates['totalCharges']) ? $rates['totalCharges'] : ''; 300 $rates['deliveryTimestamp'] = isset($rates['deliveryDate']) ? $rates['deliveryDate'] : ''; 301 $rates['completeAccessorialCharges'] = isset($rates['aCharges']) ? $rates['aCharges'] : []; 296 302 $shipment_ca = true; 297 } 298 299 $overlength_fees = $handling_fee = $en_settings_label = $rating_method = $transit_days = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 303 } else { 304 if (isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['CreateUSQuoteResponse'], $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult'])) { 305 $rates = $dayross_rate['soapBody']['CreateUSQuoteResponse']['CreateUSQuoteResult']; 306 $deliveryDate = ''; 307 extract($rates); 308 $rates['deliveryTimestamp'] = $deliveryDate; 309 } elseif ((isset($dayross_rate['soapBody'], $dayross_rate['soapBody']['GetRate2Response'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result'], $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']))) { 310 $rates = $dayross_rate['soapBody']['GetRate2Response']['GetRate2Result']['ServiceLevels']; 311 $TotalAmount = $deliveryDate = $ShipmentCharges = ''; 312 extract($rates); 313 $rates['TotalCharges'] = $TotalAmount; 314 $rates['deliveryTimestamp'] = $deliveryDate; 315 $rates['completeAccessorialCharges'] = (isset($ShipmentCharges['ShipmentCharge'])) ? $ShipmentCharges['ShipmentCharge'] : []; 316 $shipment_ca = true; 317 } 318 } 319 320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 321 $overlength_fees = []; 300 322 self::$en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 301 323 self::$en_accessorial = json_decode(EN_DAYROSS_ACCESSORIAL, true); … … 352 374 $label = isset($is_valid_label) && $is_valid_label ? $en_settings_label : 'Freight'; 353 375 $calculated_transit_date = self::en_sanitize_rate('deliveryTimestamp', ''); 354 $label = ($rating_method != "average_rate" && 355 is_string($calculated_transit_date) && 356 self::$en_is_shipment == 'en_single_shipment' && 357 strlen($calculated_transit_date) > 0 && 358 $transit_days == "yes") ? 359 $label . ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')' : $label; 376 $append_transit = ''; 377 378 if ($rating_method != "average_rate" && is_string($calculated_transit_date) && self::$en_is_shipment == 'en_single_shipment' && strlen($calculated_transit_date) > 0 && $transit_days == "yes") { 379 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 380 } 360 381 361 382 // make data for order widget detail … … 415 436 'surcharges' => self::en_get_accessorials_prices(self::en_sanitize_rate('completeAccessorialCharges', ''), $shipment_ca), 416 437 'meta_data' => $meta_data, 417 'transit_days' => $transit_days 438 'transit_days' => $transit_days, 439 'append_transit' => $append_transit 418 440 ]; 419 441 … … 506 528 ]; 507 529 } 508 509 530 } 510 531 -
ltl-freight-quotes-day-ross-edition/trunk/server/common/en-quote-settings.php
r3428882 r3462301 27 27 $en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 28 28 $en_settings['liftgate_delivery_option'] == 'yes' ? $accessorials['liftGateAsAnOption'] = '1' : ""; 29 $en_settings['liftgate_delivery'] == 'yes' ? $accessorials['accessorials']['TLGDEL'] = 'Tailgate Delivery' : ""; 29 $lfg_acc = get_option('en_connection_settings_api_dayross') == 'dayross_new_api' ? 'TLGDL' : 'TLGDEL'; 30 $en_settings['liftgate_delivery'] == 'yes' ? $accessorials['accessorials'][$lfg_acc] = 'Tailgate Delivery' : ""; 30 31 $en_settings['residential_delivery'] == 'yes' ? $accessorials['accessorials']['PRESDL'] = 'Private Residence Delivery' : ""; 31 32 $accessorials['handlingUnitWeight'] = $en_settings['handling_unit_weight']; -
ltl-freight-quotes-day-ross-edition/trunk/server/en-shipping-rates.php
r3428882 r3462301 160 160 $response = \EnDayrossCurl\EnDayrossCurl::en_dayross_sent_http_request(EN_DAYROSS_HITTING_API_URL, $en_package, 'POST', 'Quotes'); 161 161 } 162 163 164 162 } 165 166 }else { 163 } else { 167 164 return $response = []; 168 165 } 166 169 167 // Get Small package quotes charges. 170 168 $en_small_package_quotes = EnDayrossSPQ\EnDayrossSPQ::en_small_package_quotes($package, $this->small_package); … … 222 220 } 223 221 $rate['label'] .= (!empty($label_sufex)) ? ' with ' . implode(' and ', $label_sufex) : ''; 222 $rate['label'] .= !empty($rate['append_transit']) ? $rate['append_transit'] : ''; 224 223 isset($rate['cost']) && $en_small_package_charges > 0 ? 225 224 $rate['cost'] = $rate['cost'] + $en_small_package_charges : 0; -
ltl-freight-quotes-day-ross-edition/trunk/server/package/en-package.php
r3428882 r3462301 24 24 25 25 static public $post_id; 26 static public $parent_id; 26 27 static public $locations; 27 28 static public $product_key_name; … … 35 36 // Images for FDO 36 37 static public $en_fdo_image_urls = []; 38 static public $has_nesting = false; 37 39 38 40 /** … … 110 112 self::$post_id = (isset($product['variation_id']) && $product['variation_id'] > 0) ? 111 113 $product['variation_id'] : $product_data->get_id(); 112 $parent_id = self::$post_id;114 self::$parent_id = $parent_id = self::$post_id; 113 115 if(isset($product['variation_id']) && $product['variation_id'] > 0){ 114 116 $variation = wc_get_product($product['variation_id']); 115 $parent_id = $variation->get_parent_id();117 self::$parent_id = $parent_id = $variation->get_parent_id(); 116 118 } 117 119 $haz_status = ''; … … 121 123 if ($dr_plan != 0 && $dr_plan != 1) { 122 124 $haz_array = get_post_meta(self::$post_id, '_hazardousmaterials'); 125 // check if parent has hazardous materials 126 if (isset($haz_array[0]) && empty($haz_array[0]) && self::$parent_id != self::$post_id) { 127 $haz_array = get_post_meta(self::$parent_id, '_hazardousmaterials'); 128 } 129 123 130 isset($haz_array[0]) && $haz_array[0] == 'yes' ? $haz_status = 'Y' : $haz_status = ''; 124 131 } … … 130 137 if ($dr_plan == 3) { 131 138 $nested_mat = get_post_meta(self::$post_id, '_nestedMaterials'); 132 isset($nested_mat[0]) && $nested_mat[0] == 'yes' ? $doNesting = 1 : $doNesting = ''; 139 if (isset($nested_mat[0]) && empty($nested_mat[0]) && self::$parent_id != self::$post_id) { 140 $nested_mat = get_post_meta(self::$parent_id, '_nestedMaterials'); 141 } 142 143 isset($nested_mat[0]) && $nested_mat[0] == 'yes' ? self::$has_nesting = $doNesting = 1 : $doNesting = ''; 133 144 134 145 $nested_percen = get_post_meta(self::$post_id, '_nestedPercentage'); … … 136 147 137 148 $nested_dim = get_post_meta(self::$post_id, '_nestedDimension'); 149 if (isset($nested_dim[0]) && empty($nested_dim[0]) && self::$parent_id != self::$post_id) { 150 $nested_dim = get_post_meta(self::$parent_id, '_nestedDimension'); 151 } 152 138 153 !empty($nested_dim) ? $nested_dimension = $nested_dim[0] : $nested_dimension = 0; 139 154 140 155 $max_nested_item = get_post_meta(self::$post_id, '_maxNestedItems'); 156 if (isset($max_nested_item[0]) && empty($max_nested_item[0]) && self::$parent_id != self::$post_id) { 157 $max_nested_item = get_post_meta(self::$parent_id, '_maxNestedItems'); 158 } 159 141 160 !empty($max_nested_item) ? $max_nested_items = $max_nested_item[0] : $max_nested_items = 0; 142 161 … … 373 392 self::$en_request = array_merge(self::$en_request, self::$receiver_address); 374 393 self::$en_request['instorPickupLocalDelEnable'] = self::$instore_pickup_local_delivery; 394 self::$en_request['doNesting'] = self::$has_nesting ? 1 : ''; 375 395 376 396 self::$en_request['shipment_type'] = (isset(self::$en_request['LTL_FREIGHT'])) ? … … 612 632 case '_dropship_location': 613 633 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 634 // check for parent id 635 if (empty($enable_dropship) && self::$parent_id > 0 && self::$parent_id != self::$post_id) { 636 self::$post_id = self::$parent_id; 637 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 638 } 639 614 640 switch ($enable_dropship) { 615 641 case 'yes':
Note: See TracChangeset
for help on using the changeset viewer.