Plugin Directory

Changeset 3480894


Ignore:
Timestamp:
03/12/2026 07:49:01 AM (3 weeks ago)
Author:
enituretechnology
Message:

2.3.9 - 2026-03-12

  • Update: Added Notify Before Delivery feature to allow notification prior to shipment delivery.
  • Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.

Ticket 37497085511

Location:
ltl-freight-quotes-saia-edition
Files:
2 deleted
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ltl-freight-quotes-saia-edition/tags/2.3.9/fdo/en-fdo.php

    r3430509 r3480894  
    3333        $accessorials['liftgate_pickup'] = isset($package['origin'], $package['origin']['liftgate_pickup']) && $package['origin']['liftgate_pickup'] ? true : false;
    3434        $accessorials['limited_access'] = get_option('saia_limited_access') == 'yes' ? true : false;
     35        $accessorials['notify'] = get_option('saia_notify_before') == 'yes' ? true : false;
    3536        $this->en_fdo_meta_data['accessorials'] = $accessorials;
    3637
  • ltl-freight-quotes-saia-edition/tags/2.3.9/js/saia.js

    r3456816 r3480894  
    361361                jQuery("#message").remove();
    362362
    363                 if (data.message === "success") {
    364                     jQuery('.warning-msg').before('<div class="notice notice-success saia_success_message"><p><strong>Success!</strong> The test resulted in a successful connection.</p></div>');
    365                 } else if (data.message == "UserID and Password Incorrect.") {
    366 
    367                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong> Please verify credentials and try again.</p></div>');
    368                 } else if (data.message == "failure") {
    369                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong> Eniture API Key is invalid for this domain.</p></div>');
    370                 } else {
    371                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong>  ' + data.message + ' </p></div>');
    372                 }
     363                // Success / Error Message
     364                jQuery('.warning-msg').before(`<div class="notice notice-${data.error ? 'error' : 'success'} saia_${data.error ? 'error' : 'success'}_message"><p><strong>${data.error ? 'Error' : 'Success'}!</strong> ${data.message}</p></div>`);
    373365            }
    374366        });
     
    581573    // order cutoff time settings
    582574    saiaCutOffTimeAndShipDateSettings();
     575    // Notify before delivery settings
     576    saiaNotifyBeforeDeliverySettings();
    583577});
    584578
     
    11711165    }
    11721166}
     1167
     1168if (typeof saiaNotifyBeforeDeliverySettings !== 'function') {
     1169    function saiaNotifyBeforeDeliverySettings() {
     1170        jQuery("#saia_notify_before, #saia_quotes_notify_before_delivery_as_option").closest('tr').addClass("saia_residential");
     1171
     1172        jQuery('.accessorial_service_notify_before').on('load change', function () {
     1173            const id = this.id === 'saia_notify_before' ? '#saia_quotes_notify_before_delivery_as_option' : '#saia_notify_before';
     1174            jQuery(id).prop('checked', false)
     1175        });
     1176    }
     1177}
  • ltl-freight-quotes-saia-edition/tags/2.3.9/ltl-freight-quotes-saia-edition.php

    r3456816 r3480894  
    44 * Plugin URI:     https://eniture.com/products/
    55 * Description:    Dynamically retrieves your negotiated shipping rates from SAIA Freight and displays the results in the WooCommerce shopping cart.
    6  * Version:        2.3.8
     6 * Version:        2.3.9
    77 * Author:         Eniture Technology
    88 * Author URI:     http://eniture.com/
     
    183183{
    184184    wp_enqueue_script('jquery');
    185     wp_enqueue_script('en_saia_script', plugin_dir_url(__FILE__) . 'js/saia.js', array(), '1.1.5');
     185    wp_enqueue_script('en_saia_script', plugin_dir_url(__FILE__) . 'js/saia.js', array(), '1.1.6');
    186186    wp_localize_script('en_saia_script', 'en_saia_admin_script', array(
    187187        'plugins_url' => plugins_url(),
  • ltl-freight-quotes-saia-edition/tags/2.3.9/readme.txt

    r3456816 r3480894  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 2.3.8
     6Stable tag: 2.3.9
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    154154== Changelog ==
    155155
     156= 2.3.9 - 2026-03-12 =
     157* Update: Added **Notify Before Delivery** feature to allow notification prior to shipment delivery.
     158* Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.
     159
    156160= 2.3.8 - 2026-02-09 =
    157161* Update: Introduced **bulk delete functionality** for warehouse and dropship locations to simplify location management.
  • ltl-freight-quotes-saia-edition/tags/2.3.9/saia-carrier-service.php

    r3456816 r3480894  
    119119        (get_option('saia_quotes_liftgate_delivery_as_option') == 'yes') ? $accessorial[] = 'LiftgateService' : '';
    120120        (get_option('saia_residential') == 'yes') ? $accessorial[] = 'ResidentialDelivery' : '';
     121        (get_option('saia_notify_before') == 'yes' || get_option('saia_quotes_notify_before_delivery_as_option') == 'yes') ? $accessorial[] = 'ArrivalNotice/Appointment' : '';
    121122        // Residential and Liftgate Pickup
    122123        isset($packages['origin']['residential_pickup']) && $packages['origin']['residential_pickup'] ? $accessorial[] = 'ResidentialPickup' : '';
     
    126127        (get_option('saia_quotes_liftgate_delivery_as_option') == 'yes') ? $accessorials[] = 'L' : '';
    127128        (get_option('saia_residential') == 'yes') ? $accessorials[] = 'R' : '';
     129        (get_option('saia_notify_before') == 'yes' || get_option('saia_quotes_notify_before_delivery_as_option') == 'yes') ? $accessorials[] = 'N' : '';
    128130
    129131        //** Start: Shipper and Third party
     
    539541            }
    540542
     543            // Remove notify delivery fee from simple quote
     544            if (isset($this->quote_settings['notify_delivery_option']) && $this->quote_settings['notify_delivery_option'] == 'yes') {
     545                $notify_fee = isset($surcharges->notifyBeforeDeliveryFee) ? $surcharges->notifyBeforeDeliveryFee : 0;
     546                $price = $price - $notify_fee;
     547            }
     548
    541549            $meta_data = [];
    542550            $meta_data['sender_zip'] = (isset($request_data['senderZip'])) ? $request_data['senderZip'] : '';
     
    658666                    'residential' => false,
    659667                    'liftgate' => false,
    660                     'limited_access' => false
     668                    'limited_access' => false,
     669                    'notify' => false
    661670                ];
    662671                if (isset($hat_quotes['meta_data']['en_fdo_meta_data']['accessorials'])) {
     
    722731        if (isset($this->quote_settings['limited_access_delivery_option']) && $this->quote_settings['limited_access_delivery_option'] == 'yes') {
    723732            $quotes = $this->get_limited_access_delivery_as_option_quotes($quotes, $result);
     733        }
     734
     735        // notify before delivery as option
     736        if (isset($this->quote_settings['notify_delivery_option']) && $this->quote_settings['notify_delivery_option'] == 'yes') {
     737            $quotes = $this->get_notify_before_delivery_as_option_quotes($quotes, $result);
    724738        }
    725739
     
    10131027        return $shipment_days_of_week;
    10141028    }
     1029
     1030    public function get_notify_before_delivery_as_option_quotes($quotes, $result)
     1031    {
     1032        if (empty($quotes)) return $quotes;
     1033
     1034        $notify_before_quotes[] = isset($quotes['simple_quotes']) ? $quotes['simple_quotes'] : $quotes;
     1035        $simple_quotes_exist = isset($quotes['simple_quotes']) && !empty($quotes['simple_quotes']);
     1036        $accessorials = ['liftgate' => false, 'notify' => true];
     1037        $other_quotes = [];
     1038        $merge_quotes = ['simple_quotes', 'hold_at_terminal_quotes', 'simple_international_quotes', 'simple_int_and_lfg_quotes', 'limited_access_quotes', 'lfg_limited_access_quotes'];
     1039        foreach ($merge_quotes as $quote) {
     1040            if (!isset($quotes[$quote])) continue;
     1041
     1042            $other_quotes[$quote] = $quotes[$quote];
     1043            unset($quotes[$quote]);
     1044        }
     1045
     1046        foreach ($notify_before_quotes as $key => $quote) {
     1047            $quote['id'] .= '_N';
     1048            $quote['label_sufex'] = ['N'];
     1049            $notify_fee = isset($quote['surcharges']['notifyBeforeDeliveryFee']) ? $quote['surcharges']['notifyBeforeDeliveryFee'] : 0;
     1050            $quote['cost'] += floatval($notify_fee);
     1051
     1052            if ($this->quote_settings['liftgate_resid_delivery'] == "yes" && !$simple_quotes_exist) {
     1053                $lg_fee = isset($quote['surcharges']['liftgateFee']) ? $quote['surcharges']['liftgateFee'] : 0;
     1054                $quote['cost'] -= floatval($lg_fee);
     1055            }
     1056
     1057            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] = $quote['cost'];
     1058
     1059            $always_quote_lfg = isset($this->quote_settings['liftgate_delivery']) && $this->quote_settings['liftgate_delivery'] == 'yes';
     1060            $accessorials['liftgate'] = $always_quote_lfg;
     1061            foreach ($accessorials as $accessorial => $value) {
     1062                $quote['meta_data']['en_fdo_meta_data']['accessorials'][$accessorial] = $value;
     1063            }
     1064
     1065            $notify_before_quotes[$key] = $quote;
     1066        }
     1067
     1068        // merge other quotes
     1069        foreach ($other_quotes as $key => $quote) {
     1070            if (empty($quote)) continue;
     1071            $quotes[$key] = $quote;
     1072        }
     1073
     1074        if (!empty($notify_before_quotes)) {
     1075            $quotes['notify_before_quotes'] = reset($notify_before_quotes);
     1076            // get notify and liftgate quotes
     1077            $quotes = $this->get_notify_and_lfg_quotes($quotes, $result);
     1078        }
     1079
     1080        // notify and limited access quotes
     1081        if (!empty($quotes['notify_before_quotes']) && !empty($quotes['limited_access_quotes'])) {
     1082            $quotes = $this->get_notify_and_la_quotes($quotes);
     1083           
     1084            // notify, liftgate and limited access quotes
     1085            if (!empty($quotes['lfg_limited_access_quotes'])) {
     1086                $quotes = $this->get_notify_lfg_and_la_quotes($quotes);
     1087            }
     1088        }
     1089
     1090        return $quotes;
     1091    }
     1092
     1093    public function get_notify_and_lfg_quotes($quotes, $result)
     1094    {
     1095        if (isset($result->liftgateExcluded) || $this->quote_settings['liftgate_delivery_option'] != 'yes' || $this->quote_settings['notify_delivery_option'] != 'yes') {
     1096            return $quotes;
     1097        }
     1098
     1099        $notify_before_quotes[] = isset($quotes['notify_before_quotes']) ? $quotes['notify_before_quotes'] : [];
     1100        if (empty($notify_before_quotes)) return $quotes;
     1101
     1102        $lfg_notify_quotes = [];
     1103        foreach ($notify_before_quotes as $key => $quote) {
     1104            $quote['id'] .= 'LG';
     1105            $quote['label_sufex'] = ['L', 'N'];
     1106            $lg_fee = isset($quote['surcharges']['liftgateFee']) ? $quote['surcharges']['liftgateFee'] : 0;
     1107            $quote['cost'] += floatval($lg_fee);
     1108            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($lg_fee);
     1109            $quote['meta_data']['en_fdo_meta_data']['accessorials']['liftgate'] = true;
     1110
     1111            $lfg_notify_quotes[$key] = $quote;
     1112        }
     1113
     1114        !empty($lfg_notify_quotes) && $quotes['lfg_notify_quotes'] = current($lfg_notify_quotes);
     1115
     1116        return $quotes;
     1117    }
     1118
     1119    public function get_notify_and_la_quotes($quotes)
     1120    {
     1121        $notify_before_quotes[] = isset($quotes['notify_before_quotes']) ? $quotes['notify_before_quotes'] : [];
     1122        if (empty($notify_before_quotes)) return $quotes;
     1123
     1124        $notify_la_quotes = [];
     1125        $la_fee = get_option('saia_limited_access_delivery_fee');
     1126        foreach ($notify_before_quotes as $key => $quote) {
     1127            $quote['id'] .= 'LA';
     1128            $quote['label_sufex'] = ['LA', 'N'];
     1129            $quote['cost'] += floatval($la_fee);
     1130            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($la_fee);
     1131            $resi_fee = isset($quote['surcharges']['residentialFee']) ? $quote['surcharges']['residentialFee'] : 0;
     1132            $quote['cost'] -= floatval($resi_fee);
     1133            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] -= floatval($resi_fee);
     1134            $quote['meta_data']['en_fdo_meta_data']['accessorials']['limited_access'] = true;
     1135            $quote['meta_data']['en_fdo_meta_data']['accessorials']['residential'] = false;
     1136
     1137            $notify_la_quotes[$key] = $quote;
     1138        }
     1139
     1140        !empty($notify_la_quotes) && $quotes['notify_la_quotes'] = current($notify_la_quotes);
     1141
     1142        return $quotes;
     1143    }
     1144
     1145    public function get_notify_lfg_and_la_quotes($quotes)
     1146    {
     1147        $lfg_limited_access_quotes[] = isset($quotes['lfg_limited_access_quotes']) ? $quotes['lfg_limited_access_quotes'] : [];
     1148        if (empty(reset($lfg_limited_access_quotes))) return $quotes;
     1149
     1150        $notify_lfg_la_quotes = [];
     1151        foreach ($lfg_limited_access_quotes as $key => $quote) {
     1152            $quote['id'] .= 'N';
     1153            $quote['label_sufex'] = ['L', 'N', 'LA'];
     1154            $notify_fee = isset($quote['surcharges']['notifyBeforeDeliveryFee']) ? $quote['surcharges']['notifyBeforeDeliveryFee'] : 0;
     1155            $quote['cost'] += floatval($notify_fee);
     1156            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($notify_fee);
     1157            $quote['meta_data']['en_fdo_meta_data']['accessorials']['notify'] = true;
     1158
     1159            $notify_lfg_la_quotes[$key] = $quote;
     1160        }
     1161
     1162        !empty($notify_lfg_la_quotes) && $quotes['notify_lfg_la_quotes'] = current($notify_lfg_la_quotes);
     1163
     1164        return $quotes;
     1165    }
    10151166}
  • ltl-freight-quotes-saia-edition/tags/2.3.9/saia-shipping-class.php

    r3456816 r3480894  
    363363                    $this->minPrices = array();
    364364                    $override_rate = [];
     365                    // notify before delivery
     366                    $nbd_multi_cost = 0;
     367                    $nbd_label = "";
     368                    $nbd_append_label = "";
     369                    // notify and liftgate
     370                    $nbd_and_lfg_multi_cost = 0;
     371                    $nbd_and_lfg_label = "";
     372                    $nbd_and_lfg_append_label = "";
     373                    // notify and limited access delivery
     374                    $nbd_and_la_multi_cost = 0;
     375                    $nbd_and_la_label = "";
     376                    $nbd_and_la_append_label = "";
     377                    // notify, limited access and liftgate
     378                    $nbd_la_and_lfg_multi_cost = 0;
     379                    $nbd_la_and_lfg_label = "";
     380                    $nbd_la_and_lfg_append_label = "";
    365381
    366382                    $this->quote_settings['shipment'] = "multi_shipment";
     
    374390                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_LA'] = $small_quotes : "";
    375391                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_LA_LIFT'] = $small_quotes : "";
     392                    // Notify Before Delivery
     393                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD'] = $small_quotes : "";
     394                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LIFT'] = $small_quotes : "";
     395                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LA'] = $small_quotes : "";
     396                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LA_LIFT'] = $small_quotes : "";
    376397
    377398                    foreach ($quotes as $key => $quote) {
     
    425446                            $la_and_lfg_quotes = isset($quote['lfg_limited_access_quotes']) ? $quote['lfg_limited_access_quotes'] : array();
    426447                            $quote = $this->remove_array($quote, 'lfg_limited_access_quotes');
     448                            // Notify before delivery quotes
     449                            $notify_before_quotes = isset($quote['notify_before_quotes']) ? $quote['notify_before_quotes'] : array();
     450                            $quote = $this->remove_array($quote, 'notify_before_quotes');
     451                            $notify_lfg_quotes = isset($quote['lfg_notify_quotes']) ? $quote['lfg_notify_quotes'] : array();
     452                            $quote = $this->remove_array($quote, 'lfg_notify_quotes');
     453                            $notify_la_quotes = isset($quote['notify_la_quotes']) ? $quote['notify_la_quotes'] : array();
     454                            $quote = $this->remove_array($quote, 'notify_la_quotes');
     455                            $notify_lfg_la_quotes = isset($quote['notify_lfg_la_quotes']) ? $quote['notify_lfg_la_quotes'] : array();
     456                            $quote = $this->remove_array($quote, 'notify_lfg_la_quotes');
    427457
    428458                            $rates = (is_array($quote) && (!empty($quote))) ? $quote : array();
     
    591621                                $this->minPrices['SAIA_LA_LIFT'][$key]['cost'] = $this->add_handling_fee($la_and_lfg_cost, $handling_fee);
    592622                                $this->minPrices['SAIA_LA_LIFT'][$key]['meta_data']['en_fdo_meta_data']['rate']['cost'] = $this->en_fdo_meta_data['SAIA_LA_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_LA_LIFT'][$key]['cost'];
     623                            }
     624
     625                            // Offer notify before delivery quotes
     626                            if (!empty($notify_before_quotes)) {
     627                                $nbd_rates = $notify_before_quotes;
     628                                $this->minPrices['SAIA_NOTIFY_BEFORE'][$key] = $nbd_rates;
     629                                $override_rate['SAIA_NOTIFY_BEFORE'] = isset($nbd_rates['override_rate']) && $nbd_rates['override_rate'];
     630
     631                                $this->en_fdo_meta_data['SAIA_NOTIFY_BEFORE'][$key] = (isset($nbd_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_rates['meta_data']['en_fdo_meta_data'] : [];
     632
     633                                $nbd_cost = (isset($nbd_rates['cost'])) ? $nbd_rates['cost'] : 0;
     634                                $nbd_label = (isset($nbd_rates['label_sufex'])) ? $nbd_rates['label_sufex'] : array();
     635                                $nbd_append_label = (isset($nbd_rates['append_label'])) ? $nbd_rates['append_label'] : "";
     636
     637                                // product level markup
     638                                if(!empty($nbd_rates['product_level_markup'])){
     639                                    $nbd_cost = $this->add_handling_fee($nbd_cost, $nbd_rates['product_level_markup']);
     640                                }
     641
     642                                // origin level markup
     643                                if(!empty($nbd_rates['origin_markup'])){
     644                                    $nbd_cost = $this->add_handling_fee($nbd_cost, $nbd_rates['origin_markup']);
     645                                }
     646
     647                                // Add pallet fee
     648                                $nbd_cost = $this->add_pallet_fee_in_quotes($nbd_rates, $nbd_cost);
     649
     650                                $nbd_multi_cost += $this->add_handling_fee($nbd_cost, $handling_fee);
     651                                $this->minPrices['SAIA_NBD'][$key]['cost'] = $this->add_handling_fee($nbd_cost, $handling_fee);
     652                                $this->en_fdo_meta_data['SAIA_NBD'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD'][$key]['cost'];
     653                            }
     654
     655                            // Offer notify and liftgate quotes
     656                            if (!empty($notify_lfg_quotes)) {
     657                                $nbd_lfg_rates = $notify_lfg_quotes;
     658                                $this->minPrices['SAIA_NBD_LIFT'][$key] = $nbd_lfg_rates;
     659                                $override_rate['SAIA_NBD_LIFT'] = isset($nbd_lfg_rates['override_rate']) && $nbd_lfg_rates['override_rate'];
     660
     661                                $this->en_fdo_meta_data['SAIA_NBD_LIFT'][$key] = (isset($nbd_lfg_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_lfg_rates['meta_data']['en_fdo_meta_data'] : [];
     662
     663                                $nbd_lfg_cost = (isset($nbd_lfg_rates['cost'])) ? $nbd_lfg_rates['cost'] : 0;
     664                                $nbd_and_lfg_label = (isset($nbd_lfg_rates['label_sufex'])) ? $nbd_lfg_rates['label_sufex'] : array();
     665                                $nbd_and_lfg_append_label = (isset($nbd_lfg_rates['append_label'])) ? $nbd_lfg_rates['append_label'] : "";
     666
     667                                // product level markup
     668                                if(!empty($nbd_lfg_rates['product_level_markup'])){
     669                                    $nbd_lfg_cost = $this->add_handling_fee($nbd_lfg_cost, $nbd_lfg_rates['product_level_markup']);
     670                                }
     671
     672                                // origin level markup
     673                                if(!empty($nbd_lfg_rates['origin_markup'])){
     674                                    $nbd_lfg_cost = $this->add_handling_fee($nbd_lfg_cost, $nbd_lfg_rates['origin_markup']);
     675                                }
     676
     677                                // Add pallet fee
     678                                $nbd_lfg_cost = $this->add_pallet_fee_in_quotes($nbd_lfg_rates, $nbd_lfg_cost);
     679
     680                                $nbd_and_lfg_multi_cost += $this->add_handling_fee($nbd_lfg_cost, $handling_fee);
     681                                $this->minPrices['SAIA_NBD_LIFT'][$key]['cost'] = $this->add_handling_fee($nbd_lfg_cost, $handling_fee);
     682                                $this->en_fdo_meta_data['SAIA_NBD_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LIFT'][$key]['cost'];
     683                            }
     684
     685                            // Offer notify and limited access quotes
     686                            if (!empty($notify_la_quotes)) {
     687                                $nbd_la_rates = $notify_la_quotes;
     688                                $this->minPrices['SAIA_NBD_LA'][$key] = $nbd_la_rates;
     689                                $override_rate['SAIA_NBD_LA'] = isset($nbd_la_rates['override_rate']) && $nbd_la_rates['override_rate'];
     690
     691                                $this->en_fdo_meta_data['SAIA_NBD_LA'][$key] = (isset($nbd_la_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_la_rates['meta_data']['en_fdo_meta_data'] : [];
     692
     693                                $nbd_la_cost = (isset($nbd_la_rates['cost'])) ? $nbd_la_rates['cost'] : 0;
     694                                $nbd_and_la_label = (isset($nbd_la_rates['label_sufex'])) ? $nbd_la_rates['label_sufex'] : array();
     695                                $nbd_and_la_append_label = (isset($nbd_la_rates['append_label'])) ? $nbd_la_rates['append_label'] : "";
     696
     697                                // product level markup
     698                                if(!empty($nbd_la_rates['product_level_markup'])){
     699                                    $nbd_la_cost = $this->add_handling_fee($nbd_la_cost, $nbd_la_rates['product_level_markup']);
     700                                }
     701
     702                                // origin level markup
     703                                if(!empty($nbd_la_rates['origin_markup'])){
     704                                    $nbd_la_cost = $this->add_handling_fee($nbd_la_cost, $nbd_la_rates['origin_markup']);
     705                                }
     706
     707                                // Add pallet fee
     708                                $nbd_la_cost = $this->add_pallet_fee_in_quotes($nbd_la_rates, $nbd_la_cost);
     709
     710                                $nbd_and_la_multi_cost += $this->add_handling_fee($nbd_la_cost, $handling_fee);
     711                                $this->minPrices['SAIA_NBD_LA'][$key]['cost'] = $this->add_handling_fee($nbd_la_cost, $handling_fee);
     712                                $this->en_fdo_meta_data['SAIA_NBD_LA'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LA'][$key]['cost'];
     713                            }
     714
     715                            // Offer notify, lift gate and limited access quotes
     716                            if (!empty($notify_lfg_la_quotes)) {
     717                                $nbd_lfg_la_rates = $notify_lfg_la_quotes;
     718                                $this->minPrices['SAIA_NBD_LA_LIFT'][$key] = $nbd_lfg_la_rates;
     719                                $override_rate['SAIA_NBD_LA_LIFT'] = isset($nbd_lfg_la_rates['override_rate']) && $nbd_lfg_la_rates['override_rate'];
     720                               
     721                                $this->en_fdo_meta_data['SAIA_NBD_LA_LIFT'][$key] = (isset($nbd_lfg_la_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_lfg_la_rates['meta_data']['en_fdo_meta_data'] : [];
     722
     723                                $nbd_lfg_la_cost = (isset($nbd_lfg_la_rates['cost'])) ? $nbd_lfg_la_rates['cost'] : 0;
     724                                $nbd_la_and_lfg_label = (isset($nbd_lfg_la_rates['label_sufex'])) ? $nbd_lfg_la_rates['label_sufex'] : array();
     725                                $nbd_la_and_lfg_append_label = (isset($nbd_lfg_la_rates['append_label'])) ? $nbd_lfg_la_rates['append_label'] : "";
     726
     727                                // product level markup
     728                                if(!empty($nbd_lfg_la_rates['product_level_markup'])){
     729                                    $nbd_lfg_la_cost = $this->add_handling_fee($nbd_lfg_la_cost, $nbd_lfg_la_rates['product_level_markup']);
     730                                }
     731
     732                                // origin level markup
     733                                if(!empty($nbd_lfg_la_rates['origin_markup'])){
     734                                    $nbd_lfg_la_cost = $this->add_handling_fee($nbd_lfg_la_cost, $nbd_lfg_la_rates['origin_markup']);
     735                                }
     736
     737                                // Add pallet fee
     738                                $nbd_lfg_la_cost = $this->add_pallet_fee_in_quotes($nbd_lfg_la_rates, $nbd_lfg_la_cost);
     739
     740                                $nbd_la_and_lfg_multi_cost += $this->add_handling_fee($nbd_lfg_la_cost, $handling_fee);
     741                                $this->minPrices['SAIA_NBD_LA_LIFT'][$key]['cost'] = $this->add_handling_fee($nbd_lfg_la_cost, $handling_fee);
     742                                $this->en_fdo_meta_data['SAIA_NBD_LA_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LA_LIFT'][$key]['cost'];
    593743                            }
    594744
     
    629779                    // Limited access and lift gate quotes
    630780                    ($la_and_lfg_multi_cost > 0 || ($la_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_LA_LIFT']) && $override_rate['SAIA_LA_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($la_and_lfg_multi_cost, 'SAIA_LA_LIFT', $la_and_lfg_label, $la_and_lfg_append_label) : "";
     781
     782                    // Notify before delivery quotes
     783                    ($nbd_multi_cost > 0 || ($nbd_multi_cost <= 0 && isset($override_rate['SAIA_NBD']) && $override_rate['SAIA_NBD'])) ? $rate[] = $this->arrange_multiship_freight($nbd_multi_cost, 'SAIA_NBD', $nbd_label, $nbd_append_label) : "";
     784                    // Notify before delivery and lift gate quotes
     785                    ($nbd_and_lfg_multi_cost > 0 || ($nbd_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LIFT']) && $override_rate['SAIA_NBD_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($nbd_and_lfg_multi_cost, 'SAIA_NBD_LIFT', $nbd_and_lfg_label, $nbd_and_lfg_append_label) : "";
     786                    // Notify before delivery and limited access quotes
     787                    ($nbd_and_la_multi_cost > 0 || ($nbd_and_la_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LA']) && $override_rate['SAIA_NBD_LA'])) ? $rate[] = $this->arrange_multiship_freight($nbd_and_la_multi_cost, 'SAIA_NBD_LA', $nbd_and_la_label, $nbd_and_la_append_label) : "";
     788                    // Notify, limited access and lift gate quotes
     789                    ($nbd_la_and_lfg_multi_cost > 0 || ($nbd_la_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LA_LIFT']) && $override_rate['SAIA_NBD_LA_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($nbd_la_and_lfg_multi_cost, 'SAIA_NBD_LA_LIFT', $nbd_la_and_lfg_label, $nbd_la_and_lfg_append_label) : "";
    631790
    632791                    $rates = $rate;
     
    654813                        $la_and_lfg_quotes = isset($quote['lfg_limited_access_quotes']) ? $quote['lfg_limited_access_quotes'] : array();
    655814                        $rates[] = $this->remove_array($quote, 'lfg_limited_access_quotes');
    656 
    657 //                      Offer lift gate delivery as an option is enabled
     815                        $notify_quotes = isset($quote['notify_before_quotes']) ? $quote['notify_before_quotes'] : array();
     816                        $rates[] = $this->remove_array($quote, 'notify_before_quotes');
     817                        $notify_and_lfg_quotes = isset($quote['lfg_notify_quotes']) ? $quote['lfg_notify_quotes'] : array();
     818                        $rates[] = $this->remove_array($quote, 'lfg_notify_quotes');
     819                        $notify_la_quotes = isset($quote['notify_la_quotes']) ? $quote['notify_la_quotes'] : array();
     820                        $rates[] = $this->remove_array($quote, 'notify_la_quotes');
     821                        $notify_lfg_la_quotes = isset($quote['notify_lfg_la_quotes']) ? $quote['notify_lfg_la_quotes'] : array();
     822                        $rates[] = $this->remove_array($quote, 'notify_lfg_la_quotes');
     823
     824                        // Offer lift gate delivery as an option is enabled
    658825                        if (isset($this->quote_settings['liftgate_delivery_option']) &&
    659826                            ($this->quote_settings['liftgate_delivery_option'] == "yes") &&
     
    663830
    664831                        // Offer simple international quotes in case of auto-detect residential address
    665                         if (!empty($simple_international_quotes)) {
    666                             $rates[] = $simple_international_quotes;
    667                         }
    668 
     832                        if (!empty($simple_international_quotes)) $rates[] = $simple_international_quotes;
    669833                        // Offer international and liftgate quotes in case of liftgate as an option
    670                         if (!empty($int_and_lfg_quotes)) {
    671                             $rates[] = $int_and_lfg_quotes;
    672                         }
    673 
    674                         // Offer limited access as an option quotes
    675                         if (!empty($limited_access_quotes)) {
    676                             $rates[] = $limited_access_quotes;
    677                         }
    678 
    679                         // Offer limited access and liftgate as an option quotes
    680                         if (!empty($la_and_lfg_quotes)) {
    681                             $rates[] = $la_and_lfg_quotes;
    682                         }
     834                        if (!empty($int_and_lfg_quotes)) $rates[] = $int_and_lfg_quotes;
     835
     836                        // Limited access quotes
     837                        if (!empty($limited_access_quotes)) $rates[] = $limited_access_quotes;
     838                        if (!empty($la_and_lfg_quotes)) $rates[] = $la_and_lfg_quotes;
     839
     840                        // Notify before delivery quotes
     841                        if (!empty($notify_quotes)) $rates[] = $notify_quotes;
     842                        if (!empty($notify_and_lfg_quotes)) $rates[] = $notify_and_lfg_quotes;
     843                        if (!empty($notify_la_quotes)) $rates[] = $notify_la_quotes;
     844                        if (!empty($notify_lfg_la_quotes)) $rates[] = $notify_lfg_la_quotes;
    683845
    684846                        $cost_sorted_key = array();
     
    9051067                        (in_array('HAT', $label_sufex)) ? $append_label = " with hold at terminal" : "";
    9061068                        (in_array('LA', $label_sufex)) ? $append_label = " with limited access delivery" : "";
     1069                        (in_array('N', $label_sufex)) ? $append_label = " with notify before delivery" : "";
    9071070                        break;
    9081071                    case(count($label_sufex) > 1):
     
    9101073
    9111074                        if (in_array('L', $label_sufex)) {
    912                             $separator = strlen($append_label) > 0 ? (in_array('LA', $label_sufex) ? "," : " and") : " with";
    913                             $append_label .= $separator . " lift gate delivery ";
    914                         }
    915 
    916                         in_array('LA', $label_sufex) && $append_label .= ' and limited access delivery ';
     1075                            $separator = strlen($append_label) > 0 ? (in_array('LA', $label_sufex) || in_array('N', $label_sufex) ? "," : " and") : " with";
     1076                            $append_label .= $separator . " lift gate delivery";
     1077                        }
     1078
     1079                        if (in_array('LA', $label_sufex)) {
     1080                            $separator = strlen($append_label) > 0 ? (in_array('N', $label_sufex) ? ", " : " and ") : " with ";
     1081                            $append_label .= $separator . "limited access delivery";
     1082                        }
     1083
     1084                        in_array('N', $label_sufex) && $append_label .= ' and notify before delivery ';
    9171085                        break;
    9181086                }
     
    9971165                $this->web_service_inst->quote_settings['liftgate_resid_delivery'] = get_option('en_woo_addons_liftgate_with_auto_residential');
    9981166                $this->web_service_inst->quote_settings['liftgate_pickup'] = false;
     1167                $this->web_service_inst->quote_settings['notify_delivery'] = get_option('saia_notify_delivery');
     1168                $this->web_service_inst->quote_settings['notify_delivery_option'] = get_option('saia_quotes_notify_before_delivery_as_option');
    9991169                $this->web_service_inst->quote_settings['delivery_estimates'] = get_option('saia_delivery_estimates');
    10001170                $this->web_service_inst->quote_settings['HAT_status'] = get_option('saia_ltl_hold_at_terminal_checkbox_status');
  • ltl-freight-quotes-saia-edition/tags/2.3.9/saia-test-connection.php

    r3293869 r3480894  
    4747    $sResponseData = json_decode($sResponseData);
    4848
    49     if (isset($sResponseData->severity) && $sResponseData->severity == 'SUCCESS') {
    50         $sResult = array('message' => "success");
    51     } elseif (isset($sResponseData->severity) && $sResponseData->severity == 'ERROR') {
    52         $sResult = $sResponseData->message;
    53         $fullstop = (substr($sResult, -1) == '.') ? '' : '.';
    54         $sResult = array('message' => $sResult . $fullstop);
    55     } else {
    56         $sResult = array('message' => "failure");
     49    if (isset($sResponseData->severity) && $sResponseData->severity == 'SUCCESS' && isset($sResponseData->message)) {
     50        $sResult = array('error' => false, 'message' => $sResponseData->message);
     51    } elseif ((isset($sResponseData->severity) && $sResponseData->severity == 'ERROR' && isset($sResponseData->message)) || isset($sResponseData->error)) {
     52        $sResult = array('error' => true, 'message' => isset($sResponseData->error) ? $sResponseData->error : $sResponseData->message);
    5753    }
    5854
  • ltl-freight-quotes-saia-edition/tags/2.3.9/template/quote-settings.php

    r3456816 r3480894  
    269269            ),
    270270
     271            // Notify before Delivery
     272            'notify_before_delivery_options_label' => array(
     273                'name' => __('Notify Before Delivery ', 'woocommerce_saia_quote'),
     274                'type' => 'text',
     275                'class' => 'hidden',
     276                'id' => 'notify_before_delivery_options_label'
     277            ),
     278            'accessorial_notify_before_delivery_saia' => array(
     279                'name' => __('Always quote notify before delivery ', 'woocommerce_saia_quote'),
     280                'type' => 'checkbox',
     281                'desc' => __('', 'woocommerce_saia_quote'),
     282                'id' => 'saia_notify_before',
     283                'class' => 'accessorial_service_notify_before saiaCheckboxClass checkbox_fr_add',
     284            ),
     285            'saia_quotes_notify_before_delivery_as_option' => array(
     286                'name' => __('Offer notify before delivery as an option ', 'woocommerce_saia_quote'),
     287                'type' => 'checkbox',
     288                'desc' => __('', 'woocommerce_saia_quote'),
     289                'id' => 'saia_quotes_notify_before_delivery_as_option',
     290                'class' => 'accessorial_service_notify_before checkbox_fr_add saiaCheckboxClass',
     291            ),
     292
    271293            // Limited Access Delivery
    272294            'limited_access_delivery_options_label' => array(
  • ltl-freight-quotes-saia-edition/tags/2.3.9/update-plan.php

    r3293869 r3480894  
    3232            $plugin_version = $plugin_info[$index]['Version'];
    3333
    34             $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    3534            $post_data = array(
    3635                'platform' => 'wordpress',
    3736                'carrier' => '59',
    3837                'store_url' => $domain,
    39                 'webhook_url' => $plugin_dir_url,
     38                'webhook_url' => '',
    4039                'plugin_version' => $plugin_version,
    4140            );
     
    8281        $plugin_version = $plugin_info[$index]['Version'];
    8382
    84         $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    8583        $post_data = array(
    8684            'platform' => 'wordpress',
    8785            'carrier' => '59',
    8886            'store_url' => $domain,
    89             'webhook_url' => $plugin_dir_url,
     87            'webhook_url' => '',
    9088            'plugin_version' => $plugin_version,
    9189        );
  • ltl-freight-quotes-saia-edition/trunk/fdo/en-fdo.php

    r3430509 r3480894  
    3333        $accessorials['liftgate_pickup'] = isset($package['origin'], $package['origin']['liftgate_pickup']) && $package['origin']['liftgate_pickup'] ? true : false;
    3434        $accessorials['limited_access'] = get_option('saia_limited_access') == 'yes' ? true : false;
     35        $accessorials['notify'] = get_option('saia_notify_before') == 'yes' ? true : false;
    3536        $this->en_fdo_meta_data['accessorials'] = $accessorials;
    3637
  • ltl-freight-quotes-saia-edition/trunk/js/saia.js

    r3456816 r3480894  
    361361                jQuery("#message").remove();
    362362
    363                 if (data.message === "success") {
    364                     jQuery('.warning-msg').before('<div class="notice notice-success saia_success_message"><p><strong>Success!</strong> The test resulted in a successful connection.</p></div>');
    365                 } else if (data.message == "UserID and Password Incorrect.") {
    366 
    367                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong> Please verify credentials and try again.</p></div>');
    368                 } else if (data.message == "failure") {
    369                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong> Eniture API Key is invalid for this domain.</p></div>');
    370                 } else {
    371                     jQuery('.warning-msg').before('<div class="notice notice-error saia_error_message"><p><strong>Error!</strong>  ' + data.message + ' </p></div>');
    372                 }
     363                // Success / Error Message
     364                jQuery('.warning-msg').before(`<div class="notice notice-${data.error ? 'error' : 'success'} saia_${data.error ? 'error' : 'success'}_message"><p><strong>${data.error ? 'Error' : 'Success'}!</strong> ${data.message}</p></div>`);
    373365            }
    374366        });
     
    581573    // order cutoff time settings
    582574    saiaCutOffTimeAndShipDateSettings();
     575    // Notify before delivery settings
     576    saiaNotifyBeforeDeliverySettings();
    583577});
    584578
     
    11711165    }
    11721166}
     1167
     1168if (typeof saiaNotifyBeforeDeliverySettings !== 'function') {
     1169    function saiaNotifyBeforeDeliverySettings() {
     1170        jQuery("#saia_notify_before, #saia_quotes_notify_before_delivery_as_option").closest('tr').addClass("saia_residential");
     1171
     1172        jQuery('.accessorial_service_notify_before').on('load change', function () {
     1173            const id = this.id === 'saia_notify_before' ? '#saia_quotes_notify_before_delivery_as_option' : '#saia_notify_before';
     1174            jQuery(id).prop('checked', false)
     1175        });
     1176    }
     1177}
  • ltl-freight-quotes-saia-edition/trunk/ltl-freight-quotes-saia-edition.php

    r3456816 r3480894  
    44 * Plugin URI:     https://eniture.com/products/
    55 * Description:    Dynamically retrieves your negotiated shipping rates from SAIA Freight and displays the results in the WooCommerce shopping cart.
    6  * Version:        2.3.8
     6 * Version:        2.3.9
    77 * Author:         Eniture Technology
    88 * Author URI:     http://eniture.com/
     
    183183{
    184184    wp_enqueue_script('jquery');
    185     wp_enqueue_script('en_saia_script', plugin_dir_url(__FILE__) . 'js/saia.js', array(), '1.1.5');
     185    wp_enqueue_script('en_saia_script', plugin_dir_url(__FILE__) . 'js/saia.js', array(), '1.1.6');
    186186    wp_localize_script('en_saia_script', 'en_saia_admin_script', array(
    187187        'plugins_url' => plugins_url(),
  • ltl-freight-quotes-saia-edition/trunk/readme.txt

    r3456816 r3480894  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 2.3.8
     6Stable tag: 2.3.9
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    154154== Changelog ==
    155155
     156= 2.3.9 - 2026-03-12 =
     157* Update: Added **Notify Before Delivery** feature to allow notification prior to shipment delivery.
     158* Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.
     159
    156160= 2.3.8 - 2026-02-09 =
    157161* Update: Introduced **bulk delete functionality** for warehouse and dropship locations to simplify location management.
  • ltl-freight-quotes-saia-edition/trunk/saia-carrier-service.php

    r3456816 r3480894  
    119119        (get_option('saia_quotes_liftgate_delivery_as_option') == 'yes') ? $accessorial[] = 'LiftgateService' : '';
    120120        (get_option('saia_residential') == 'yes') ? $accessorial[] = 'ResidentialDelivery' : '';
     121        (get_option('saia_notify_before') == 'yes' || get_option('saia_quotes_notify_before_delivery_as_option') == 'yes') ? $accessorial[] = 'ArrivalNotice/Appointment' : '';
    121122        // Residential and Liftgate Pickup
    122123        isset($packages['origin']['residential_pickup']) && $packages['origin']['residential_pickup'] ? $accessorial[] = 'ResidentialPickup' : '';
     
    126127        (get_option('saia_quotes_liftgate_delivery_as_option') == 'yes') ? $accessorials[] = 'L' : '';
    127128        (get_option('saia_residential') == 'yes') ? $accessorials[] = 'R' : '';
     129        (get_option('saia_notify_before') == 'yes' || get_option('saia_quotes_notify_before_delivery_as_option') == 'yes') ? $accessorials[] = 'N' : '';
    128130
    129131        //** Start: Shipper and Third party
     
    539541            }
    540542
     543            // Remove notify delivery fee from simple quote
     544            if (isset($this->quote_settings['notify_delivery_option']) && $this->quote_settings['notify_delivery_option'] == 'yes') {
     545                $notify_fee = isset($surcharges->notifyBeforeDeliveryFee) ? $surcharges->notifyBeforeDeliveryFee : 0;
     546                $price = $price - $notify_fee;
     547            }
     548
    541549            $meta_data = [];
    542550            $meta_data['sender_zip'] = (isset($request_data['senderZip'])) ? $request_data['senderZip'] : '';
     
    658666                    'residential' => false,
    659667                    'liftgate' => false,
    660                     'limited_access' => false
     668                    'limited_access' => false,
     669                    'notify' => false
    661670                ];
    662671                if (isset($hat_quotes['meta_data']['en_fdo_meta_data']['accessorials'])) {
     
    722731        if (isset($this->quote_settings['limited_access_delivery_option']) && $this->quote_settings['limited_access_delivery_option'] == 'yes') {
    723732            $quotes = $this->get_limited_access_delivery_as_option_quotes($quotes, $result);
     733        }
     734
     735        // notify before delivery as option
     736        if (isset($this->quote_settings['notify_delivery_option']) && $this->quote_settings['notify_delivery_option'] == 'yes') {
     737            $quotes = $this->get_notify_before_delivery_as_option_quotes($quotes, $result);
    724738        }
    725739
     
    10131027        return $shipment_days_of_week;
    10141028    }
     1029
     1030    public function get_notify_before_delivery_as_option_quotes($quotes, $result)
     1031    {
     1032        if (empty($quotes)) return $quotes;
     1033
     1034        $notify_before_quotes[] = isset($quotes['simple_quotes']) ? $quotes['simple_quotes'] : $quotes;
     1035        $simple_quotes_exist = isset($quotes['simple_quotes']) && !empty($quotes['simple_quotes']);
     1036        $accessorials = ['liftgate' => false, 'notify' => true];
     1037        $other_quotes = [];
     1038        $merge_quotes = ['simple_quotes', 'hold_at_terminal_quotes', 'simple_international_quotes', 'simple_int_and_lfg_quotes', 'limited_access_quotes', 'lfg_limited_access_quotes'];
     1039        foreach ($merge_quotes as $quote) {
     1040            if (!isset($quotes[$quote])) continue;
     1041
     1042            $other_quotes[$quote] = $quotes[$quote];
     1043            unset($quotes[$quote]);
     1044        }
     1045
     1046        foreach ($notify_before_quotes as $key => $quote) {
     1047            $quote['id'] .= '_N';
     1048            $quote['label_sufex'] = ['N'];
     1049            $notify_fee = isset($quote['surcharges']['notifyBeforeDeliveryFee']) ? $quote['surcharges']['notifyBeforeDeliveryFee'] : 0;
     1050            $quote['cost'] += floatval($notify_fee);
     1051
     1052            if ($this->quote_settings['liftgate_resid_delivery'] == "yes" && !$simple_quotes_exist) {
     1053                $lg_fee = isset($quote['surcharges']['liftgateFee']) ? $quote['surcharges']['liftgateFee'] : 0;
     1054                $quote['cost'] -= floatval($lg_fee);
     1055            }
     1056
     1057            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] = $quote['cost'];
     1058
     1059            $always_quote_lfg = isset($this->quote_settings['liftgate_delivery']) && $this->quote_settings['liftgate_delivery'] == 'yes';
     1060            $accessorials['liftgate'] = $always_quote_lfg;
     1061            foreach ($accessorials as $accessorial => $value) {
     1062                $quote['meta_data']['en_fdo_meta_data']['accessorials'][$accessorial] = $value;
     1063            }
     1064
     1065            $notify_before_quotes[$key] = $quote;
     1066        }
     1067
     1068        // merge other quotes
     1069        foreach ($other_quotes as $key => $quote) {
     1070            if (empty($quote)) continue;
     1071            $quotes[$key] = $quote;
     1072        }
     1073
     1074        if (!empty($notify_before_quotes)) {
     1075            $quotes['notify_before_quotes'] = reset($notify_before_quotes);
     1076            // get notify and liftgate quotes
     1077            $quotes = $this->get_notify_and_lfg_quotes($quotes, $result);
     1078        }
     1079
     1080        // notify and limited access quotes
     1081        if (!empty($quotes['notify_before_quotes']) && !empty($quotes['limited_access_quotes'])) {
     1082            $quotes = $this->get_notify_and_la_quotes($quotes);
     1083           
     1084            // notify, liftgate and limited access quotes
     1085            if (!empty($quotes['lfg_limited_access_quotes'])) {
     1086                $quotes = $this->get_notify_lfg_and_la_quotes($quotes);
     1087            }
     1088        }
     1089
     1090        return $quotes;
     1091    }
     1092
     1093    public function get_notify_and_lfg_quotes($quotes, $result)
     1094    {
     1095        if (isset($result->liftgateExcluded) || $this->quote_settings['liftgate_delivery_option'] != 'yes' || $this->quote_settings['notify_delivery_option'] != 'yes') {
     1096            return $quotes;
     1097        }
     1098
     1099        $notify_before_quotes[] = isset($quotes['notify_before_quotes']) ? $quotes['notify_before_quotes'] : [];
     1100        if (empty($notify_before_quotes)) return $quotes;
     1101
     1102        $lfg_notify_quotes = [];
     1103        foreach ($notify_before_quotes as $key => $quote) {
     1104            $quote['id'] .= 'LG';
     1105            $quote['label_sufex'] = ['L', 'N'];
     1106            $lg_fee = isset($quote['surcharges']['liftgateFee']) ? $quote['surcharges']['liftgateFee'] : 0;
     1107            $quote['cost'] += floatval($lg_fee);
     1108            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($lg_fee);
     1109            $quote['meta_data']['en_fdo_meta_data']['accessorials']['liftgate'] = true;
     1110
     1111            $lfg_notify_quotes[$key] = $quote;
     1112        }
     1113
     1114        !empty($lfg_notify_quotes) && $quotes['lfg_notify_quotes'] = current($lfg_notify_quotes);
     1115
     1116        return $quotes;
     1117    }
     1118
     1119    public function get_notify_and_la_quotes($quotes)
     1120    {
     1121        $notify_before_quotes[] = isset($quotes['notify_before_quotes']) ? $quotes['notify_before_quotes'] : [];
     1122        if (empty($notify_before_quotes)) return $quotes;
     1123
     1124        $notify_la_quotes = [];
     1125        $la_fee = get_option('saia_limited_access_delivery_fee');
     1126        foreach ($notify_before_quotes as $key => $quote) {
     1127            $quote['id'] .= 'LA';
     1128            $quote['label_sufex'] = ['LA', 'N'];
     1129            $quote['cost'] += floatval($la_fee);
     1130            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($la_fee);
     1131            $resi_fee = isset($quote['surcharges']['residentialFee']) ? $quote['surcharges']['residentialFee'] : 0;
     1132            $quote['cost'] -= floatval($resi_fee);
     1133            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] -= floatval($resi_fee);
     1134            $quote['meta_data']['en_fdo_meta_data']['accessorials']['limited_access'] = true;
     1135            $quote['meta_data']['en_fdo_meta_data']['accessorials']['residential'] = false;
     1136
     1137            $notify_la_quotes[$key] = $quote;
     1138        }
     1139
     1140        !empty($notify_la_quotes) && $quotes['notify_la_quotes'] = current($notify_la_quotes);
     1141
     1142        return $quotes;
     1143    }
     1144
     1145    public function get_notify_lfg_and_la_quotes($quotes)
     1146    {
     1147        $lfg_limited_access_quotes[] = isset($quotes['lfg_limited_access_quotes']) ? $quotes['lfg_limited_access_quotes'] : [];
     1148        if (empty(reset($lfg_limited_access_quotes))) return $quotes;
     1149
     1150        $notify_lfg_la_quotes = [];
     1151        foreach ($lfg_limited_access_quotes as $key => $quote) {
     1152            $quote['id'] .= 'N';
     1153            $quote['label_sufex'] = ['L', 'N', 'LA'];
     1154            $notify_fee = isset($quote['surcharges']['notifyBeforeDeliveryFee']) ? $quote['surcharges']['notifyBeforeDeliveryFee'] : 0;
     1155            $quote['cost'] += floatval($notify_fee);
     1156            $quote['meta_data']['en_fdo_meta_data']['rate']['cost'] += floatval($notify_fee);
     1157            $quote['meta_data']['en_fdo_meta_data']['accessorials']['notify'] = true;
     1158
     1159            $notify_lfg_la_quotes[$key] = $quote;
     1160        }
     1161
     1162        !empty($notify_lfg_la_quotes) && $quotes['notify_lfg_la_quotes'] = current($notify_lfg_la_quotes);
     1163
     1164        return $quotes;
     1165    }
    10151166}
  • ltl-freight-quotes-saia-edition/trunk/saia-shipping-class.php

    r3456816 r3480894  
    363363                    $this->minPrices = array();
    364364                    $override_rate = [];
     365                    // notify before delivery
     366                    $nbd_multi_cost = 0;
     367                    $nbd_label = "";
     368                    $nbd_append_label = "";
     369                    // notify and liftgate
     370                    $nbd_and_lfg_multi_cost = 0;
     371                    $nbd_and_lfg_label = "";
     372                    $nbd_and_lfg_append_label = "";
     373                    // notify and limited access delivery
     374                    $nbd_and_la_multi_cost = 0;
     375                    $nbd_and_la_label = "";
     376                    $nbd_and_la_append_label = "";
     377                    // notify, limited access and liftgate
     378                    $nbd_la_and_lfg_multi_cost = 0;
     379                    $nbd_la_and_lfg_label = "";
     380                    $nbd_la_and_lfg_append_label = "";
    365381
    366382                    $this->quote_settings['shipment'] = "multi_shipment";
     
    374390                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_LA'] = $small_quotes : "";
    375391                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_LA_LIFT'] = $small_quotes : "";
     392                    // Notify Before Delivery
     393                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD'] = $small_quotes : "";
     394                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LIFT'] = $small_quotes : "";
     395                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LA'] = $small_quotes : "";
     396                    (isset($small_quotes) && count($small_quotes) > 0) ? $this->minPrices['SAIA_NBD_LA_LIFT'] = $small_quotes : "";
    376397
    377398                    foreach ($quotes as $key => $quote) {
     
    425446                            $la_and_lfg_quotes = isset($quote['lfg_limited_access_quotes']) ? $quote['lfg_limited_access_quotes'] : array();
    426447                            $quote = $this->remove_array($quote, 'lfg_limited_access_quotes');
     448                            // Notify before delivery quotes
     449                            $notify_before_quotes = isset($quote['notify_before_quotes']) ? $quote['notify_before_quotes'] : array();
     450                            $quote = $this->remove_array($quote, 'notify_before_quotes');
     451                            $notify_lfg_quotes = isset($quote['lfg_notify_quotes']) ? $quote['lfg_notify_quotes'] : array();
     452                            $quote = $this->remove_array($quote, 'lfg_notify_quotes');
     453                            $notify_la_quotes = isset($quote['notify_la_quotes']) ? $quote['notify_la_quotes'] : array();
     454                            $quote = $this->remove_array($quote, 'notify_la_quotes');
     455                            $notify_lfg_la_quotes = isset($quote['notify_lfg_la_quotes']) ? $quote['notify_lfg_la_quotes'] : array();
     456                            $quote = $this->remove_array($quote, 'notify_lfg_la_quotes');
    427457
    428458                            $rates = (is_array($quote) && (!empty($quote))) ? $quote : array();
     
    591621                                $this->minPrices['SAIA_LA_LIFT'][$key]['cost'] = $this->add_handling_fee($la_and_lfg_cost, $handling_fee);
    592622                                $this->minPrices['SAIA_LA_LIFT'][$key]['meta_data']['en_fdo_meta_data']['rate']['cost'] = $this->en_fdo_meta_data['SAIA_LA_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_LA_LIFT'][$key]['cost'];
     623                            }
     624
     625                            // Offer notify before delivery quotes
     626                            if (!empty($notify_before_quotes)) {
     627                                $nbd_rates = $notify_before_quotes;
     628                                $this->minPrices['SAIA_NOTIFY_BEFORE'][$key] = $nbd_rates;
     629                                $override_rate['SAIA_NOTIFY_BEFORE'] = isset($nbd_rates['override_rate']) && $nbd_rates['override_rate'];
     630
     631                                $this->en_fdo_meta_data['SAIA_NOTIFY_BEFORE'][$key] = (isset($nbd_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_rates['meta_data']['en_fdo_meta_data'] : [];
     632
     633                                $nbd_cost = (isset($nbd_rates['cost'])) ? $nbd_rates['cost'] : 0;
     634                                $nbd_label = (isset($nbd_rates['label_sufex'])) ? $nbd_rates['label_sufex'] : array();
     635                                $nbd_append_label = (isset($nbd_rates['append_label'])) ? $nbd_rates['append_label'] : "";
     636
     637                                // product level markup
     638                                if(!empty($nbd_rates['product_level_markup'])){
     639                                    $nbd_cost = $this->add_handling_fee($nbd_cost, $nbd_rates['product_level_markup']);
     640                                }
     641
     642                                // origin level markup
     643                                if(!empty($nbd_rates['origin_markup'])){
     644                                    $nbd_cost = $this->add_handling_fee($nbd_cost, $nbd_rates['origin_markup']);
     645                                }
     646
     647                                // Add pallet fee
     648                                $nbd_cost = $this->add_pallet_fee_in_quotes($nbd_rates, $nbd_cost);
     649
     650                                $nbd_multi_cost += $this->add_handling_fee($nbd_cost, $handling_fee);
     651                                $this->minPrices['SAIA_NBD'][$key]['cost'] = $this->add_handling_fee($nbd_cost, $handling_fee);
     652                                $this->en_fdo_meta_data['SAIA_NBD'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD'][$key]['cost'];
     653                            }
     654
     655                            // Offer notify and liftgate quotes
     656                            if (!empty($notify_lfg_quotes)) {
     657                                $nbd_lfg_rates = $notify_lfg_quotes;
     658                                $this->minPrices['SAIA_NBD_LIFT'][$key] = $nbd_lfg_rates;
     659                                $override_rate['SAIA_NBD_LIFT'] = isset($nbd_lfg_rates['override_rate']) && $nbd_lfg_rates['override_rate'];
     660
     661                                $this->en_fdo_meta_data['SAIA_NBD_LIFT'][$key] = (isset($nbd_lfg_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_lfg_rates['meta_data']['en_fdo_meta_data'] : [];
     662
     663                                $nbd_lfg_cost = (isset($nbd_lfg_rates['cost'])) ? $nbd_lfg_rates['cost'] : 0;
     664                                $nbd_and_lfg_label = (isset($nbd_lfg_rates['label_sufex'])) ? $nbd_lfg_rates['label_sufex'] : array();
     665                                $nbd_and_lfg_append_label = (isset($nbd_lfg_rates['append_label'])) ? $nbd_lfg_rates['append_label'] : "";
     666
     667                                // product level markup
     668                                if(!empty($nbd_lfg_rates['product_level_markup'])){
     669                                    $nbd_lfg_cost = $this->add_handling_fee($nbd_lfg_cost, $nbd_lfg_rates['product_level_markup']);
     670                                }
     671
     672                                // origin level markup
     673                                if(!empty($nbd_lfg_rates['origin_markup'])){
     674                                    $nbd_lfg_cost = $this->add_handling_fee($nbd_lfg_cost, $nbd_lfg_rates['origin_markup']);
     675                                }
     676
     677                                // Add pallet fee
     678                                $nbd_lfg_cost = $this->add_pallet_fee_in_quotes($nbd_lfg_rates, $nbd_lfg_cost);
     679
     680                                $nbd_and_lfg_multi_cost += $this->add_handling_fee($nbd_lfg_cost, $handling_fee);
     681                                $this->minPrices['SAIA_NBD_LIFT'][$key]['cost'] = $this->add_handling_fee($nbd_lfg_cost, $handling_fee);
     682                                $this->en_fdo_meta_data['SAIA_NBD_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LIFT'][$key]['cost'];
     683                            }
     684
     685                            // Offer notify and limited access quotes
     686                            if (!empty($notify_la_quotes)) {
     687                                $nbd_la_rates = $notify_la_quotes;
     688                                $this->minPrices['SAIA_NBD_LA'][$key] = $nbd_la_rates;
     689                                $override_rate['SAIA_NBD_LA'] = isset($nbd_la_rates['override_rate']) && $nbd_la_rates['override_rate'];
     690
     691                                $this->en_fdo_meta_data['SAIA_NBD_LA'][$key] = (isset($nbd_la_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_la_rates['meta_data']['en_fdo_meta_data'] : [];
     692
     693                                $nbd_la_cost = (isset($nbd_la_rates['cost'])) ? $nbd_la_rates['cost'] : 0;
     694                                $nbd_and_la_label = (isset($nbd_la_rates['label_sufex'])) ? $nbd_la_rates['label_sufex'] : array();
     695                                $nbd_and_la_append_label = (isset($nbd_la_rates['append_label'])) ? $nbd_la_rates['append_label'] : "";
     696
     697                                // product level markup
     698                                if(!empty($nbd_la_rates['product_level_markup'])){
     699                                    $nbd_la_cost = $this->add_handling_fee($nbd_la_cost, $nbd_la_rates['product_level_markup']);
     700                                }
     701
     702                                // origin level markup
     703                                if(!empty($nbd_la_rates['origin_markup'])){
     704                                    $nbd_la_cost = $this->add_handling_fee($nbd_la_cost, $nbd_la_rates['origin_markup']);
     705                                }
     706
     707                                // Add pallet fee
     708                                $nbd_la_cost = $this->add_pallet_fee_in_quotes($nbd_la_rates, $nbd_la_cost);
     709
     710                                $nbd_and_la_multi_cost += $this->add_handling_fee($nbd_la_cost, $handling_fee);
     711                                $this->minPrices['SAIA_NBD_LA'][$key]['cost'] = $this->add_handling_fee($nbd_la_cost, $handling_fee);
     712                                $this->en_fdo_meta_data['SAIA_NBD_LA'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LA'][$key]['cost'];
     713                            }
     714
     715                            // Offer notify, lift gate and limited access quotes
     716                            if (!empty($notify_lfg_la_quotes)) {
     717                                $nbd_lfg_la_rates = $notify_lfg_la_quotes;
     718                                $this->minPrices['SAIA_NBD_LA_LIFT'][$key] = $nbd_lfg_la_rates;
     719                                $override_rate['SAIA_NBD_LA_LIFT'] = isset($nbd_lfg_la_rates['override_rate']) && $nbd_lfg_la_rates['override_rate'];
     720                               
     721                                $this->en_fdo_meta_data['SAIA_NBD_LA_LIFT'][$key] = (isset($nbd_lfg_la_rates['meta_data']['en_fdo_meta_data'])) ? $nbd_lfg_la_rates['meta_data']['en_fdo_meta_data'] : [];
     722
     723                                $nbd_lfg_la_cost = (isset($nbd_lfg_la_rates['cost'])) ? $nbd_lfg_la_rates['cost'] : 0;
     724                                $nbd_la_and_lfg_label = (isset($nbd_lfg_la_rates['label_sufex'])) ? $nbd_lfg_la_rates['label_sufex'] : array();
     725                                $nbd_la_and_lfg_append_label = (isset($nbd_lfg_la_rates['append_label'])) ? $nbd_lfg_la_rates['append_label'] : "";
     726
     727                                // product level markup
     728                                if(!empty($nbd_lfg_la_rates['product_level_markup'])){
     729                                    $nbd_lfg_la_cost = $this->add_handling_fee($nbd_lfg_la_cost, $nbd_lfg_la_rates['product_level_markup']);
     730                                }
     731
     732                                // origin level markup
     733                                if(!empty($nbd_lfg_la_rates['origin_markup'])){
     734                                    $nbd_lfg_la_cost = $this->add_handling_fee($nbd_lfg_la_cost, $nbd_lfg_la_rates['origin_markup']);
     735                                }
     736
     737                                // Add pallet fee
     738                                $nbd_lfg_la_cost = $this->add_pallet_fee_in_quotes($nbd_lfg_la_rates, $nbd_lfg_la_cost);
     739
     740                                $nbd_la_and_lfg_multi_cost += $this->add_handling_fee($nbd_lfg_la_cost, $handling_fee);
     741                                $this->minPrices['SAIA_NBD_LA_LIFT'][$key]['cost'] = $this->add_handling_fee($nbd_lfg_la_cost, $handling_fee);
     742                                $this->en_fdo_meta_data['SAIA_NBD_LA_LIFT'][$key]['rate']['cost'] = $this->minPrices['SAIA_NBD_LA_LIFT'][$key]['cost'];
    593743                            }
    594744
     
    629779                    // Limited access and lift gate quotes
    630780                    ($la_and_lfg_multi_cost > 0 || ($la_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_LA_LIFT']) && $override_rate['SAIA_LA_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($la_and_lfg_multi_cost, 'SAIA_LA_LIFT', $la_and_lfg_label, $la_and_lfg_append_label) : "";
     781
     782                    // Notify before delivery quotes
     783                    ($nbd_multi_cost > 0 || ($nbd_multi_cost <= 0 && isset($override_rate['SAIA_NBD']) && $override_rate['SAIA_NBD'])) ? $rate[] = $this->arrange_multiship_freight($nbd_multi_cost, 'SAIA_NBD', $nbd_label, $nbd_append_label) : "";
     784                    // Notify before delivery and lift gate quotes
     785                    ($nbd_and_lfg_multi_cost > 0 || ($nbd_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LIFT']) && $override_rate['SAIA_NBD_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($nbd_and_lfg_multi_cost, 'SAIA_NBD_LIFT', $nbd_and_lfg_label, $nbd_and_lfg_append_label) : "";
     786                    // Notify before delivery and limited access quotes
     787                    ($nbd_and_la_multi_cost > 0 || ($nbd_and_la_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LA']) && $override_rate['SAIA_NBD_LA'])) ? $rate[] = $this->arrange_multiship_freight($nbd_and_la_multi_cost, 'SAIA_NBD_LA', $nbd_and_la_label, $nbd_and_la_append_label) : "";
     788                    // Notify, limited access and lift gate quotes
     789                    ($nbd_la_and_lfg_multi_cost > 0 || ($nbd_la_and_lfg_multi_cost <= 0 && isset($override_rate['SAIA_NBD_LA_LIFT']) && $override_rate['SAIA_NBD_LA_LIFT'])) ? $rate[] = $this->arrange_multiship_freight($nbd_la_and_lfg_multi_cost, 'SAIA_NBD_LA_LIFT', $nbd_la_and_lfg_label, $nbd_la_and_lfg_append_label) : "";
    631790
    632791                    $rates = $rate;
     
    654813                        $la_and_lfg_quotes = isset($quote['lfg_limited_access_quotes']) ? $quote['lfg_limited_access_quotes'] : array();
    655814                        $rates[] = $this->remove_array($quote, 'lfg_limited_access_quotes');
    656 
    657 //                      Offer lift gate delivery as an option is enabled
     815                        $notify_quotes = isset($quote['notify_before_quotes']) ? $quote['notify_before_quotes'] : array();
     816                        $rates[] = $this->remove_array($quote, 'notify_before_quotes');
     817                        $notify_and_lfg_quotes = isset($quote['lfg_notify_quotes']) ? $quote['lfg_notify_quotes'] : array();
     818                        $rates[] = $this->remove_array($quote, 'lfg_notify_quotes');
     819                        $notify_la_quotes = isset($quote['notify_la_quotes']) ? $quote['notify_la_quotes'] : array();
     820                        $rates[] = $this->remove_array($quote, 'notify_la_quotes');
     821                        $notify_lfg_la_quotes = isset($quote['notify_lfg_la_quotes']) ? $quote['notify_lfg_la_quotes'] : array();
     822                        $rates[] = $this->remove_array($quote, 'notify_lfg_la_quotes');
     823
     824                        // Offer lift gate delivery as an option is enabled
    658825                        if (isset($this->quote_settings['liftgate_delivery_option']) &&
    659826                            ($this->quote_settings['liftgate_delivery_option'] == "yes") &&
     
    663830
    664831                        // Offer simple international quotes in case of auto-detect residential address
    665                         if (!empty($simple_international_quotes)) {
    666                             $rates[] = $simple_international_quotes;
    667                         }
    668 
     832                        if (!empty($simple_international_quotes)) $rates[] = $simple_international_quotes;
    669833                        // Offer international and liftgate quotes in case of liftgate as an option
    670                         if (!empty($int_and_lfg_quotes)) {
    671                             $rates[] = $int_and_lfg_quotes;
    672                         }
    673 
    674                         // Offer limited access as an option quotes
    675                         if (!empty($limited_access_quotes)) {
    676                             $rates[] = $limited_access_quotes;
    677                         }
    678 
    679                         // Offer limited access and liftgate as an option quotes
    680                         if (!empty($la_and_lfg_quotes)) {
    681                             $rates[] = $la_and_lfg_quotes;
    682                         }
     834                        if (!empty($int_and_lfg_quotes)) $rates[] = $int_and_lfg_quotes;
     835
     836                        // Limited access quotes
     837                        if (!empty($limited_access_quotes)) $rates[] = $limited_access_quotes;
     838                        if (!empty($la_and_lfg_quotes)) $rates[] = $la_and_lfg_quotes;
     839
     840                        // Notify before delivery quotes
     841                        if (!empty($notify_quotes)) $rates[] = $notify_quotes;
     842                        if (!empty($notify_and_lfg_quotes)) $rates[] = $notify_and_lfg_quotes;
     843                        if (!empty($notify_la_quotes)) $rates[] = $notify_la_quotes;
     844                        if (!empty($notify_lfg_la_quotes)) $rates[] = $notify_lfg_la_quotes;
    683845
    684846                        $cost_sorted_key = array();
     
    9051067                        (in_array('HAT', $label_sufex)) ? $append_label = " with hold at terminal" : "";
    9061068                        (in_array('LA', $label_sufex)) ? $append_label = " with limited access delivery" : "";
     1069                        (in_array('N', $label_sufex)) ? $append_label = " with notify before delivery" : "";
    9071070                        break;
    9081071                    case(count($label_sufex) > 1):
     
    9101073
    9111074                        if (in_array('L', $label_sufex)) {
    912                             $separator = strlen($append_label) > 0 ? (in_array('LA', $label_sufex) ? "," : " and") : " with";
    913                             $append_label .= $separator . " lift gate delivery ";
    914                         }
    915 
    916                         in_array('LA', $label_sufex) && $append_label .= ' and limited access delivery ';
     1075                            $separator = strlen($append_label) > 0 ? (in_array('LA', $label_sufex) || in_array('N', $label_sufex) ? "," : " and") : " with";
     1076                            $append_label .= $separator . " lift gate delivery";
     1077                        }
     1078
     1079                        if (in_array('LA', $label_sufex)) {
     1080                            $separator = strlen($append_label) > 0 ? (in_array('N', $label_sufex) ? ", " : " and ") : " with ";
     1081                            $append_label .= $separator . "limited access delivery";
     1082                        }
     1083
     1084                        in_array('N', $label_sufex) && $append_label .= ' and notify before delivery ';
    9171085                        break;
    9181086                }
     
    9971165                $this->web_service_inst->quote_settings['liftgate_resid_delivery'] = get_option('en_woo_addons_liftgate_with_auto_residential');
    9981166                $this->web_service_inst->quote_settings['liftgate_pickup'] = false;
     1167                $this->web_service_inst->quote_settings['notify_delivery'] = get_option('saia_notify_delivery');
     1168                $this->web_service_inst->quote_settings['notify_delivery_option'] = get_option('saia_quotes_notify_before_delivery_as_option');
    9991169                $this->web_service_inst->quote_settings['delivery_estimates'] = get_option('saia_delivery_estimates');
    10001170                $this->web_service_inst->quote_settings['HAT_status'] = get_option('saia_ltl_hold_at_terminal_checkbox_status');
  • ltl-freight-quotes-saia-edition/trunk/saia-test-connection.php

    r3293869 r3480894  
    4747    $sResponseData = json_decode($sResponseData);
    4848
    49     if (isset($sResponseData->severity) && $sResponseData->severity == 'SUCCESS') {
    50         $sResult = array('message' => "success");
    51     } elseif (isset($sResponseData->severity) && $sResponseData->severity == 'ERROR') {
    52         $sResult = $sResponseData->message;
    53         $fullstop = (substr($sResult, -1) == '.') ? '' : '.';
    54         $sResult = array('message' => $sResult . $fullstop);
    55     } else {
    56         $sResult = array('message' => "failure");
     49    if (isset($sResponseData->severity) && $sResponseData->severity == 'SUCCESS' && isset($sResponseData->message)) {
     50        $sResult = array('error' => false, 'message' => $sResponseData->message);
     51    } elseif ((isset($sResponseData->severity) && $sResponseData->severity == 'ERROR' && isset($sResponseData->message)) || isset($sResponseData->error)) {
     52        $sResult = array('error' => true, 'message' => isset($sResponseData->error) ? $sResponseData->error : $sResponseData->message);
    5753    }
    5854
  • ltl-freight-quotes-saia-edition/trunk/template/quote-settings.php

    r3456816 r3480894  
    269269            ),
    270270
     271            // Notify before Delivery
     272            'notify_before_delivery_options_label' => array(
     273                'name' => __('Notify Before Delivery ', 'woocommerce_saia_quote'),
     274                'type' => 'text',
     275                'class' => 'hidden',
     276                'id' => 'notify_before_delivery_options_label'
     277            ),
     278            'accessorial_notify_before_delivery_saia' => array(
     279                'name' => __('Always quote notify before delivery ', 'woocommerce_saia_quote'),
     280                'type' => 'checkbox',
     281                'desc' => __('', 'woocommerce_saia_quote'),
     282                'id' => 'saia_notify_before',
     283                'class' => 'accessorial_service_notify_before saiaCheckboxClass checkbox_fr_add',
     284            ),
     285            'saia_quotes_notify_before_delivery_as_option' => array(
     286                'name' => __('Offer notify before delivery as an option ', 'woocommerce_saia_quote'),
     287                'type' => 'checkbox',
     288                'desc' => __('', 'woocommerce_saia_quote'),
     289                'id' => 'saia_quotes_notify_before_delivery_as_option',
     290                'class' => 'accessorial_service_notify_before checkbox_fr_add saiaCheckboxClass',
     291            ),
     292
    271293            // Limited Access Delivery
    272294            'limited_access_delivery_options_label' => array(
  • ltl-freight-quotes-saia-edition/trunk/update-plan.php

    r3293869 r3480894  
    3232            $plugin_version = $plugin_info[$index]['Version'];
    3333
    34             $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    3534            $post_data = array(
    3635                'platform' => 'wordpress',
    3736                'carrier' => '59',
    3837                'store_url' => $domain,
    39                 'webhook_url' => $plugin_dir_url,
     38                'webhook_url' => '',
    4039                'plugin_version' => $plugin_version,
    4140            );
     
    8281        $plugin_version = $plugin_info[$index]['Version'];
    8382
    84         $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    8583        $post_data = array(
    8684            'platform' => 'wordpress',
    8785            'carrier' => '59',
    8886            'store_url' => $domain,
    89             'webhook_url' => $plugin_dir_url,
     87            'webhook_url' => '',
    9088            'plugin_version' => $plugin_version,
    9189        );
Note: See TracChangeset for help on using the changeset viewer.