Changeset 3442307
- Timestamp:
- 01/19/2026 08:39:05 AM (2 months ago)
- Location:
- ltl-freight-quotes-unishippers-edition
- Files:
-
- 19 edited
- 1 copied
-
tags/2.5.16/readme.txt (modified) (2 diffs)
-
tags/2.5.17 (copied) (copied from ltl-freight-quotes-unishippers-edition/trunk)
-
tags/2.5.17/js/en-unishippers-freight.js (modified) (1 diff)
-
tags/2.5.17/ltl-freight-quotes-unishippers-edition.php (modified) (3 diffs)
-
tags/2.5.17/readme.txt (modified) (2 diffs)
-
tags/2.5.17/shipping-rules/assets/js/shipping_rules.js (modified) (2 diffs)
-
tags/2.5.17/shipping-rules/shipping-rules-save.php (modified) (5 diffs)
-
tags/2.5.17/shipping-rules/shipping-rules-template.php (modified) (1 diff)
-
tags/2.5.17/unishippers-ltl-carrier-service.php (modified) (3 diffs)
-
tags/2.5.17/unishippers-ltl-liftgate-as-option.php (modified) (1 diff)
-
tags/2.5.17/unishippers-ltl-shipping-class.php (modified) (8 diffs)
-
trunk/js/en-unishippers-freight.js (modified) (1 diff)
-
trunk/ltl-freight-quotes-unishippers-edition.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/shipping-rules/assets/js/shipping_rules.js (modified) (2 diffs)
-
trunk/shipping-rules/shipping-rules-save.php (modified) (5 diffs)
-
trunk/shipping-rules/shipping-rules-template.php (modified) (1 diff)
-
trunk/unishippers-ltl-carrier-service.php (modified) (3 diffs)
-
trunk/unishippers-ltl-liftgate-as-option.php (modified) (1 diff)
-
trunk/unishippers-ltl-shipping-class.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ltl-freight-quotes-unishippers-edition/tags/2.5.16/readme.txt
r3430531 r3442307 3 3 Tags: eniture,Unishippers,,LTL freight rates,LTL freight quotes, shipping estimates 4 4 Requires at least: 6.4 5 Tested up to: 6. 86 Stable tag: 2.5.1 65 Tested up to: 6.9 6 Stable tag: 2.5.17 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 167 167 == Changelog == 168 168 169 = 2.5.17 - 2026-01-19 = 170 * Update: Allowed **negative values and percentage (%) inputs** in the override rate shipping rule to support discount adjustments. 171 169 172 = 2.5.16 - 2026-01-01 = 170 173 * Update: Added Residential Pickup feature to enhance pickup service options. -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/js/en-unishippers-freight.js
r3430531 r3442307 303 303 jQuery(".test_connection_success_message").remove(); 304 304 jQuery(".unishippers_ltl_connection_section_class .button-primary, .unishippers_ltl_connection_section_class .is-primary").attr("disabled", false); 305 if (data.error) { 306 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! ' + data.error + ' </b></p>'); 305 if (data.error || (data.severity && data.severity == 'ERROR')) { 306 const error_msg = data.error ? data.error : (data.Message ? data.Message : ''); 307 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! ' + error_msg + ' </b></p>'); 307 308 } else { 308 309 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! The credentials entered did not result in a successful test. Confirm your credentials and try again. </b></p>'); -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/ltl-freight-quotes-unishippers-edition.php
r3430531 r3442307 6 6 Author: Eniture Technology 7 7 Author URI: http://eniture.com/ 8 Version: 2.5.1 68 Version: 2.5.17 9 9 Text Domain: ltl-freight-quotes-unishippers-edition 10 License: GPL -2.0-or-later10 License: GPLv2 or later 11 11 */ 12 12 … … 205 205 206 206 // Shipping rules script and styles 207 wp_enqueue_script('en_unishippers_ltl_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0. 1');207 wp_enqueue_script('en_unishippers_ltl_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0.2'); 208 208 wp_localize_script('en_unishippers_ltl_sr_script', 'sr_script', array( 209 209 'pluginsUrl' => plugins_url(), … … 223 223 { 224 224 wp_enqueue_script('jquery'); 225 wp_enqueue_script('en_unishippers_freight_script', plugin_dir_url(__FILE__) . 'js/en-unishippers-freight.js', array(), '1.1. 6');225 wp_enqueue_script('en_unishippers_freight_script', plugin_dir_url(__FILE__) . 'js/en-unishippers-freight.js', array(), '1.1.7'); 226 226 wp_localize_script('en_unishippers_freight_script', 'en_unishippers_freight_admin_script', array( 227 227 'plugins_url' => plugins_url(), -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/readme.txt
r3430531 r3442307 3 3 Tags: eniture,Unishippers,,LTL freight rates,LTL freight quotes, shipping estimates 4 4 Requires at least: 6.4 5 Tested up to: 6. 86 Stable tag: 2.5.1 65 Tested up to: 6.9 6 Stable tag: 2.5.17 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 167 167 == Changelog == 168 168 169 = 2.5.17 - 2026-01-19 = 170 * Update: Allowed **negative values and percentage (%) inputs** in the override rate shipping rule to support advanced pricing adjustments. 171 169 172 = 2.5.16 - 2026-01-01 = 170 173 * Update: Added Residential Pickup feature to enhance pickup service options. -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/shipping-rules/assets/js/shipping_rules.js
r3237773 r3442307 31 31 32 32 jQuery( 33 '#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_ service_rate, #en_sr_liftgate_weight_restrictions'33 '#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_liftgate_weight_restrictions' 34 34 ).keypress(function (e) { 35 35 if (!String.fromCharCode(e.keyCode).match(/^[0-9.]+$/)) return false; … … 37 37 jQuery('#en_sr_quantity_from, #en_sr_quantity_to').keypress(function (e) { 38 38 if (!String.fromCharCode(e.keyCode).match(/^[0-9]+$/)) return false; 39 }); 40 jQuery('#en_sr_service_rate').keypress(function (e) { 41 if (!String.fromCharCode(e.keyCode).match(/^[0-9.%-]+$/)) return false; 39 42 }); 40 43 -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/shipping-rules/shipping-rules-save.php
r3251023 r3442307 461 461 462 462 $surcharges = isset($quote->accessorialCharges) ? $quote->accessorialCharges : []; 463 isset($quote->totalNetCharge) && $quote->totalNetCharge = floatval($service_rate) + $this->get_resi_and_lfg_fees($surcharges); 464 isset($quote->totalOfferPrice->value) && $quote->totalOfferPrice->value = floatval($service_rate) + $this->get_resi_and_lfg_fees($surcharges); 463 // Old API 464 if (isset($quote->totalNetCharge)) { 465 $net_rate = $quote->totalNetCharge; 466 $quote->totalNetCharge = $this->get_service_rate($net_rate, $service_rate) + $this->get_resi_and_lfg_fees($surcharges); 467 $quote->overrideRate = true; 468 } 469 470 // New API 471 if (isset($quote->totalOfferPrice->value)) { 472 $net_rate = $quote->totalOfferPrice->value; 473 $quote->totalOfferPrice->value = $this->get_service_rate($net_rate, $service_rate) + $this->get_resi_and_lfg_fees($surcharges); 474 $quote->overrideRate = true; 475 } 465 476 466 477 $quote_results[$quote_key] = $quote; … … 510 521 511 522 $surcharges_fee = $surcharges->$s_type; 512 $quote->accessorialCharges->$s_type = $ service_rate;523 $quote->accessorialCharges->$s_type = $this->get_service_rate($surcharges_fee, $service_rate); 513 524 514 525 if ($new_api_enabled) { … … 520 531 $_key = $surcharge->customerChargeCode == 'LGDEL' ? 'liftgateFee' : 'residentialFee'; 521 532 if ($_key == $type) { 522 $quote->surchargeList[0]->chargeItemList[$s_key]->customerPrice->value = $ service_rate;533 $quote->surchargeList[0]->chargeItemList[$s_key]->customerPrice->value = $this->get_service_rate($surcharge->customerPrice->value, $service_rate); 523 534 } 524 535 } … … 533 544 534 545 $rate_charge = isset($quote->totalNetCharge) ? $quote->totalNetCharge : 0; 535 $rate_charge = isset($quote->totalOfferPrice->value) ? $quote->totalOfferPrice->value : $rate_charge; 546 $rate_charge = isset($quote->totalOfferPrice->value) ? $quote->totalOfferPrice->value : $rate_charge; 536 547 $rate_charge = floatval($rate_charge) - floatval($surcharges_fee); 537 $rate_charge += floatval($service_rate);548 $rate_charge += $this->get_service_rate($surcharges_fee, $service_rate); 538 549 isset($quote->totalNetCharge) && $quote->totalNetCharge = $rate_charge; 539 550 isset($quote->totalOfferPrice->value) && $quote->totalOfferPrice->value = $rate_charge; 551 $type == 'liftgateFee' && $quote->liftgate_overrideRate = true; 540 552 541 553 $quote_results[$quote_key] = $quote; … … 617 629 return $liftgate_exclude_limit; 618 630 } 631 632 // MARK: Get Service Rate 633 function get_service_rate($net_rate, $service_rate) 634 { 635 if (strpos($service_rate, '%') === false) return floatval($service_rate) <= 0 ? 0 : floatval($service_rate); 636 637 // Calculate the percentage of service rate based on net rate and add it to net rate 638 $service_rate = str_replace('%', '', $service_rate) / 100; 639 $service_rate = floatval($net_rate) * floatval($service_rate); 640 $net_rate = floatval($net_rate) + floatval($service_rate); 641 642 return $net_rate; 643 } 619 644 } 620 645 } -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/shipping-rules/shipping-rules-template.php
r3251023 r3442307 190 190 <div class="en_sr_form_control"> 191 191 <label for="en_sr_service_rate">Service rate (e.g. 5.25)</label> 192 <input type="text" title="Service rate" name="en_sr_service_rate" id="en_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" >192 <input type="text" title="Service rate" name="en_sr_service_rate" id="en_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" placeholder="Enter amount or percentage (e.g. 10, -5, 20%)"> 193 193 <span class="en_sr_err"></span> 194 194 </div> -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/unishippers-ltl-carrier-service.php
r3430531 r3442307 623 623 'offer_id' => isset($quote->offerId) ? $quote->offerId : '', 624 624 'product_transaction_id' => isset($quote->productTransactionId) ? $quote->productTransactionId : '', 625 'override_rate' => isset($quote->overrideRate) ? $quote->overrideRate : '', 625 626 ); 626 627 … … 714 715 'plugin_name' => 'unishippersLtl', 715 716 'plugin_type' => 'ltl', 716 'owned_by' => 'eniture' 717 'owned_by' => 'eniture', 718 'override_rate' => isset($quote->overrideRate) ? $quote->overrideRate : false 717 719 ); 718 720 … … 980 982 foreach ($withOutLFGQuotes as $key => $quote) { 981 983 if (isset($withOutLFGQuotes[$key]->accessorialCharges->liftgateFee) && isset($withOutLFGQuotes[$key]->liftgateFee)) { 982 if (empty($withOutLFGQuotes[$key]->liftgateFee) ) {984 if (empty($withOutLFGQuotes[$key]->liftgateFee) && !isset($withOutLFGQuotes[$key]->liftgate_overrideRate)) { 983 985 unset($withOutLFGQuotes[$key]); 984 986 continue; -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/unishippers-ltl-liftgate-as-option.php
r2994911 r3442307 105 105 * filter label from api response 106 106 * @param array type $result 107 * @return ar ay type107 * @return array type 108 108 */ 109 109 public function filter_label_sufex_array_unishippers_freight($result) -
ltl-freight-quotes-unishippers-edition/tags/2.5.17/unishippers-ltl-shipping-class.php
r3430531 r3442307 42 42 public $en_fdo_meta_data_third_party = []; 43 43 public $minPrices; 44 public $override_rates = array(); 44 45 45 46 /** … … 333 334 $rates = reset($rates); 334 335 $this->minPrices['UNISHIPPERS_LIFT'][$key] = $rates; 336 $this->override_rates['UNISHIPPERS_LIFT'] = isset($rates['override_rate']) && $rates['override_rate']; 335 337 336 338 $_cost = (isset($rates['cost'])) ? $rates['cost'] : 0; … … 355 357 $s_rates = reset($s_rates); 356 358 $this->minPrices['UNISHIPPERS_NOTLIFT'][$key] = $s_rates; 359 $this->override_rates['UNISHIPPERS_NOTLIFT'] = isset($s_rates['override_rate']) && $s_rates['override_rate']; 357 360 $s_cost = (isset($s_rates['cost'])) ? $s_rates['cost'] : 0; 358 361 … … 377 380 // Excluded accessorials 378 381 $en_accessorial_excluded = apply_filters('en_unishippers_ltl_accessorial_excluded', []); 379 ($s_multi_cost > 0) ? $rate[] = $this->arrange_multiship_freight(($s_multi_cost + $smpkgCost), 'UNISHIPPERS_NOTLIFT', $s_label, $s_append_label) : ""; 382 ($s_multi_cost > 0 || ($s_multi_cost <= 0 && isset($this->override_rates['UNISHIPPERS_NOTLIFT']) && $this->override_rates['UNISHIPPERS_NOTLIFT'])) ? $rate[] = $this->arrange_multiship_freight(($s_multi_cost + $smpkgCost), 'UNISHIPPERS_NOTLIFT', $s_label, $s_append_label) : ""; 383 380 384 if ($s_multi_cost > 0 && !empty($en_accessorial_excluded) && in_array('liftgateResidentialExcluded', $en_accessorial_excluded)) { 381 385 $multi_cost = 0; 382 386 } 383 ($multi_cost > 0) ? $rate[] = $this->arrange_multiship_freight(($multi_cost + $smpkgCost), 'UNISHIPPERS_LIFT', $_label, $append_label) : ""; 387 388 ($multi_cost > 0 || ($multi_cost <= 0 && isset($this->override_rates['UNISHIPPERS_LIFT']) && $this->override_rates['UNISHIPPERS_LIFT'])) ? $rate[] = $this->arrange_multiship_freight(($multi_cost + $smpkgCost), 'UNISHIPPERS_LIFT', $_label, $append_label) : ""; 384 389 385 390 $this->shipment_type = 'multiple'; … … 564 569 function arrange_multiship_freight($cost, $id, $label_sufex, $append_label) 565 570 { 566 567 571 return array( 568 572 'id' => $id, … … 573 577 'plugin_name' => 'unishippersLtl', 574 578 'plugin_type' => 'ltl', 575 'owned_by' => 'eniture' 579 'owned_by' => 'eniture', 580 'override_rate' => isset($this->override_rates[$id]) && $this->override_rates[$id] 576 581 ); 577 582 } … … 705 710 public function unishippers_freight_add_rate_arr($add_rate_arr) 706 711 { 707 708 712 if (isset($add_rate_arr) && (!empty($add_rate_arr)) && (is_array($add_rate_arr))) { 709 713 … … 716 720 717 721 foreach ($add_rate_arr as $key => $rate) { 718 719 if (isset($rate['cost']) && $rate['cost'] > 0) { 722 // Override rate for shipping rules 723 $override_rate = isset($rate['override_rate']) ? $rate['override_rate'] : false; 724 725 if (isset($rate['cost']) && ($rate['cost'] > 0 || $override_rate)) { 720 726 $rate['label'] = $this->set_label_in_quote($rate); 721 727 -
ltl-freight-quotes-unishippers-edition/trunk/js/en-unishippers-freight.js
r3430531 r3442307 303 303 jQuery(".test_connection_success_message").remove(); 304 304 jQuery(".unishippers_ltl_connection_section_class .button-primary, .unishippers_ltl_connection_section_class .is-primary").attr("disabled", false); 305 if (data.error) { 306 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! ' + data.error + ' </b></p>'); 305 if (data.error || (data.severity && data.severity == 'ERROR')) { 306 const error_msg = data.error ? data.error : (data.Message ? data.Message : ''); 307 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! ' + error_msg + ' </b></p>'); 307 308 } else { 308 309 jQuery('.warning-msg-unishippers_ltl').before('<p class="test_connection_error_message" ><b>Error! The credentials entered did not result in a successful test. Confirm your credentials and try again. </b></p>'); -
ltl-freight-quotes-unishippers-edition/trunk/ltl-freight-quotes-unishippers-edition.php
r3430531 r3442307 6 6 Author: Eniture Technology 7 7 Author URI: http://eniture.com/ 8 Version: 2.5.1 68 Version: 2.5.17 9 9 Text Domain: ltl-freight-quotes-unishippers-edition 10 License: GPL -2.0-or-later10 License: GPLv2 or later 11 11 */ 12 12 … … 205 205 206 206 // Shipping rules script and styles 207 wp_enqueue_script('en_unishippers_ltl_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0. 1');207 wp_enqueue_script('en_unishippers_ltl_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0.2'); 208 208 wp_localize_script('en_unishippers_ltl_sr_script', 'sr_script', array( 209 209 'pluginsUrl' => plugins_url(), … … 223 223 { 224 224 wp_enqueue_script('jquery'); 225 wp_enqueue_script('en_unishippers_freight_script', plugin_dir_url(__FILE__) . 'js/en-unishippers-freight.js', array(), '1.1. 6');225 wp_enqueue_script('en_unishippers_freight_script', plugin_dir_url(__FILE__) . 'js/en-unishippers-freight.js', array(), '1.1.7'); 226 226 wp_localize_script('en_unishippers_freight_script', 'en_unishippers_freight_admin_script', array( 227 227 'plugins_url' => plugins_url(), -
ltl-freight-quotes-unishippers-edition/trunk/readme.txt
r3430531 r3442307 3 3 Tags: eniture,Unishippers,,LTL freight rates,LTL freight quotes, shipping estimates 4 4 Requires at least: 6.4 5 Tested up to: 6. 86 Stable tag: 2.5.1 65 Tested up to: 6.9 6 Stable tag: 2.5.17 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 167 167 == Changelog == 168 168 169 = 2.5.17 - 2026-01-19 = 170 * Update: Allowed **negative values and percentage (%) inputs** in the override rate shipping rule to support advanced pricing adjustments. 171 169 172 = 2.5.16 - 2026-01-01 = 170 173 * Update: Added Residential Pickup feature to enhance pickup service options. -
ltl-freight-quotes-unishippers-edition/trunk/shipping-rules/assets/js/shipping_rules.js
r3237773 r3442307 31 31 32 32 jQuery( 33 '#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_ service_rate, #en_sr_liftgate_weight_restrictions'33 '#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_liftgate_weight_restrictions' 34 34 ).keypress(function (e) { 35 35 if (!String.fromCharCode(e.keyCode).match(/^[0-9.]+$/)) return false; … … 37 37 jQuery('#en_sr_quantity_from, #en_sr_quantity_to').keypress(function (e) { 38 38 if (!String.fromCharCode(e.keyCode).match(/^[0-9]+$/)) return false; 39 }); 40 jQuery('#en_sr_service_rate').keypress(function (e) { 41 if (!String.fromCharCode(e.keyCode).match(/^[0-9.%-]+$/)) return false; 39 42 }); 40 43 -
ltl-freight-quotes-unishippers-edition/trunk/shipping-rules/shipping-rules-save.php
r3251023 r3442307 461 461 462 462 $surcharges = isset($quote->accessorialCharges) ? $quote->accessorialCharges : []; 463 isset($quote->totalNetCharge) && $quote->totalNetCharge = floatval($service_rate) + $this->get_resi_and_lfg_fees($surcharges); 464 isset($quote->totalOfferPrice->value) && $quote->totalOfferPrice->value = floatval($service_rate) + $this->get_resi_and_lfg_fees($surcharges); 463 // Old API 464 if (isset($quote->totalNetCharge)) { 465 $net_rate = $quote->totalNetCharge; 466 $quote->totalNetCharge = $this->get_service_rate($net_rate, $service_rate) + $this->get_resi_and_lfg_fees($surcharges); 467 $quote->overrideRate = true; 468 } 469 470 // New API 471 if (isset($quote->totalOfferPrice->value)) { 472 $net_rate = $quote->totalOfferPrice->value; 473 $quote->totalOfferPrice->value = $this->get_service_rate($net_rate, $service_rate) + $this->get_resi_and_lfg_fees($surcharges); 474 $quote->overrideRate = true; 475 } 465 476 466 477 $quote_results[$quote_key] = $quote; … … 510 521 511 522 $surcharges_fee = $surcharges->$s_type; 512 $quote->accessorialCharges->$s_type = $ service_rate;523 $quote->accessorialCharges->$s_type = $this->get_service_rate($surcharges_fee, $service_rate); 513 524 514 525 if ($new_api_enabled) { … … 520 531 $_key = $surcharge->customerChargeCode == 'LGDEL' ? 'liftgateFee' : 'residentialFee'; 521 532 if ($_key == $type) { 522 $quote->surchargeList[0]->chargeItemList[$s_key]->customerPrice->value = $ service_rate;533 $quote->surchargeList[0]->chargeItemList[$s_key]->customerPrice->value = $this->get_service_rate($surcharge->customerPrice->value, $service_rate); 523 534 } 524 535 } … … 533 544 534 545 $rate_charge = isset($quote->totalNetCharge) ? $quote->totalNetCharge : 0; 535 $rate_charge = isset($quote->totalOfferPrice->value) ? $quote->totalOfferPrice->value : $rate_charge; 546 $rate_charge = isset($quote->totalOfferPrice->value) ? $quote->totalOfferPrice->value : $rate_charge; 536 547 $rate_charge = floatval($rate_charge) - floatval($surcharges_fee); 537 $rate_charge += floatval($service_rate);548 $rate_charge += $this->get_service_rate($surcharges_fee, $service_rate); 538 549 isset($quote->totalNetCharge) && $quote->totalNetCharge = $rate_charge; 539 550 isset($quote->totalOfferPrice->value) && $quote->totalOfferPrice->value = $rate_charge; 551 $type == 'liftgateFee' && $quote->liftgate_overrideRate = true; 540 552 541 553 $quote_results[$quote_key] = $quote; … … 617 629 return $liftgate_exclude_limit; 618 630 } 631 632 // MARK: Get Service Rate 633 function get_service_rate($net_rate, $service_rate) 634 { 635 if (strpos($service_rate, '%') === false) return floatval($service_rate) <= 0 ? 0 : floatval($service_rate); 636 637 // Calculate the percentage of service rate based on net rate and add it to net rate 638 $service_rate = str_replace('%', '', $service_rate) / 100; 639 $service_rate = floatval($net_rate) * floatval($service_rate); 640 $net_rate = floatval($net_rate) + floatval($service_rate); 641 642 return $net_rate; 643 } 619 644 } 620 645 } -
ltl-freight-quotes-unishippers-edition/trunk/shipping-rules/shipping-rules-template.php
r3251023 r3442307 190 190 <div class="en_sr_form_control"> 191 191 <label for="en_sr_service_rate">Service rate (e.g. 5.25)</label> 192 <input type="text" title="Service rate" name="en_sr_service_rate" id="en_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" >192 <input type="text" title="Service rate" name="en_sr_service_rate" id="en_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" placeholder="Enter amount or percentage (e.g. 10, -5, 20%)"> 193 193 <span class="en_sr_err"></span> 194 194 </div> -
ltl-freight-quotes-unishippers-edition/trunk/unishippers-ltl-carrier-service.php
r3430531 r3442307 623 623 'offer_id' => isset($quote->offerId) ? $quote->offerId : '', 624 624 'product_transaction_id' => isset($quote->productTransactionId) ? $quote->productTransactionId : '', 625 'override_rate' => isset($quote->overrideRate) ? $quote->overrideRate : '', 625 626 ); 626 627 … … 714 715 'plugin_name' => 'unishippersLtl', 715 716 'plugin_type' => 'ltl', 716 'owned_by' => 'eniture' 717 'owned_by' => 'eniture', 718 'override_rate' => isset($quote->overrideRate) ? $quote->overrideRate : false 717 719 ); 718 720 … … 980 982 foreach ($withOutLFGQuotes as $key => $quote) { 981 983 if (isset($withOutLFGQuotes[$key]->accessorialCharges->liftgateFee) && isset($withOutLFGQuotes[$key]->liftgateFee)) { 982 if (empty($withOutLFGQuotes[$key]->liftgateFee) ) {984 if (empty($withOutLFGQuotes[$key]->liftgateFee) && !isset($withOutLFGQuotes[$key]->liftgate_overrideRate)) { 983 985 unset($withOutLFGQuotes[$key]); 984 986 continue; -
ltl-freight-quotes-unishippers-edition/trunk/unishippers-ltl-liftgate-as-option.php
r2994911 r3442307 105 105 * filter label from api response 106 106 * @param array type $result 107 * @return ar ay type107 * @return array type 108 108 */ 109 109 public function filter_label_sufex_array_unishippers_freight($result) -
ltl-freight-quotes-unishippers-edition/trunk/unishippers-ltl-shipping-class.php
r3430531 r3442307 42 42 public $en_fdo_meta_data_third_party = []; 43 43 public $minPrices; 44 public $override_rates = array(); 44 45 45 46 /** … … 333 334 $rates = reset($rates); 334 335 $this->minPrices['UNISHIPPERS_LIFT'][$key] = $rates; 336 $this->override_rates['UNISHIPPERS_LIFT'] = isset($rates['override_rate']) && $rates['override_rate']; 335 337 336 338 $_cost = (isset($rates['cost'])) ? $rates['cost'] : 0; … … 355 357 $s_rates = reset($s_rates); 356 358 $this->minPrices['UNISHIPPERS_NOTLIFT'][$key] = $s_rates; 359 $this->override_rates['UNISHIPPERS_NOTLIFT'] = isset($s_rates['override_rate']) && $s_rates['override_rate']; 357 360 $s_cost = (isset($s_rates['cost'])) ? $s_rates['cost'] : 0; 358 361 … … 377 380 // Excluded accessorials 378 381 $en_accessorial_excluded = apply_filters('en_unishippers_ltl_accessorial_excluded', []); 379 ($s_multi_cost > 0) ? $rate[] = $this->arrange_multiship_freight(($s_multi_cost + $smpkgCost), 'UNISHIPPERS_NOTLIFT', $s_label, $s_append_label) : ""; 382 ($s_multi_cost > 0 || ($s_multi_cost <= 0 && isset($this->override_rates['UNISHIPPERS_NOTLIFT']) && $this->override_rates['UNISHIPPERS_NOTLIFT'])) ? $rate[] = $this->arrange_multiship_freight(($s_multi_cost + $smpkgCost), 'UNISHIPPERS_NOTLIFT', $s_label, $s_append_label) : ""; 383 380 384 if ($s_multi_cost > 0 && !empty($en_accessorial_excluded) && in_array('liftgateResidentialExcluded', $en_accessorial_excluded)) { 381 385 $multi_cost = 0; 382 386 } 383 ($multi_cost > 0) ? $rate[] = $this->arrange_multiship_freight(($multi_cost + $smpkgCost), 'UNISHIPPERS_LIFT', $_label, $append_label) : ""; 387 388 ($multi_cost > 0 || ($multi_cost <= 0 && isset($this->override_rates['UNISHIPPERS_LIFT']) && $this->override_rates['UNISHIPPERS_LIFT'])) ? $rate[] = $this->arrange_multiship_freight(($multi_cost + $smpkgCost), 'UNISHIPPERS_LIFT', $_label, $append_label) : ""; 384 389 385 390 $this->shipment_type = 'multiple'; … … 564 569 function arrange_multiship_freight($cost, $id, $label_sufex, $append_label) 565 570 { 566 567 571 return array( 568 572 'id' => $id, … … 573 577 'plugin_name' => 'unishippersLtl', 574 578 'plugin_type' => 'ltl', 575 'owned_by' => 'eniture' 579 'owned_by' => 'eniture', 580 'override_rate' => isset($this->override_rates[$id]) && $this->override_rates[$id] 576 581 ); 577 582 } … … 705 710 public function unishippers_freight_add_rate_arr($add_rate_arr) 706 711 { 707 708 712 if (isset($add_rate_arr) && (!empty($add_rate_arr)) && (is_array($add_rate_arr))) { 709 713 … … 716 720 717 721 foreach ($add_rate_arr as $key => $rate) { 718 719 if (isset($rate['cost']) && $rate['cost'] > 0) { 722 // Override rate for shipping rules 723 $override_rate = isset($rate['override_rate']) ? $rate['override_rate'] : false; 724 725 if (isset($rate['cost']) && ($rate['cost'] > 0 || $override_rate)) { 720 726 $rate['label'] = $this->set_label_in_quote($rate); 721 727
Note: See TracChangeset
for help on using the changeset viewer.