Index: /small-package-quotes-ups-edition/tags/4.5.17/css/ups-small-style.css
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/css/ups-small-style.css	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/css/ups-small-style.css	(revision 3237693)
@@ -0,0 +1,651 @@
+/*
+ @ Connection Setting Section Start
+*/
+#wpfooter {
+    position: static;
+    margin-left: 0px !important;
+}
+
+#footer-left {
+    margin-left: 160px !important
+}
+
+.restrict_days_transit_package_ups_small th {
+    padding: 10px 10px 0px 15px !important;
+    font-weight: 400 !important;
+}
+
+
+.restrict_days_transit_package_ups_small td,
+.wc_settings_wwe_allow_other_plugins td {
+    padding: 10px 10px 0px 15px !important;
+}
+
+.restrict_days_transit_package_ups_small td span a {
+
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    display: inline-block;
+    margin: 3px 0 0 0;
+}
+
+.ups_small_hazardous_materials_shipments th,
+.restrict_calendar_transit_small_packages_ups th,
+.ups_small_air_hazardous_fee th,
+.ups_small_ground_hazardous_fee th {
+    padding: 10px 10px 0px 15px !important;
+    font-weight: 400 !important;
+}
+
+
+.ups_small_hazardous_materials_shipments td {
+    padding: 10px 10px 0px 15px !important;
+}
+
+.ups_ground_transit_label td span a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    display: inline-block;
+    margin: 0px 0px 5px -111px;
+}
+
+.ups_hazardous_material_settings td a {
+
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    display: inline-block;
+    margin: 0px 0px 5px -122px;
+}
+
+.ups_sm_warning_msg {
+    margin: 5px 0 15px !important;
+    border-left-color: #ffb900 !important;
+    background: #fff;
+    border-left: 4px solid #fff;
+    -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
+    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
+    padding: 3px 12px;
+    display: none;
+}
+
+.ups_sm_warning_msg p, .already_exist p, .not_allowed p, .wrng_credential p, .warehouse_invalid_input_message p, .dropship_invalid_input_message p {
+    margin: .5em 0;
+}
+
+.ups_small_connection_section .form-table tr .titledesc {
+    width: 300px;
+}
+
+.ups_small_connection_section .button-primary,
+.ups_small_connection_section .is-primary {
+    margin-left: 27px;
+    width: 160px !important;
+    height: 40px;
+    justify-content: center;
+    text-transform: capitalize;
+}
+
+.ups_small_connection_section .connection_save_button {
+    margin-left: 15px;
+    width: 190px !important;
+    height: 40px;
+    background: #298cba none repeat scroll 0 0 !important;
+    color: #fff;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 3px;
+    border-radius: 3px;
+    border: none;
+}
+
+.ups_small_connection_section input[type="text"] {
+    width: 350px;
+    border-radius: 1px;
+    height: 36px !important;
+}
+
+.ups_small_connection_section p.submit {
+    margin-left: 310px;
+}
+
+.ups_small_connection_section p.submit > * {
+    line-height: 2.9 !important;
+}
+
+.ups_small_connection_section label {
+    cursor: default;
+}
+
+.ups_small_test_connection {
+    font-size: 13px !important;
+    width: 167px !important;
+    text-align: center;
+}
+
+.ups_small_test_connection:hover {
+    background: #008ec2;
+    color: #fff;
+    border-color: #006799;
+}
+
+.err {
+    color: #ff0000;
+    font-size: 13px;
+    font-weight: normal !important;
+    padding-left: 10px;
+}
+
+label[for="ups_small_api_access_key"]:after, label[for="ups_small_password"]:after, label[for="ups_small_account_number"]:after, label[for="ups_small_username"]:after, label[for="ups_small_licence_key"]:after, label[for="ups_client_id"]:after, label[for="ups_client_secret"]:after {
+    content: " *";
+    color: red;
+}
+
+/*
+ @ Quote Setting Section Start
+*/
+
+.desc_text_style {
+    font-style: normal !important;
+}
+
+.ups_small_quote_section .form-table tbody {
+    display: block;
+}
+
+.ups_small_quote_section tr.ups_small_dom_srvc_hdng_tr,
+.ups_small_quote_section tr.ups_small_int_srvc_hdng_tr,
+.ups_small_quote_section tr.wc_settings_domestic_select_all,
+.ups_small_quote_section tr.wc_settings_inter_select_all,
+.ups_small_quote_section tr.ups_small_quotes_services_tr,
+.ups_small_quote_section tr.ups_small_quotes_left_markup,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr,
+.ups_small_quote_section tr.ups_small_contract_services_tr,
+.ups_small_quote_section tr.ups_contract_services_heading,
+.ups_small_quote_section tr.ups_small_services_hide_me {
+    width: 49% !important;
+    display: inline-flex;
+}
+
+.ups_small_quote_section tr.ups_contract_services_heading th {
+    width: auto !important;
+}
+
+.ups_small_quote_section tr.ups_contract_services_heading td .description a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    display: inline-block;
+}
+
+.ups_small_quote_section tr.ups_small_quotes_services_tr th,
+.ups_small_quote_section tr.ups_small_quotes_services_tr td,
+.ups_small_quote_section tr.ups_small_quotes_left_markup th,
+.ups_small_quote_section tr.ups_small_quotes_left_markup td,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr th,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr td,
+.ups_small_quote_section tr.ups_small_contract_services_tr th,
+.ups_small_quote_section tr.ups_small_contract_services_tr td,
+.ups_small_quote_section tr.ups_small_services_hide_me th,
+.ups_small_quote_section tr.ups_small_services_hide_me td {
+    margin: 0px 0px 0px 0px !important;
+    padding-top: 0px !important;
+}
+
+.ups_small_quote_section tr.ups_small_quotes_left_markup th,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr th,
+.ups_small_quote_section tr.to_have_access_to_UPS_contract_services th {
+    display: none;
+}
+
+.ups_small_quote_section tr.to_have_access_to_UPS_contract_services td {
+    width: 100% !important;
+    padding-top: 0px !important;
+}
+
+.ups_small_quote_section tr.ups_small_quotes_left_markup td input,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr td input {
+    width: 300px !important;
+}
+
+.ups_small_quote_section tr.ups_small_quotes_left_markup td .description,
+.ups_small_quote_section tr.ups_small_quotes_markup_right_markup_tr td .description {
+    display: block !important;
+}
+
+.dom_int_srvc_hdng {
+    display: none !important;
+}
+
+.ups_small_quote_section input[type="text"], .ups_small_quote_section textarea {
+    width: 250px;
+    border-radius: 1px;
+}
+
+.ups_small_quote_section label {
+    cursor: default;
+}
+
+.ups_small_quote_section input[type="checkbox"] {
+    cursor: default;
+    height: 20px;
+    width: 20px;
+}
+
+.ups_small_quote_section input[type="checkbox"]:checked::before {
+    padding-top: 2px;
+    width: 24px;
+}
+
+.wp-admin select {
+    height: 36px;
+    border-radius: 1px;
+}
+
+.ups_small_quote_section .form-table tr .titledesc {
+    width: 300px !important;
+}
+
+.ups_small_quote_section .button-primary {
+    width: 120px !important;
+    margin-left: 336px;
+    height: 36px;
+    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+    justify-content: center;
+    text-transform: capitalize;
+}
+
+.ups_small_quotes_services_tr th {
+    padding: 0px 10px 0px 15px !important;
+    font-weight: 600 !important;
+}
+
+.ups_small_quotes_services_td {
+    padding: 0px 10px !important;
+    font-size: 14px !important;
+}
+
+.ups_small_quote_section .form-table:nth-of-type(2n+3) tr {
+    width: 70% !important;
+}
+
+.prevent_text_box {
+    padding: 10px;
+    font-size: 13px;
+}
+
+.hide_checkbox {
+    display: none !important;
+}
+
+.ups_small_zip_validation_err, .ups_small_city_validation_err, .ups_small_state_validation_err, .ups_small_country_validation_err {
+    color: #ff0000;
+    font-size: 11px;
+    font-weight: normal !important;
+    margin-top: 15px;
+    position: absolute;
+}
+
+.city_select_css {
+    width: 70%;
+    border-radius: 5px;
+    margin: 10px;
+}
+
+/*
+ @ User Guide Section
+*/
+.user_guide {
+    margin: 70px auto;
+    padding: 20px;
+    background: #fff;
+    border-radius: 5px;
+    width: 50%;
+    position: relative;
+    transition: all 5s ease-in-out;
+}
+
+.user_guide p {
+    font-size: 14px;
+}
+
+/*
+ @ Product Detail Dropship Dropdown
+*/
+
+.p_ds_location {
+    width: 50% !important;
+}
+
+.woocommerce_variable_attributes div.data select {
+    width: 100% !important;
+}
+
+.woocommerce_variable_attributes div.data .checkbox {
+    margin-left: 0px !important;
+    margin-right: 10px !important;
+}
+
+.form-row select {
+    height: 35px !important;
+}
+
+.ups_small_test_conn_prosessing {
+    background: rgba(255, 255, 255, 1) url("../warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%;
+}
+
+.residential_delivery_options_label_description_style span,
+.residential_delivery_current_subscription_style span,
+.residential_delivery_current_usage_style span {
+    font-style: normal !important;
+}
+
+.quote_section_class_smpkg span {
+    font-style: normal !important;
+}
+
+.en-list {
+    list-style: disc !important;
+}
+
+.en-list {
+    list-style-type: disc;
+    list-style-position: outside;
+    margin-left: 15px;
+}
+
+.ups_small_quote_as_residential_delivery th,
+.avaibility_auto_residential th {
+    margin-left: 10px !important;
+    font-weight: 400;
+}
+
+.ups_small_quote_section span.description {
+    font-style: normal !important;
+}
+
+label[for='residential_delivery_options_label_heading'],
+label[for='auto_residential_delivery_plan_auto_renew'],
+label[for='residential_delivery_current_subscription'],
+label[for='residential_delivery_current_usage'],
+.suspend_automatic_detection_of_residential_addresses_style .titledesc {
+    font-weight: 600 !important;
+}
+
+.ups_small_quote_as_residential_delivery th,
+.avaibility_auto_residential th {
+    padding: 0px 10px 0px 15px !important;
+    font-weight: 400 !important;
+}
+
+.ups_small_quote_as_residential_delivery td,
+.avaibility_auto_residential td {
+    padding: 0px 15px !important;
+}
+
+tr.ups_small_ground_hazardous_fee span.description,
+tr.ups_small_air_hazardous_fee span.description,
+tr.ups_small_hand_fee_mark_up_tr span.description {
+    display: block;
+}
+
+/*Css for nested material fields*/
+._nestedDimension, ._nestedStakingProperty {
+    width: 50% !important;
+}
+
+._nestedMaterials_tr .description a,
+.woocommerce_variable_attributes.wc-metabox-content p span.description a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    position: relative;
+    font-style: normal;
+    margin-left: 15px;
+}
+
+._nestedMaterials_tr .description {
+    font-style: normal;
+    font-size: 12px;
+}
+
+.disabled_me._nestedDimension, .disabled_me._nestedStakingProperty {
+    color: #000000;
+}
+
+/*estimated delivery options css*/
+tr.all_shipment_days_ups_small_tr {
+    display: inline-table;
+}
+
+tr.ups_small_shipment_day_tr {
+    display: inline-block;
+}
+
+tr.ups_small_shipment_day_tr th {
+    display: none;
+}
+
+#service_ups_small_estimates_title, #ups_small_packaging_method_label {
+    display: none;
+}
+
+tr.all_shipment_days_ups_small_tr th {
+    padding-left: 17px;
+    font-weight: normal;
+}
+
+tr.all_shipment_days_ups_small_tr td {
+    padding-left: 0px;
+}
+
+.ups_small_quote_section p.description {
+    font-style: normal;
+    margin: 0px;
+}
+
+.ups_small_quote_section tr.residential_delivery_options_plans_style {
+    padding-top: 30px;
+}
+
+tr.service_ups_small_estimates_title_tr th {
+    font-size: 1.2em;
+}
+
+.ups_small_cutOffTime_shipDateOffset th {
+    font-weight: 400;
+    padding-left: 15px;
+    padding-right: 16px !important;
+}
+
+.service_ups_small_estimates_title_tr td a,
+.ups_ground_transit_label td a,
+.ups_small_cutOffTime_shipDateOffset_required_label td a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    display: inline-block;
+    margin: 0px 0px 5px -122px;
+}
+
+.ups_small_connection_section input[type="text"], .ups_small_connection_section select,
+.ups_small_quote_section input[type="text"], .ups_small_quote_section select {
+    width: 400px !important;
+    border-radius: 1px;
+    height: 36px !important;
+}
+
+.ups_small_quote_section .ups_small_ground_hazardous_fee td,
+.ups_small_quote_section .ups_small_air_hazardous_fee td,
+.ups_small_quote_section .ups_small_hand_fee_mark_up_tr td,
+.ups_small_quote_section .wc_settings_wwe_small_allow_other_plugins_tr td {
+    padding: 10px 10px 0px 15px !important;
+}
+/*fdo va*/
+/* Create two equal columns that floats next to each other */
+.half-column {
+    float: left;
+    width: 50%;
+    padding: 10px;
+    box-sizing: border-box;
+}
+
+/* Clear floats after the columns */
+.parent-column:after {
+    content: "";
+    display: table;
+    clear: both;
+}
+.dn {
+    display:none;
+}
+.dnblock {
+    float: none;
+    text-align: center;
+    width: auto;
+    padding-top: 0px;
+}
+.user_guide_fdo {
+    margin: 70px auto;
+    padding: 20px;
+    background: #fff;
+    border-radius: 5px;
+    width: 70%;
+    position: relative;
+    transition: all 5s ease-in-out;
+}
+.user_guide_fdo p.submit {
+    display: none;
+}
+#freightdesk_online_id {
+    width: 98%;
+    padding: 3px;
+}
+.ups_small_quote_section tr.restrict_calendar_transit_small_packages_ups_tr td,
+.ups_small_quote_section tr.ups_small_hazardous_fee_options_tr td,
+.ups_small_quote_section tr.ups_small_enable_logs_tr td,
+.ups_small_quote_section tr.ups_small_rate_source_tr td,
+.ups_small_quote_section tr.en_ignore_items_through_freight_classification_tr td ,
+.ups_small_quote_section .wc_pervent_proceed_checkout_eniture td {
+    padding: 15px !important;
+}
+.ups_small_quote_section p.submit {
+    display: flex;
+    justify-content: flex-end;
+}
+.ups_small_quote_section p.submit .woocommerce-save-button  {
+  text-transform: capitalize;
+}
+
+/* Product variant UI styles */
+.woocommerce_variable_attributes.wc-metabox-content [class^="_dropship_location"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_ltl_freight"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
+.woocommerce_variable_attributes.wc-metabox-content select._nestedDimension,
+.woocommerce_variable_attributes.wc-metabox-content input._maxNestedItems,
+.woocommerce_variable_attributes.wc-metabox-content select._nestedStakingProperty {
+    width: 100% !important;
+    max-width: 100% !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content > p {
+    margin: 15px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data h2.sbs_settings_title {
+    padding: 0 !important;
+    margin: 30px 0 -10px 3px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content h2 {
+    padding: 0 !important;
+    margin: 30px 0 0 30px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content [class^="_dropship_location"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_ltl_freight"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_maxNestedItems"],
+.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedStakingProperty"] {
+    margin: 2px 0 0;
+    padding: 5px;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip,
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip,
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip,
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip,
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_maxNestedItems"] span.woocommerce-help-tip,
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedStakingProperty"] span.woocommerce-help-tip {
+    float: right;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_multiply_cart_quantity"],
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_enable_dropship"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_rot_ver"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_own_pack"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_multiple_packages"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_sao_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_vrf_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_nestedMaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_hazardousmaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_insurance_fee"] {
+    display: flex;
+    align-items: center;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_multiply_cart_quantity"] input[id^="en_multiply_cart_quantity"],
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_enable_dropship"] input[id^="_enable_dropship"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_rot_ver"] input[id^="_en_rot_ver"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_own_pack"] input[id^="_en_own_pack"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_multiple_packages"] input[id^="_en_multiple_packages"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_sao_pallet"] input[id^="_en_sao_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_vrf_pallet"] input[id^="_en_vrf_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_nestedMaterials"] input[id^="_nestedMaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_vrf_pallet"] input[id^="_en_vrf_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_hazardousmaterials"] input[id^="_hazardousmaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_insurance_fee"] input[id^="_en_insurance_fee"] {
+    order: -1;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_multiply_cart_quantity"] input[id^="en_multiply_cart_quantity"],
+.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_enable_dropship"] input[id^="_enable_dropship"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_nestedMaterials"] input[id^="_nestedMaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_hazardousmaterials"] input[id^="_hazardousmaterials"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_insurance_fee"] input[id^="_en_insurance_fee"] {
+    margin: 0 10px 0 0 !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_rot_ver"] input[id^="_en_rot_ver"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_own_pack"] input[id^="_en_own_pack"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_multiple_packages"] input[id^="_en_multiple_packages"] {
+    margin: 0 10px 0 15px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_sao_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_vrf_pallet"] {
+    margin-left: 30px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_sao_pallet"] input[id^="_en_sao_pallet"],
+.woocommerce_variable_attributes.wc-metabox-content p[class*="_en_vrf_pallet"] input[id^="_en_vrf_pallet"] {
+    margin-right: 10px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data fieldset[class*="_signature_required"] legend {
+    margin-bottom: 5px !important;
+}
+.woocommerce_variable_attributes.wc-metabox-content .data fieldset[class*="_signature_required"] ul[class*="wc-radios"] li {
+    padding: 0 !important;
+}
+#en-woo-review-plugin {
+    display: flex;
+    justify-content: end;
+}
+#en-woo-review-plugin a {
+    width: initial !important;
+    height: auto !important;
+    text-transform: initial !important;
+    font-size: unset !important;
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/db/ups-small-db.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/db/ups-small-db.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/db/ups-small-db.php	(revision 3237693)
@@ -0,0 +1,270 @@
+<?php
+/**
+ * UPS Small WooComerce |  Create warehouse database table
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Create warehouse database table
+ */
+function eniture_create_ups_small_wh_db($network_wide = null)
+{
+    if ( is_multisite() && $network_wide ) {
+
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            global $wpdb;
+            $warehouse_table = $wpdb->prefix . "warehouse";
+            $warehouse_table_exists = $wpdb->query("SHOW TABLES LIKE ".$wpdb->prefix ."warehouse");
+            if (!$warehouse_table_exists) {
+                $origin = 'CREATE TABLE ' . $warehouse_table . '(
+            id mediumint(9) NOT NULL AUTO_INCREMENT,
+            city varchar(200) NOT NULL,
+            state varchar(200) NOT NULL,
+            address varchar(255) NOT NULL,
+            phone_instore varchar(255) NOT NULL,
+            zip varchar(200) NOT NULL,
+            country varchar(200) NOT NULL,
+            location varchar(200) NOT NULL,
+            nickname varchar(200) NOT NULL,
+            enable_store_pickup VARCHAR(255) NOT NULL,
+            miles_store_pickup VARCHAR(255) NOT NULL ,
+            match_postal_store_pickup VARCHAR(255) NOT NULL ,
+            checkout_desc_store_pickup VARCHAR(255) NOT NULL ,
+            enable_local_delivery VARCHAR(255) NOT NULL ,
+            miles_local_delivery VARCHAR(255) NOT NULL ,
+            match_postal_local_delivery VARCHAR(255) NOT NULL ,
+            checkout_desc_local_delivery VARCHAR(255) NOT NULL ,
+            fee_local_delivery VARCHAR(255) NOT NULL ,
+            suppress_local_delivery VARCHAR(255) NOT NULL,
+            origin_markup VARCHAR(10), 
+            PRIMARY KEY  (id) )';
+                dbDelta($origin);
+            }
+
+            $myCustomer = $wpdb->get_row("SHOW COLUMNS FROM " . $warehouse_table . " LIKE 'enable_store_pickup'");
+            if (!(isset($myCustomer->Field) && $myCustomer->Field == 'enable_store_pickup')) {
+                $wpdb->query(sprintf("ALTER TABLE %s ADD COLUMN enable_store_pickup VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN miles_store_pickup VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN match_postal_store_pickup VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN checkout_desc_store_pickup VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN enable_local_delivery VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN miles_local_delivery VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN match_postal_local_delivery VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN checkout_desc_local_delivery VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN fee_local_delivery VARCHAR(255) NOT NULL , "
+                    . "ADD COLUMN suppress_local_delivery VARCHAR(255) NOT NULL", $warehouse_table));
+
+            }
+            // Origin terminal address
+            ups_small_update_warehouse();
+            add_option('ups_small_db_version', '1.0');
+            restore_current_blog();
+        }
+
+    } else {
+        global $wpdb;
+        $warehouse_table = $wpdb->prefix . "warehouse";
+        $warehouse_table_exists = $wpdb->query("SHOW TABLES LIKE '" . $warehouse_table . "'");
+        if (!$warehouse_table_exists) {
+            $origin = 'CREATE TABLE ' . $warehouse_table . '(
+            id mediumint(9) NOT NULL AUTO_INCREMENT,
+            city varchar(200) NOT NULL,
+            state varchar(200) NOT NULL,
+            address varchar(255) NOT NULL,
+            phone_instore varchar(255) NOT NULL,
+            zip varchar(200) NOT NULL,
+            country varchar(200) NOT NULL,
+            location varchar(200) NOT NULL,
+            nickname varchar(200) NOT NULL,
+            enable_store_pickup VARCHAR(255) NOT NULL,
+            miles_store_pickup VARCHAR(255) NOT NULL ,
+            match_postal_store_pickup VARCHAR(255) NOT NULL ,
+            checkout_desc_store_pickup VARCHAR(255) NOT NULL ,
+            enable_local_delivery VARCHAR(255) NOT NULL ,
+            miles_local_delivery VARCHAR(255) NOT NULL ,
+            match_postal_local_delivery VARCHAR(255) NOT NULL ,
+            checkout_desc_local_delivery VARCHAR(255) NOT NULL ,
+            fee_local_delivery VARCHAR(255) NOT NULL ,
+            suppress_local_delivery VARCHAR(255) NOT NULL,
+            origin_markup VARCHAR(10), 
+            PRIMARY KEY  (id) )';
+            dbDelta($origin);
+        }
+
+        $myCustomer = $wpdb->get_row("SHOW COLUMNS FROM " . $warehouse_table . " LIKE 'enable_store_pickup'");
+        if (!(isset($myCustomer->Field) && $myCustomer->Field == 'enable_store_pickup')) {
+            $wpdb->query(sprintf("ALTER TABLE %s ADD COLUMN enable_store_pickup VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN miles_store_pickup VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN match_postal_store_pickup VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN checkout_desc_store_pickup VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN enable_local_delivery VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN miles_local_delivery VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN match_postal_local_delivery VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN checkout_desc_local_delivery VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN fee_local_delivery VARCHAR(255) NOT NULL , "
+                . "ADD COLUMN suppress_local_delivery VARCHAR(255) NOT NULL", $warehouse_table));
+
+        }
+        // Origin terminal address
+        ups_small_update_warehouse();
+        add_option('ups_small_db_version', '1.0');
+    }
+}
+/**
+ * Update warehouse
+ */
+function ups_small_update_warehouse()
+{
+    // Origin terminal address
+    global $wpdb;
+    $warehouse_address = $wpdb->get_row("SHOW COLUMNS FROM " . $wpdb->prefix . "warehouse LIKE 'phone_instore'");
+    if (!(isset($warehouse_address->Field) && $warehouse_address->Field == 'phone_instore')) {
+        $wpdb->query(sprintf("ALTER TABLE " . $wpdb->prefix . "warehous ADD COLUMN address VARCHAR(255) NOT NULL"));
+        $wpdb->query(sprintf("ALTER TABLE " . $wpdb->prefix . "warehous ADD COLUMN phone_instore VARCHAR(255) NOT NULL"));
+    }
+
+    $origin_markup = $wpdb->get_row("SHOW COLUMNS FROM " . $wpdb->prefix . "warehouse LIKE 'origin_markup'");
+    if (!(isset($origin_markup->Field) && $origin_markup->Field == 'origin_markup')) {
+        $wpdb->query(sprintf("ALTER TABLE " . $wpdb->prefix . "warehous ADD COLUMN origin_markup VARCHAR(10) NOT NULL"));
+    }
+}
+
+/**
+ * Create shipping rules database table
+ */
+function eniture_create_ups_small_shipping_rules_db($network_wide = null)
+{
+    if ( is_multisite() && $network_wide ) {
+
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            global $wpdb;
+            $shipping_rules_table = $wpdb->prefix . "eniture_ups_small_shipping_rules";
+            $shipping_rules_table_exist = $wpdb->query("SHOW TABLES LIKE '" . $shipping_rules_table . "'");
+
+            if (!$shipping_rules_table_exist) {
+                $query = 'CREATE TABLE ' . $shipping_rules_table . '(
+                    id INT(10) NOT NULL AUTO_INCREMENT,
+                    name VARCHAR(50) NOT NULL,
+                    type VARCHAR(30) NOT NULL,
+                    settings TEXT NULL,
+                    is_active TINYINT(1) NOT NULL,
+                    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+                    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+                    PRIMARY KEY (id)
+                )';
+
+                dbDelta($query);
+            } else {
+                $query = 'SHOW COLUMNS FROM ' . $shipping_rules_table . ' LIKE "type"';
+                $result = $wpdb->get_results($query);
+                $query = count($result) == 0 ? 'ALTER TABLE ' . $shipping_rules_table . ' ADD COLUMN type VARCHAR(30) NOT NULL' : 'ALTER TABLE ' . $shipping_rules_table . ' MODIFY type VARCHAR(30) NOT NULL';
+                $wpdb->query($query);
+            }
+
+            restore_current_blog();
+        }
+
+    } else {
+        global $wpdb;
+        $shipping_rules_table = $wpdb->prefix . "eniture_ups_small_shipping_rules";
+        $shipping_rules_table_exist = $wpdb->query("SHOW TABLES LIKE '" . $shipping_rules_table . "'");
+
+        if (!$shipping_rules_table_exist) {
+            $query = 'CREATE TABLE ' . $shipping_rules_table . '(
+                id INT(10) NOT NULL AUTO_INCREMENT,
+                name VARCHAR(50) NOT NULL,
+                type VARCHAR(30) NOT NULL,
+                settings TEXT NULL,
+                is_active TINYINT(1) NOT NULL,
+                created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+                updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+                PRIMARY KEY (id) 
+            )';
+
+            dbDelta($query);
+        } else {
+            $query = 'SHOW COLUMNS FROM ' . $shipping_rules_table . ' LIKE "type"';
+            $result = $wpdb->get_results($query);
+            $query = count($result) == 0 ? 'ALTER TABLE ' . $shipping_rules_table . ' ADD COLUMN type VARCHAR(30) NOT NULL' : 'ALTER TABLE ' . $shipping_rules_table . ' MODIFY type VARCHAR(30) NOT NULL';
+            $wpdb->query($query);
+        }
+    }
+}
+
+/**
+ * Create plugin option
+ */
+function eniture_create_ups_small_option($network_wide = null)
+{
+    if ( is_multisite() && $network_wide ) {
+
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            $eniture_plugins = get_option('EN_Plugins');
+
+            if (!$eniture_plugins) {
+                add_option('EN_Plugins', wp_json_encode(array('ups_small')));
+            } else {
+                $plugins_array = json_decode($eniture_plugins, true);
+
+                if (!in_array('ups_small', $plugins_array)) {
+                    array_push($plugins_array, 'ups_small');
+                    update_option('EN_Plugins', wp_json_encode($plugins_array));
+                }
+            }
+            restore_current_blog();
+        }
+
+    } else {
+        $eniture_plugins = get_option('EN_Plugins');
+
+        if (!$eniture_plugins) {
+            add_option('EN_Plugins', wp_json_encode(array('ups_small')));
+        } else {
+            $plugins_array = json_decode($eniture_plugins, true);
+
+            if (!in_array('ups_small', $plugins_array)) {
+                array_push($plugins_array, 'ups_small');
+                update_option('EN_Plugins', wp_json_encode($plugins_array));
+            }
+        }
+    }
+
+}
+
+/**
+ * Remove plugin Option
+ */
+function eniture_ups_small_deactivate_plugin($network_wide = null)
+{
+    if ( is_multisite() && $network_wide ) {
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            $eniture_plugins = get_option('EN_Plugins');
+            $plugins_array = json_decode($eniture_plugins, true);
+            $plugins_array = !empty($plugins_array) && is_array($plugins_array) ? $plugins_array : array();
+            $key = array_search('ups_small', $plugins_array);
+            if ($key !== false) {
+                unset($plugins_array[$key]);
+            }
+            update_option('EN_Plugins', wp_json_encode($plugins_array));
+            restore_current_blog();
+        }
+    } else {
+        $eniture_plugins = get_option('EN_Plugins');
+        $plugins_array = json_decode($eniture_plugins, true);
+        $plugins_array = !empty($plugins_array) && is_array($plugins_array) ? $plugins_array : array();
+        $key = array_search('ups_small', $plugins_array);
+        if ($key !== false) {
+            unset($plugins_array[$key]);
+        }
+        update_option('EN_Plugins', wp_json_encode($plugins_array));
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/en-hit-to-update-plan.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/en-hit-to-update-plan.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/en-hit-to-update-plan.php	(revision 3237693)
@@ -0,0 +1,52 @@
+<?php
+
+if ( ! defined( 'ABSPATH' ) ) exit;
+
+$site_path = eniture_fs_get_wp_config_path();
+
+function eniture_fs_get_wp_config_path() {
+    $base = dirname(__FILE__);
+    $path = false;
+
+    if (@file_exists(dirname(dirname($base)) . "/wp-config.php")) {
+        $path = dirname(dirname($base));
+    } else
+    if (@file_exists(dirname(dirname(dirname($base))) . "/wp-config.php")) {
+        $path = dirname(dirname(dirname($base)));
+    } else
+        $path = false;
+
+    if ($path != false) {
+        $path = str_replace("\\", "/", $path);
+    }
+    return $path;
+}
+
+require($site_path . '/wp-load.php');
+
+$get_option = get_option('ups_small_web_hook_plan_requests');
+$en_web_hook_requests = (isset($get_option) && (!empty($get_option))) ? json_decode($get_option, TRUE) : array();
+$en_web_hook_requests[] = (isset($_GET)) ? $_GET : array();
+update_option('ups_small_web_hook_plan_requests', wp_json_encode($en_web_hook_requests));
+
+$plan = isset($_GET['pakg_group']) ? sanitize_text_field(wp_unslash( $_GET['pakg_group'] )) : '';
+if ($plan == "0" || $plan == "1" || $plan == "2" || $plan == "3") {
+
+    if (isset($_GET['pakg_price']) && $_GET['pakg_price'] == "0") {
+        $plan = '0';
+    }
+
+    update_option("ups_small_package", "$plan");
+
+    $plan_type = isset($_GET["plan_type"]) ? sanitize_text_field(wp_unslash( $_GET["plan_type"] )) : '';
+    update_option("ups_small_quotes_store_type", "$plan_type");
+
+    $expire_days = isset($_GET["pakg_duration"]) ? sanitize_text_field(wp_unslash( $_GET["pakg_duration"] )) : '';
+    update_option("ups_small_package_expire_days", "$expire_days");
+
+    $expiry_date = isset($_GET["expiry_date"]) ? sanitize_text_field(wp_unslash( $_GET["expiry_date"] )) : '';
+    update_option("ups_small_package_expire_date", "$expiry_date");
+
+    eniture_check_ups_small_plan_on_product_detail();
+}
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-fdo.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-fdo.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-fdo.php	(revision 3237693)
@@ -0,0 +1,102 @@
+<?php
+
+class Eniture_EnUpsSmallFdo
+{
+
+    public $en_fdo_meta_data;
+
+    /**
+     * product hazardous.
+     * @param array $package
+     * @param array $en_fdo_meta_data
+     * @return array
+     */
+    public function en_package_hazardous($package, $en_fdo_meta_data)
+    {
+        $hazmat = (isset($package['hazardous_material'])) ? true : false;
+        $en_fdo_meta_data['accessorials']['hazmat'] = $hazmat;
+        return $en_fdo_meta_data;
+    }
+
+    /**
+     * arrange cart objects.
+     * @param type $package
+     * @return array
+     */
+    public function en_cart_package($package)
+    {
+        $this->en_fdo_meta_data['plugin_type'] = 'small';
+        $this->en_fdo_meta_data['plugin_name'] = 'ups_small';
+        $accessorials['residential'] = get_option('ups_small_quote_as_residential_delivery') == 'yes' ? true : false;
+        $this->en_fdo_meta_data['accessorials'] = $accessorials;
+
+        (isset($package['items'])) ? $this->en_package_items($package['items']) : '';
+        (isset($package['origin'])) ? $this->en_package_address($package['origin']) : '';
+
+        return $this->en_fdo_meta_data;
+    }
+
+    /**
+     * arrange items.
+     * @param type $items
+     */
+    public function en_package_items($items)
+    {
+        $this->en_fdo_meta_data['items'] = [];
+        foreach ($items as $item_key => $item_data) {
+            $productId = $productName = $productQty = $actualProductPrice = $products = $productPrice = $productWeight = $productLength = $productWidth = $productHeight = $ptype = $hazardousMaterial = $productType = $productSku = $productClass = $attributes = $variantId = $markup = '';
+            $attributes = [];
+            extract($item_data);
+
+            $meta_data = [];
+            if (!empty($attributes)) {
+                foreach ($attributes as $attr_key => $attr_value) {
+                    $meta_data[] = [
+                        'key' => $attr_key,
+                        'value' => !empty($attr_value) && is_string($attr_value) ? str_replace(array("'", '"'), '', $attr_value) : '',
+                    ];
+                }
+
+                $attributes[$attr_key] = !empty($attr_value) && is_string($attr_value) ? str_replace(array("'", '"'), '', (string) $attr_value) : '';
+            }
+
+            $productName = is_string($productName) && !empty($productName) ? str_replace(array("'", '"'), '', $productName) : '';
+
+            $item = [
+                'id' => $productId,
+                'name' => $productName,
+                'quantity' => $productQty,
+                'price' => $productPrice,
+                'price' => $actualProductPrice,
+                'weight' => $productWeight,
+                'length' => $productLength,
+                'width' => $productWidth,
+                'height' => $productHeight,
+                'type' => $ptype,
+                'hazmat' => $hazardousMaterial,
+                'product' => $productType,
+                'sku' => $productSku,
+                'attributes' => $attributes,
+                'shipping_class' => $productClass,
+                'variant_id' => $variantId,
+                'meta_data' => $meta_data,
+                'markup' => $markup
+            ];
+
+            // Hook for flexibility adding to package
+            $item = apply_filters('en_fdo_package', $item, $item_data);
+            $this->en_fdo_meta_data['items'][$item_key] = $item;
+        }
+    }
+
+    /**
+     * Get address.
+     * @param array $address
+     */
+    public function en_package_address($address)
+    {
+        (isset($address['locationId'])) ? $address['id'] = $address['locationId'] : '';
+        $this->en_fdo_meta_data['address'] = $address;
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-sbs.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-sbs.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/fdo/en-sbs.php	(revision 3237693)
@@ -0,0 +1,31 @@
+<?php
+
+if (!class_exists('Eniture_EnSbsProperties')) {
+    class Eniture_EnSbsProperties
+    {
+        public function __construct()
+        {
+            add_filter('en_fdo_package', [$this, 'en_fdo_sbs_properties'], 10, 2);
+        }
+
+        public function en_fdo_sbs_properties($item, $item_data)
+        {
+            $sbs_properties = [
+                '_en_rot_ver' => 'vertical_rotation',
+                '_en_own_pack' => 'own_package',
+                '_en_multiple_packages' => 'multiple_packages'
+            ];
+
+            $id = $variant_id = '';
+            extract($item);
+            foreach ($sbs_properties as $property => $index) {
+                $post_id = (isset($variant_id) && $variant_id > 0) ? $variant_id : $id;
+                $item[$index] = get_post_meta($post_id, $property, true);
+            }
+
+            return $item;
+        }
+    }
+
+    new Eniture_EnSbsProperties();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/fdo/freightdesk-online-section.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/fdo/freightdesk-online-section.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/fdo/freightdesk-online-section.php	(revision 3237693)
@@ -0,0 +1,73 @@
+<?php
+/**
+ * UPS Freightdesk online Template
+ *
+ * @package     UPS Quotes
+ * @author      Eniture-Technology
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+$link = '<a href="https://freightdesk.online/" target="_blank">freightdesk.online</a>';
+$link_freight = '<a href="https://freightdesk.online/" target="_blank">Learn more</a>';
+$link_register = '<a href="https://freightdesk.online/register" target="_blank">click here</a>';
+$f_desk_online_id = '<a href="https://support.eniture.com/what-is-my-freightdesk-online-id" target="_blank">[ ? ]</a>';
+$company_id = get_option('en_fdo_company_id');
+if(get_option('en_fdo_company_id_status') != 1) {
+    $button_connect = '<a href="javascript:void(0)" id="fd_online_id_ups_s" class="button-primary">Connect</a>';
+    $id_field = '<input type="text" name="freightdesk_online_id" id="freightdesk_online_id" value="" maxlength="10" placeholder="FreightDesk Online ID">';
+    $ulli = ' <p>While connecting, Woocommerce may prompt you to authorize access to:</p>
+                        <ul style="list-style-type: disc;margin-left: 16px">
+                            <li>Create webhooks</li>
+                            <li>View and manage coupons</li>
+                            <li>View and manage customers</li>
+                            <li>View and manage orders and sales </li>
+                            <li>Sales reports</li>
+                            <li>View and manage products</li>
+                        </ul>';
+    $dn = '';
+    $dnblock = '';
+    $note = '<div id="message" class="en-coupon-code-div woocommerce-message en-coupon-notice">
+        <p>
+            <strong>Note!</strong>
+            To establish a connection, you must have a FreightDesk Online account. If you don’t have one, ' . $link_register . ' to register.
+        </p>
+
+    </div>';
+    $style = 'padding: 15px 0';
+
+}else {
+    if(get_option('en_fdo_company_id_status') == 1) {
+        $button_connect = '<a href="javascript:void(0)" data="disconnect" id="fd_online_id_ups_s" class="button-primary">Disconnect</a>';
+        $id_field = 'Connected to FreightDesk Online using FreightDesk Online Account ID <strong> ' . $company_id . ' <strong> ' . $f_desk_online_id;
+        $ulli ='';
+        $dn = 'dn';
+        $dnblock = 'dnblock';
+        $note = '';
+        $style = 'padding: 0 0 15px 0';
+    }
+}
+$message = wp_sprintf('<div class="user_guide_fdo ups_small_wrapper">
+    <h2>Connect to FreightDesk Online.</h2>
+    <p>
+    FreightDesk Online (
+        %s
+        ) is a cloud-based, multi-carrier shipping platform that allows its users to create and manage postal, parcel, and LTL freight shipments. Connect your store to FreightDesk Online and virtually eliminate the need for data entry when shipping orders. (
+        %s
+        )
+    </p>
+    %s
+    <div class="parent-column">
+      <div class="half-column %s">
+        <h2>FreightDesk Online ID %s <span style="color:red">*</span></h2>
+      </div>
+      <div class="half-column %s">', $link, $link_freight, $note, $dn, $f_desk_online_id, $dnblock);
+echo wp_kses_post($message);
+$eniture_ups_small_freightdesk_fields = wp_sprintf('<div style="%s">
+                            %s
+                         </div> 
+                         <span id="con_dis"> %s</span>
+                         %s
+                        </div></div>', $style, $id_field, $button_connect, $ulli);
+echo $eniture_ups_small_freightdesk_fields;
+?>
Index: /small-package-quotes-ups-edition/tags/4.5.17/fdo/validate-addresses-section.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/fdo/validate-addresses-section.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/fdo/validate-addresses-section.php	(revision 3237693)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * UPS small Freightdesk online Template
+ *
+ * @package     UPS small Quotes
+ * @author      Eniture-Technology
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+$link = ' <a href="https://validate-addresses.com/" target="_blank">validate-addresses.com</a>';
+$link_freight = '<a href="https://validate-addresses.com/" target="_blank">Learn more</a>';
+$link_register = '<a href="https://validate-addresses.com/register" target="_blank">click here</a>';
+$message = wp_sprintf('<div class="user_guide_fdo ups_small_wrapper">
+    <h2>Connect to Validate Addresses.</h2>
+    <p>
+    Validate Addresses ( %s ) is a cloud-based platform that verifies an order’s address details after the order is placed. It is also the most economical way.
+        You won’t be paying to validate an address every time someone enters the checkout process and then abandons the cart. 
+        Connect your store to Validate Address and virtually eliminate to avoid spending your time validating addresses. (
+        %s )
+    </p>
+
+    <div id="message" class="en-coupon-code-div woocommerce-message en-coupon-notice">
+        <p>
+            <strong>Note!</strong>
+            To establish a connection, you must have a Validate Addresses account. If you don’t have one, %s to register.
+        </p>
+    </div>', $link, $link_freight, $link_register);
+echo wp_kses_post($message);
+?>
+
+
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/front/js/en-ups-small-checkout.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/front/js/en-ups-small-checkout.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/front/js/en-ups-small-checkout.js	(revision 3237693)
@@ -0,0 +1,32 @@
+jQuery(function() {
+    if(typeof trigger == "undefined"){
+        var trigger = false;
+        jQuery('#billing_address_1').addClass('billing_address1');
+        jQuery('#billing_address_2').addClass('billing_address_2');
+        jQuery('#shipping_address_1').addClass('shipping_address_1');
+        jQuery('#shipping_address_2').addClass('shipping_address_2');
+        jQuery('#shipping_city').addClass('shipping_city');
+        jQuery('#billing_city').addClass('billing_city');
+        jQuery('#billing_postcode').addClass('billing_postcode');
+        jQuery('#shipping_postcode').addClass('shipping_postcode');
+
+        jQuery('.billing_address1 , .billing_address_2 , \n\
+                .shipping_address_1 , .shipping_address_2 , \n\
+                .shipping_city , .billing_city , .billing_postcode , \n\
+                .shipping_postcode').on('keydown' , function(event){
+            if(trigger == false){
+                event.stopImmediatePropagation();
+            }
+            trigger = false; 
+        });
+
+        jQuery('.billing_address1 , .billing_address_2 , \n\
+                .shipping_address_1 , .shipping_address_2 , \n\
+                .shipping_city , .billing_city , .billing_postcode , \n\
+                .shipping_postcode').on('change' , function(event){
+            trigger = true; 
+            jQuery('.billing_address1').trigger('keydown');
+
+        });
+    }
+});
Index: /small-package-quotes-ups-edition/tags/4.5.17/helper/en_helper_class.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/helper/en_helper_class.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/helper/en_helper_class.php	(revision 3237693)
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+/**
+ * Description of Eniture_Ups_Small_Helper_Class
+ *
+ * @author alignpx02
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+if (!class_exists("Eniture_Ups_Small_Helper_Class")) {
+
+    class Eniture_Ups_Small_Helper_Class {
+
+        /**
+         * Constructor.
+         */
+        public function __construct() {
+            
+        }
+
+        /**
+         * If array_columsn not exists.
+         * @param array $input
+         * @param type $columnKey
+         * @param type $indexKey
+         * @return boolean|array
+         */
+        function array_column(array $input, $columnKey, $indexKey = null) {
+            $array = array();
+            foreach ($input as $value) {
+                if (!array_key_exists($columnKey, $value)) {
+                    
+                    return false;
+                }
+                if (is_null($indexKey)) {
+                    $array[] = $value[$columnKey];
+                } else {
+                    if (!array_key_exists($indexKey, $value)) {
+                       
+                        return false;
+                    }
+                    if (!is_scalar($value[$indexKey])) {
+                       
+                        return false;
+                    }
+                    $array[$value[$indexKey]] = $value[$columnKey];
+                }
+            }
+            return $array;
+        }
+
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/js/en-ups-small.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/js/en-ups-small.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/js/en-ups-small.js	(revision 3237693)
@@ -0,0 +1,1165 @@
+jQuery(document).ready(function () {
+
+    jQuery(".ups_small_quotes_markup_left_markup, .ups_small_quotes_markup_right_markup, .ups_small_quotes_label_left").focus(function (e) {
+        jQuery("#" + this.id).css({'border-color': '#ddd'});
+    });
+    jQuery("#order_shipping_line_items .shipping .display_meta").css('display', 'none');
+
+    jQuery("#wc_settings_wwe_allow_other_plugins").closest('tr').addClass("wc_settings_wwe_allow_other_plugins");
+
+    jQuery(".ups_small_services_hide_me").closest('tr').addClass("ups_small_services_hide_me");
+    jQuery("#to_have_access_to_UPS_contract_services").closest('tr').addClass("to_have_access_to_UPS_contract_services");
+
+    jQuery("#restrict_days_transit_package_ups_small").closest('tr').addClass("restrict_days_transit_package_ups_small");
+    jQuery("#ups_ground_transit_label").closest('tr').addClass("ups_ground_transit_label");
+    jQuery("#ups_small_ground_hazardous_fee").closest('tr').addClass("ups_small_ground_hazardous_fee");
+    jQuery("#ups_small_air_hazardous_fee").closest('tr').addClass("ups_small_air_hazardous_fee");
+    jQuery("input[name*='ups_small_hazardous_materials_shipments']").closest('tr').addClass('ups_small_hazardous_materials_shipments');
+    jQuery("input[name*='restrict_calendar_transit_small_packages_ups']").closest('tr').addClass('restrict_calendar_transit_small_packages_ups');
+    jQuery("input[name*='ups_hazardous_material_settings']").closest('tr').addClass('ups_hazardous_material_settings');
+    jQuery(".ups_contract_services_empty_label").closest('tr').addClass('ups_contract_services_empty_tr');
+    // jQuery("input[name*='ups_contract_services']").closest('tr').addClass('ups_ground_transit_label');
+    jQuery("input[name*='ups_contract_services']").closest('tr').addClass('ups_contract_services_tr');
+    jQuery("#ups_contract_services_markup_label_empty").addClass('ups_contract_services_hidden');
+    jQuery("#ups_small_hand_fee_mark_up , .ups_small_quotes_markup_left_markup , .ups_small_quotes_markup_right_markup , #ups_small_air_hazardous_fee, #ups_small_ground_hazardous_fee").attr('maxlength', 7);
+    jQuery("#instore-pickup-desc").attr('maxlength', 25);
+    jQuery("#local-delivery-desc").attr('maxlength', 25);
+
+    jQuery("#ups_contract_services_markup_label_empty").closest('tr').addClass("ups_small_quotes_right_label_hidden");
+    jQuery("#ups_surepost_1_lb_or_greater_markup_label_empty").closest('tr').addClass("ups_small_quotes_right_label_hidden");
+    jQuery("#ups_surepost_bound_printed_matter_markup_label_empty").closest('tr').addClass("ups_small_quotes_right_label_hidden");
+    jQuery("#ups_surepost_media_mail_markup_label_empty").closest('tr').addClass("ups_small_quotes_right_label_hidden");
+    jQuery("#ups_ground_with_freight_pricing_markup_label_empty").closest('tr').addClass("ups_small_quotes_right_label_hidden");
+
+
+    jQuery("#ups_small_quote_as_residential_delivery").closest('tr').addClass("ups_small_quote_as_residential_delivery");
+    jQuery("#residential_delivery_options_label").closest('tr').addClass("residential_delivery_options_label");
+    jQuery("#avaibility_auto_residential").closest('tr').addClass("avaibility_auto_residential");
+    jQuery("#ups_contract_services1").closest('td').addClass("ups_contract_services1_td");
+    jQuery(".ups_small_quotes_markup_right_markup").closest('tr').addClass("ups_small_quotes_markup_right_markup_tr");
+    jQuery("#shipping_methods_do_not_sort_by_price").closest('tr').addClass("shipping_methods_do_not_sort_by_price_tr");
+    jQuery("#ups_contract_services").closest('tr').addClass("ups_contract_services_heading");
+    jQuery("#ups_small_hand_fee_mark_up").closest('tr').addClass("ups_small_hand_fee_mark_up_tr");
+
+    //          estimated delivery options
+    jQuery(".ups_small_dont_show_estimate_option").closest('tr').addClass("ups_small_dont_show_estimate_option_tr");
+    jQuery("#service_small_estimates_title").closest('tr').addClass("service_small_estimates_title_tr");
+    jQuery("input[name=ups_small_delivery_estimates]").closest('tr').addClass("ups_small_delivery_estimates_tr");
+    jQuery("#service_ups_small_estimates_title").closest('tr').addClass("service_ups_small_estimates_title_tr");
+    jQuery("#estimated_delivery_days_format").closest('tr').addClass("estimated_delivery_days_format_tr");
+    jQuery("#estimated_delivery_date_format").closest('tr').addClass("estimated_delivery_date_format_tr");
+
+    jQuery(".ups_small_shipment_day").closest('tr').addClass("ups_small_shipment_day_tr");
+    jQuery("#all_shipment_days_ups_small").closest('tr').addClass("all_shipment_days_ups_small_tr");
+    jQuery("#ups_small_cutOffTime_shipDateOffset").closest('tr').addClass("ups_small_cutOffTime_shipDateOffset_required_label");
+    jQuery("#ups_small_orderCutoffTime").closest('tr').addClass("ups_small_cutOffTime_shipDateOffset");
+    jQuery("#ups_small_shipmentOffsetDays").closest('tr').addClass("ups_small_cutOffTime_shipDateOffset");
+    jQuery("#en_ignore_items_through_freight_classification").closest('tr').addClass("en_ignore_items_through_freight_classification_tr");
+    jQuery("input[name=restrict_calendar_transit_small_packages_ups]").closest('tr').addClass("restrict_calendar_transit_small_packages_ups_tr");
+    jQuery("input[name=ups_small_hazardous_fee_options]").closest('tr').addClass("ups_small_hazardous_fee_options_tr");
+    jQuery("#ups_small_enable_logs").closest('tr').addClass("ups_small_enable_logs_tr");
+    jQuery("input[name=ups_small_rate_source]").closest('tr').addClass("ups_small_rate_source_tr");
+    jQuery("#ups_small_rate_source").closest('tr').addClass("ups_small_rate_source_tr");
+
+    jQuery('#ups_small_shipmentOffsetDays').attr('min', 1);
+
+    // toggle delivery estimate label fields display
+    jQuery('#estimated_delivery_days_format').attr('maxlength', 50);
+    jQuery('#estimated_delivery_date_format').attr('maxlength', 50);
+    toggle_ups_delivery_estimate_label_fields();
+    jQuery('input[name=ups_small_delivery_estimates]').on('change', toggle_ups_delivery_estimate_label_fields);
+
+    // Review plugin button
+    if (jQuery('.ups_small_plan_notice').length > 0 || jQuery('.ups_small_wrapper').length > 0) {
+        const review_plugin_html = '<div id="en-woo-review-plugin"><a href="https://wordpress.org/support/plugin/small-package-quotes-ups-edition/reviews/#new-post" target="_blank" class="button button-primary is-primary">Review this plugin</a></div>';
+
+        if (jQuery('ul.subsubsub').length > 0) {
+            jQuery('.subsubsub').after(review_plugin_html); 
+        } else {
+            jQuery('li a:contains("Connection Settings")').closest('ul').after(review_plugin_html);
+        }
+    }
+
+    var upsSmallCurrentTime = eniture_ups_small_admin_script.ups_small_order_cutoff_time;
+    if (upsSmallCurrentTime != '') {
+        jQuery('#ups_small_orderCutoffTime').wickedpicker({
+            now: upsSmallCurrentTime,
+            title: 'Cut Off Time'
+        });
+    } else {
+        jQuery('#ups_small_orderCutoffTime').wickedpicker({
+            now: '',
+            title: 'Cut Off Time'
+        });
+    }
+
+    /*
+     * Uncheck Week days Select All Checkbox
+     */
+
+    jQuery(".ups_small_shipment_day").on('change load', function () {
+        var checkboxes = jQuery('.ups_small_shipment_day:checked').length;
+        var un_checkboxes = jQuery('.ups_small_shipment_day').length;
+        if (checkboxes === un_checkboxes) {
+            jQuery('.all_shipment_days_ups_small').prop('checked', true);
+        } else {
+            jQuery('.all_shipment_days_ups_small').prop('checked', false);
+        }
+    });
+
+    /*
+     * Select All Shipment Week days
+     */
+
+    var all_int_checkboxes = jQuery('.all_shipment_days_ups_small');
+    if (all_int_checkboxes.length === all_int_checkboxes.filter(":checked").length) {
+        jQuery('.all_shipment_days_ups_small').prop('checked', true);
+    }
+
+    jQuery(".all_shipment_days_ups_small").change(function () {
+        if (this.checked) {
+            jQuery(".ups_small_shipment_day").each(function () {
+                this.checked = true;
+            });
+        } else {
+            jQuery(".ups_small_shipment_day").each(function () {
+                this.checked = false;
+            });
+        }
+    });
+
+    //** Start: Validat Shipment Offset Days
+    jQuery("#ups_small_shipmentOffsetDays").keydown(function (e) {
+        if (e.keyCode == 8)
+            return;
+
+        var val = jQuery("#ups_small_shipmentOffsetDays").val();
+        if (val.length > 1 || e.keyCode == 190) {
+            e.preventDefault();
+        }
+        // Allow: backspace, delete, tab, escape, enter and .
+        if (jQuery.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190, 53, 189]) !== -1 ||
+            // Allow: Ctrl+A, Command+A
+            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
+            // Allow: home, end, left, right, down, up
+            (e.keyCode >= 35 && e.keyCode <= 40)) {
+            // let it happen, don't do anything
+            return;
+        }
+        // Ensure that it is a number and stop the keypress
+        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
+            e.preventDefault();
+        }
+
+    });
+    // Allow: only positive numbers
+    jQuery("#ups_small_shipmentOffsetDays").keyup(function (e) {
+        if (e.keyCode == 189) {
+            e.preventDefault();
+            jQuery("#ups_small_shipmentOffsetDays").val('');
+        }
+
+    });
+
+    // To update packaging type
+    if(eniture_ups_small_admin_script.ups_small_packaging_type == ''){
+        jQuery.ajax({
+            type: "POST",
+            url: ajaxurl,
+            data: { action: 'eniture_ups_small_activate_hit_to_update_plan', wp_nonce: eniture_ups_small_admin_script.nonce },
+            success: function (data_response) {}
+        });
+    }
+
+    jQuery("#ups_small_ground_hazardous_fee , #ups_small_air_hazardous_fee , #ups_small_hand_fee_mark_up, #restrict_days_transit_package_ups_small, #ups_small_shipmentOffsetDays").focus(function (e) {
+        jQuery("#" + this.id).css({'border-color': '#ddd'});
+    });
+
+    var prevent_text_box = jQuery('.prevent_text_box').length;
+    if (!prevent_text_box > 0) {
+        jQuery("input[name*='wc_pervent_proceed_checkout_eniture']").closest('tr').addClass('wc_pervent_proceed_checkout_eniture');
+        jQuery(".wc_pervent_proceed_checkout_eniture input[value*='allow']").after('Allow user to continue to check out and display this message <br><textarea  name="allow_proceed_checkout_eniture" class="prevent_text_box" title="Message" maxlength="250">' + eniture_ups_small_admin_script.allow_proceed_checkout_eniture + '</textarea><br><span class="description"> Enter a maximum of 250 characters.</span>');
+        jQuery(".wc_pervent_proceed_checkout_eniture input[value*='prevent']").after('Prevent user from checking out and display this message <br><textarea name="prevent_proceed_checkout_eniture" class="prevent_text_box" title="Message" maxlength="250">' + eniture_ups_small_admin_script.prevent_proceed_checkout_eniture + '</textarea><br><span class="description"> Enter a maximum of 250 characters.</span>');
+    }
+
+    var url = get_url_vars_ups_freight()["tab"];
+    if (url === 'ups_small') {
+        jQuery('#footer-left').attr('id', 'wc-footer-left');
+    }
+    /*
+     * Add err class on connection settings page
+     */
+    jQuery('.ups_small_connection_section input[type="text"]').each(function () {
+        if (jQuery(this).parent().find('.err').length < 1) {
+            jQuery(this).after('<span class="err"></span>');
+        }
+    });
+
+
+    /*
+     * Add maxlength Attribute on Account Number Connection Setting Page
+     */
+
+    jQuery("#ups_small_account_number").attr('maxlength', '8');
+
+    jQuery("#ups_client_id").attr('minlength', '1');
+    jQuery("#ups_client_secret").attr('minlength', '1');
+    jQuery("#ups_client_id").attr('maxlength', '100');
+    jQuery("#ups_client_secret").attr('maxlength', '100');
+    jQuery("#ups_new_api_username").attr('maxlength', '100');
+    jQuery("#ups_new_api_password").attr('maxlength', '100');
+
+
+    jQuery('.ups_small_connection_section .form-table').before('<div class="ups_sm_warning_msg"><p><b>Note!</b> You must have a UPS Small account to use this application. If you do not have one contact UPS at 800-742-5877 or <a href="https://www.ups.com/one-to-one/login" target="_blank" >register online</a>.</p>');
+    jQuery('.ups_sm_warning_msg').first().show();
+
+    /*
+     * Add Title To Connection Setting Fields
+     */
+
+    jQuery('#ups_small_api_access_key').attr('title', 'API Access Key');
+    jQuery('#ups_small_password').attr('title', 'Password');
+    jQuery('#ups_small_account_number').attr('title', 'Account Number');
+    jQuery('#ups_small_username').attr('title', 'Username');
+    jQuery('#ups_small_licence_key').attr('title', 'Eniture API Key');
+    jQuery('#ups_small_ground_hazardous_fee').attr('title', 'Ground Hazardous Material Fee');
+    jQuery('#ups_small_air_hazardous_fee').attr('title', 'Air Hazardous Material Fee');
+    jQuery('#ups_small_hand_fee_mark_up').attr('title', 'Handling Fee / Markup');
+    jQuery('#ups_client_id').attr('title', 'Client ID');
+    jQuery('#ups_client_secret').attr('title', 'Client Secret');
+    jQuery('#ups_new_api_username').attr('title', 'Username');
+    jQuery('#ups_new_api_password').attr('title', 'Password');
+
+    /*
+     * Add CSS Class To Quote Services
+     */
+    jQuery("#ups_small_dom_srvc_hdng").closest('tr').addClass("ups_small_dom_srvc_hdng_tr");
+    jQuery("#ups_small_int_srvc_hdng").closest('tr').addClass("ups_small_int_srvc_hdng_tr");
+    jQuery('.bold-text').closest('tr').addClass('ups_small_quotes_services_tr');
+    jQuery('.ups_small_quotes_services').closest('tr').addClass('ups_small_quotes_services_tr');
+    jQuery('.ups_small_quotes_services').closest('td').addClass('ups_small_quotes_services_td');
+    jQuery('.ups_small_int_quotes_services').closest('tr').addClass('ups_small_quotes_services_tr');
+    jQuery('.ups_international_service').closest('tr').addClass('ups_small_quotes_services_tr_right');
+    jQuery('.ups_small_all_services').closest('tr').addClass('wc_settings_domestic_select_all');
+    jQuery('.ups_small_all_int_services').closest('tr').addClass('wc_settings_inter_select_all');
+    jQuery('.ups_small_int_quotes_services').closest('td').addClass('ups_small_quotes_services_td');
+    jQuery('.ups_international_service').closest('td').addClass('ups_small_quotes_services_td_right');
+
+    jQuery('#ups_surepost_less_than_1_lb').closest('tr').addClass('ups_small_contract_services_tr');
+    jQuery('#ups_surepost_1_lb_or_greater').closest('tr').addClass('ups_small_contract_services_tr');
+    jQuery('#ups_surepost_bound_printed_matter').closest('tr').addClass('ups_small_contract_services_tr');
+    jQuery('#ups_surepost_media_mail').closest('tr').addClass('ups_small_contract_services_tr');
+    jQuery('#ups_ground_with_freight_pricing').closest('tr').addClass('ups_small_contract_services_tr');
+    jQuery('#ups_surepost_less_than_1_lb').closest('td').addClass('ups_small_contract_services_td');
+    jQuery('#ups_surepost_1_lb_or_greater').closest('td').addClass('ups_small_contract_services_td');
+    jQuery('#ups_surepost_bound_printed_matter').closest('td').addClass('ups_small_contract_services_td');
+    jQuery('#ups_surepost_media_mail').closest('td').addClass('ups_small_contract_services_td');
+    jQuery('#ups_ground_with_freight_pricing').closest('td').addClass('ups_small_contract_services_td');
+
+    /*
+     * Uncheck Select All Checkbox
+     */
+
+    jQuery(".ups_small_quotes_services").on('change load', function () {
+        var checkboxes = jQuery('.ups_small_quotes_services:checked').length;
+
+        var un_checkboxes = jQuery('.ups_small_quotes_services').length;
+
+        if (checkboxes === un_checkboxes) {
+            jQuery('.ups_small_all_services').prop('checked', true);
+        } else {
+            jQuery('.ups_small_all_services').prop('checked', false);
+        }
+    });
+
+    /*
+     * Uncheck International Services Select All Checkbox
+     */
+
+    jQuery(".ups_small_int_quotes_services").on('change load', function () {
+        var int_checkboxes = jQuery('.ups_small_int_quotes_services:checked').length;
+        var int_un_checkboxes = jQuery('.ups_small_int_quotes_services').length;
+
+        if (int_checkboxes === int_un_checkboxes) {
+            jQuery('.ups_small_all_int_services').prop('checked', true);
+        } else {
+            jQuery('.ups_small_all_int_services').prop('checked', false);
+        }
+    });
+
+    if (typeof ups_connection_section_api_endpoint == 'function') {
+        ups_connection_section_api_endpoint();
+    }
+
+    jQuery('#ups_api_endpoint').on('change', function () {
+        ups_connection_section_api_endpoint();
+    });
+
+
+    /*
+     * Select All Services
+     */
+    var sm_all_checkboxes = jQuery('.ups_small_quotes_services');
+    if (sm_all_checkboxes.length === sm_all_checkboxes.filter(":checked").length) {
+        jQuery('.ups_small_all_services').prop('checked', true);
+    }
+
+    jQuery(".ups_small_all_services").change(function () {
+        if (this.checked) {
+            jQuery(".ups_small_quotes_services").each(function () {
+                this.checked = true;
+            });
+        } else {
+            jQuery(".ups_small_quotes_services").each(function () {
+                this.checked = false;
+            });
+        }
+    });
+    /*
+         * Select All Services International
+         */
+    var all_int_checkboxes = jQuery('.ups_small_int_quotes_services');
+    if (all_int_checkboxes.length === all_int_checkboxes.filter(":checked").length) {
+        jQuery('.ups_small_all_int_services').prop('checked', true);
+    }
+
+    jQuery(".ups_small_all_int_services").change(function () {
+        if (this.checked) {
+            jQuery(".ups_small_int_quotes_services").each(function () {
+                this.checked = true;
+            });
+        } else {
+            jQuery(".ups_small_int_quotes_services").each(function () {
+                this.checked = false;
+            });
+        }
+    });
+
+    /*
+         * Connection Settings Input Validation On Save
+         */
+
+    jQuery(".ups_small_connection_section .button-primary, .ups_small_connection_section .is-primary").click(function () {
+        var has_err = true;
+        jQuery(".ups_small_connection_section tbody input[type='text']").each(function () {
+            var input = jQuery(this).val();
+            var response = validateString(input);
+            var errorText = jQuery(this).attr('title');
+            var optional = jQuery(this).data('optional');
+
+            var errorElement = jQuery(this).parent().find('.err');
+            jQuery(errorElement).html('');
+
+            optional = (optional === undefined) ? 0 : 1;
+            errorText = (errorText != undefined) ? errorText : '';
+
+            if ((optional == 0) && (response == false || response == 'empty')) {
+                errorText = (response == 'empty') ? errorText + ' is required.' : 'Invalid input.';
+                jQuery(errorElement).html(errorText);
+            }
+
+            has_err = (response != true && optional == 0) ? false : has_err;
+        });
+        var input = has_err;
+        if (input === false) {
+            return false;
+        }
+    });
+    var en_wd_origin_city = jQuery("#en_wd_origin_city").val();
+    /*
+     * Test Connection
+     */
+
+    jQuery(".ups_small_connection_section .woocommerce-save-button").before('<a href="javascript:void(0)" class="button-primary ups_small_test_connection">Test Connection</a>');
+    jQuery('.ups_small_test_connection').click(function (e) {
+       var has_err = true;
+        jQuery(".ups_small_connection_section tbody input[type='text']").each(function () {
+            var input = jQuery(this).val();
+            var response = validateString(input);
+            var errorText = jQuery(this).attr('title');
+            var optional = jQuery(this).data('optional');
+
+            var errorElement = jQuery(this).parent().find('.err');
+            jQuery(errorElement).html('');
+
+            optional = (optional === undefined) ? 0 : 1;
+            errorText = (errorText != undefined) ? errorText : '';
+
+            if ((optional == 0) && (response == false || response == 'empty')) {
+                errorText = (response == 'empty') ? errorText + ' is required.' : 'Invalid input.';
+                jQuery(errorElement).html(errorText);
+            }
+
+            has_err = (response != true && optional == 0) ? false : has_err;
+        });
+        var input = has_err;
+        if (input === false) {
+            return false;
+        }
+
+        let api_endpoint = jQuery('#ups_api_endpoint').val();
+        var postForm = {
+            'action': 'eniture_ups_small_test_connection',
+            'ups_small_acc_number': jQuery('#ups_small_account_number').val(),
+            'ups_small_license': jQuery('#ups_small_licence_key').val(),
+            'api_end_point': api_endpoint,
+            'wp_nonce': eniture_ups_small_admin_script.nonce
+        };
+
+        if(api_endpoint == 'ups_old_api'){
+            postForm.ups_small_username = jQuery('#ups_small_username').val();
+            postForm.ups_small_password = jQuery('#ups_small_password').val();
+            postForm.ups_small_api_access_key = jQuery('#ups_small_api_access_key').val();
+        }else{
+            postForm.client_id = jQuery('#ups_client_id').val();
+            postForm.client_secret = jQuery('#ups_client_secret').val();
+            postForm.ups_small_username = jQuery('#ups_new_api_username').val();
+            postForm.ups_small_password = jQuery('#ups_new_api_password').val();
+        }
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+
+            beforeSend: function () {
+                jQuery('#ups_small_api_access_key, #ups_small_password, #ups_small_account_number, #ups_small_username, #ups_small_licence_key, #ups_client_id, #ups_client_secret, #ups_new_api_username, #ups_new_api_password').addClass('ups_small_test_conn_prosessing');
+            },
+            success: function (data) {
+                jQuery('#ups_small_api_access_key, #ups_small_password, #ups_small_account_number, #ups_small_username, #ups_small_licence_key, #ups_client_id, #ups_client_secret,  #ups_new_api_username, #ups_new_api_password').removeClass('ups_small_test_conn_prosessing');
+                jQuery(".ups_small_success_message, .ups_small_error_message, .updated").remove();
+
+                if (data.success) {
+                    jQuery('.ups_sm_warning_msg').before('<div class="notice notice-success ups_small_success_message"><p><strong>Success!</strong> ' + data.success + '</p></div>');
+                } else if (data.error) {
+                    jQuery('.ups_sm_warning_msg').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error! </strong>' + data.error + '</p></div>');
+                } else {
+                    jQuery('.ups_sm_warning_msg').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error! </strong>Please verify credentials and try again.</p></div>');
+                }
+            }
+        });
+        e.preventDefault();
+    });
+    // fdo va
+    jQuery('#fd_online_id_ups_s').click(function (e) {
+        var postForm = {
+            'action': 'ups_s_fd',
+            'company_id': jQuery('#freightdesk_online_id').val(),
+            'disconnect': jQuery('#fd_online_id_ups_s').attr("data"),
+            'wp_nonce': eniture_ups_small_admin_script.nonce
+        }
+        var id_lenght = jQuery('#freightdesk_online_id').val();
+        var disc_data = jQuery('#fd_online_id_ups_s').attr("data");
+        if(typeof (id_lenght) != "undefined" && id_lenght.length < 1) {
+            jQuery(".ups_small_error_message").remove();
+            jQuery('.user_guide_fdo').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error!</strong> FreightDesk Online ID is Required.</p></div>');
+            return;
+        }
+        jQuery.ajax({
+            type: "POST",
+            url: ajaxurl,
+            data: postForm,
+            beforeSend: function () {
+                jQuery('#freightdesk_online_id').addClass('ups_small_test_conn_prosessing');
+            },
+            success: function (data_response) {
+                if(typeof (data_response) == "undefined"){
+                    return;
+                }
+                var fd_data = JSON.parse(data_response);
+                jQuery('#freightdesk_online_id').css('background', '#fff');
+                jQuery(".ups_small_error_message").remove();
+                if((typeof (fd_data.is_valid) != 'undefined' && fd_data.is_valid == false) || (typeof (fd_data.status) != 'undefined' && fd_data.is_valid == 'ERROR')) {
+                    jQuery('.user_guide_fdo').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error! ' + fd_data.message + '</strong></p></div>');
+                }else if(typeof (fd_data.status) != 'undefined' && fd_data.status == 'SUCCESS') {
+                    jQuery('.user_guide_fdo').before('<div class="notice notice-success ups_small_success_message"><p><strong>Success! ' + fd_data.message + '</strong></p></div>');
+                    window.location.reload(true);
+                }else if(typeof (fd_data.status) != 'undefined' && fd_data.status == 'ERROR') {
+                    jQuery('.user_guide_fdo').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error! ' + fd_data.message + '</strong></p></div>');
+                }else if (fd_data.is_valid == 'true') {
+                    jQuery('.user_guide_fdo').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error!</strong> FreightDesk Online ID is not valid.</p></div>');
+                } else if (fd_data.is_valid == 'true' && fd_data.is_connected) {
+                    jQuery('.user_guide_fdo').before('<div class="notice notice-error ups_small_error_message"><p><strong>Error!</strong> Your store is already connected with FreightDesk Online.</p></div>');
+
+                } else if (fd_data.is_valid == true && fd_data.is_connected == false && fd_data.redirect_url != null) {
+                    window.location = fd_data.redirect_url;
+                } else if (fd_data.is_connected == true) {
+                    jQuery('#con_dis').empty();
+                    jQuery('#con_dis').append('<a href="#" id="fd_online_id_ups_s" data="disconnect" class="button-primary">Disconnect</a>')
+                }
+            }
+        });
+        e.preventDefault();
+    });
+
+    //          JS for edit product nested fields
+    jQuery("._nestedMaterials").closest('p').addClass("_nestedMaterials_tr");
+    jQuery("._nestedPercentage").closest('p').addClass("_nestedPercentage_tr");
+    jQuery("._maxNestedItems").closest('p').addClass("_maxNestedItems_tr");
+    jQuery("._nestedDimension").closest('p').addClass("_nestedDimension_tr");
+    jQuery("._nestedStakingProperty").closest('p').addClass("_nestedStakingProperty_tr");
+
+    if (!jQuery('._nestedMaterials').is(":checked")) {
+        jQuery('._nestedPercentage_tr').hide();
+        jQuery('._nestedDimension_tr').hide();
+        jQuery('._maxNestedItems_tr').hide();
+        jQuery('._nestedDimension_tr').hide();
+        jQuery('._nestedStakingProperty_tr').hide();
+    } else {
+        jQuery('._nestedPercentage_tr').show();
+        jQuery('._nestedDimension_tr').show();
+        jQuery('._maxNestedItems_tr').show();
+        jQuery('._nestedDimension_tr').show();
+        jQuery('._nestedStakingProperty_tr').show();
+    }
+
+    jQuery("._nestedPercentage").attr('min', '0');
+    jQuery("._maxNestedItems").attr('min', '0');
+    jQuery("._nestedPercentage").attr('max', '100');
+    jQuery("._maxNestedItems").attr('max', '100');
+    jQuery("._nestedPercentage").attr('maxlength', '3');
+    jQuery("._maxNestedItems").attr('maxlength', '3');
+
+    if (jQuery("._nestedPercentage").val() == '') {
+        jQuery("._nestedPercentage").val(0);
+    }
+
+    var delivery_estimate = jQuery('input[name=ups_small_delivery_estimates]:checked').val();
+    if (delivery_estimate == undefined) {
+        jQuery('.ups_small_dont_show_estimate_option').prop("checked", true);
+    }
+
+    var delivery_estimate_val = jQuery('input[name=ups_small_delivery_estimates]:checked').val();
+    if (delivery_estimate_val == 'dont_show_estimates') {
+        jQuery("#ups_small_orderCutoffTime").prop('disabled', true);
+        jQuery("#ups_small_shipmentOffsetDays").prop('disabled', true);
+        jQuery('.all_shipment_days_ups_small, .ups_small_shipment_day').prop('disabled', true);
+    } else {
+        jQuery("#ups_small_orderCutoffTime").prop('disabled', false);
+        jQuery("#ups_small_shipmentOffsetDays").prop('disabled', false);
+        jQuery('.all_shipment_days_ups_small, .ups_small_shipment_day').prop('disabled', false);
+    }
+
+
+    jQuery('.ups_small_quote_section .button-primary, .ups_small_quote_section .is-primary').on('click', function (e) {
+        jQuery(".updated").hide();
+        jQuery('.error').remove();
+
+        if (!en_ups_small_handling_fee_validation()) {
+            return false;
+        } else if (!en_ups_small_air_hazardous_material_fee_validation()) {
+            return false;
+        } else if (!en_ups_small_ground_hazardous_material_fee_validation()) {
+            return false;
+        } else if (!en_ups_small_ground_transit_validation()) {
+            return false;
+        } else if (!ups_small_palletshipclass()) {
+            return false;
+        }
+
+        var ups_small_shipmentOffsetDays = jQuery("#ups_small_shipmentOffsetDays").val();
+        if (ups_small_shipmentOffsetDays != "" && ups_small_shipmentOffsetDays < 1) {
+
+            jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should not be less than 1.</p></div>');
+            jQuery('html, body').animate({
+                'scrollTop': jQuery('.ups_small_orderCutoffTime_error').position().top
+            });
+            jQuery("#ups_small_shipmentOffsetDays").css({'border-color': '#e81123'});
+            return false
+        }
+        if (ups_small_shipmentOffsetDays != "" && ups_small_shipmentOffsetDays > 8) {
+
+            jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should be less than or equal to 8.</p></div>');
+            jQuery('html, body').animate({
+                'scrollTop': jQuery('.ups_small_orderCutoffTime_error').position().top
+            });
+            jQuery("#ups_small_shipmentOffsetDays").css({'border-color': '#e81123'});
+            return false
+        }
+
+        var numberOnlyRegex = /^[0-9]+$/;
+
+        if (ups_small_shipmentOffsetDays != "" && !numberOnlyRegex.test(ups_small_shipmentOffsetDays)) {
+
+            jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_orderCutoffTime_error"><p><strong>Error! </strong>Entered Days are not valid.</p></div>');
+            jQuery('html, body').animate({
+                'scrollTop': jQuery('.ups_small_orderCutoffTime_error').position().top
+            });
+            jQuery("#ups_small_shipmentOffsetDays").css({'border-color': '#e81123'});
+            return false
+        }
+
+        let ups_small_quotes_markup_left_markup_class = jQuery('.ups_small_quotes_markup_left_markup');
+        jQuery(ups_small_quotes_markup_left_markup_class).each(function () {
+
+            if (jQuery('#' + this.id).val() != '' && !en_ups_small_domestic_markup_service(this.id)) {
+                e.preventDefault();
+                return false;
+            }
+        });
+
+
+        let ups_small_quotes_markup_right_markup = jQuery('.ups_small_quotes_markup_right_markup');
+        jQuery(ups_small_quotes_markup_right_markup).each(function () {
+
+            if (jQuery('#' + this.id).val() != '' && !en_ups_small_international_markup_service(this.id)) {
+                e.preventDefault();
+                return false;
+            }
+        });
+
+
+        var num_of_checkboxes = jQuery('.ups_small_quotes_services:checked').length;
+        var num_of_int_checkboxes = jQuery('.ups_small_int_quotes_services:checked').length;
+
+        /*
+         * Check Number of Selected Services
+         */
+
+        if (num_of_checkboxes < 1 && num_of_int_checkboxes < 1) {
+            no_service_selected_ups_small(num_of_checkboxes);
+            return false;
+        }
+
+        /*Custom Error Message Validation*/
+        var checkedValCustomMsg = jQuery("input[name='wc_pervent_proceed_checkout_eniture']:checked").val();
+        var allow_proceed_checkout_eniture = jQuery("textarea[name=allow_proceed_checkout_eniture]").val();
+        var prevent_proceed_checkout_eniture = jQuery("textarea[name=prevent_proceed_checkout_eniture]").val();
+
+        if (checkedValCustomMsg == 'allow' && allow_proceed_checkout_eniture == '') {
+            jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_custom_error_message"><p><strong>Error! </strong>Custom message field is empty.</p></div>');
+            jQuery('html, body').animate({
+                'scrollTop': jQuery('.ups_small_custom_error_message').position().top
+            });
+            return false;
+        }
+        if (checkedValCustomMsg == 'prevent' && prevent_proceed_checkout_eniture == '') {
+            jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_custom_error_message"><p><strong>Error! </strong>Custom message field is empty.</p></div>');
+            jQuery('html, body').animate({
+                'scrollTop': jQuery('.ups_small_custom_error_message').position().top
+            });
+            return false;
+        }
+
+    });
+
+    //      estimated delivery options js
+    jQuery("input[name=ups_small_delivery_estimates]").change(function () {
+        var delivery_estimate_val = jQuery('input[name=ups_small_delivery_estimates]:checked').val();
+        if (delivery_estimate_val == 'dont_show_estimates') {
+            jQuery("#ups_small_orderCutoffTime").prop('disabled', true);
+            jQuery("#ups_small_shipmentOffsetDays").prop('disabled', true);
+            jQuery('.all_shipment_days_ups_small, .ups_small_shipment_day').prop('disabled', true);
+        } else {
+            jQuery("#ups_small_orderCutoffTime").prop('disabled', false);
+            jQuery("#ups_small_shipmentOffsetDays").prop('disabled', false);
+            jQuery('.all_shipment_days_ups_small, .ups_small_shipment_day').prop('disabled', false);
+        }
+    });
+    //      Nested fields validation on product details
+    jQuery("._nestedPercentage").keydown(function (eve) {
+        stopSpecialCharacters(eve);
+        var nestedPercentage = jQuery('._nestedPercentage').val();
+        if (nestedPercentage.length == 2) {
+            var newValue = nestedPercentage + '' + eve.key;
+            if (newValue > 100) {
+                return false;
+            }
+        }
+    });
+
+    jQuery("._maxNestedItems").keydown(function (eve) {
+        ups_small_stop_special_characters(eve);
+    });
+
+    jQuery("._nestedMaterials").change(function () {
+        if (!jQuery('._nestedMaterials').is(":checked")) {
+            jQuery('._nestedPercentage_tr').hide();
+            jQuery('._nestedDimension_tr').hide();
+            jQuery('._maxNestedItems_tr').hide();
+            jQuery('._nestedDimension_tr').hide();
+            jQuery('._nestedStakingProperty_tr').hide();
+        } else {
+            jQuery('._nestedPercentage_tr').show();
+            jQuery('._nestedDimension_tr').show();
+            jQuery('._maxNestedItems_tr').show();
+            jQuery('._nestedDimension_tr').show();
+            jQuery('._nestedStakingProperty_tr').show();
+        }
+
+    });
+
+    jQuery(document).on("click", '._nestedMaterials', function(e) {
+        const checkbox_class = jQuery(e.target).attr("class");
+        const name = jQuery(e.target).attr("name");
+        const checked = jQuery(e.target).prop('checked');
+
+        if (checkbox_class?.includes('_nestedMaterials')) {
+            const id = name?.split('_nestedMaterials')[1];
+            setNestMatDisplay(id, checked);
+        }
+    });
+
+    // Callback function to execute when mutations are observed
+    const handleMutations = (mutationList) => {
+        let childs = [];
+        for (const mutation of mutationList) {
+            childs = mutation?.target?.children;
+            if (childs?.length) setNestedMaterialsUI();
+          }
+    };
+    const observer = new MutationObserver(handleMutations),
+        targetNode = document.querySelector('.woocommerce_variations.wc-metaboxes'),
+        config = { childList: true, subtree: true };
+    if (targetNode) observer.observe(targetNode, config);
+
+    jQuery(".ups_small_quotes_markup_left_label").closest('tr').addClass('ups_small_quotes_left_label');
+    jQuery(".ups_small_quotes_markup_right_label").closest('tr').addClass('ups_small_quotes_right_label');
+    jQuery(".ups_small_quotes_markup_left_markup").closest('tr').addClass('ups_small_quotes_left_markup');
+    jQuery(".ups_small_quotes_markup_right_markup").closest('tr').addClass('ups_small_quotes_right_markup');
+    jQuery("#ups_small_next_day_air_early_markup_label_empty").closest('tr').addClass('ups_small_next_day_air_early_markup_label_empty_tr');
+    jQuery("#ups_small_3day_select_markup_label_empty").closest('tr').addClass('ups_small_3day_select_markup_label_empty_tr');
+    jQuery(".ups_small_quotes_label_left").attr('maxlength', 50);
+    jQuery(".ups_small_quotes_label_left").closest('tr').addClass('ups_small_quotes_left_markup');
+
+    //** Start: Validation for domestic service level markup
+
+    jQuery(".ups_small_quotes_markup_left_markup, .ups_small_quotes_markup_right_markup, #en_wd_origin_markup, #en_wd_dropship_markup, ._en_product_markup").keydown(function (e) {
+        // Allow: backspace, delete, tab, escape, enter and .
+        if (jQuery.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190, 53, 189]) !== -1 ||
+            // Allow: Ctrl+A, Command+A
+            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
+            // Allow: home, end, left, right, down, up
+            (e.keyCode >= 35 && e.keyCode <= 40)) {
+            // let it happen, don't do anything
+            return;
+        }
+        // Ensure that it is a number and stop the keypress
+        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
+            e.preventDefault();
+        }
+
+        if ((jQuery(this).val().indexOf('.') != -1) && (jQuery(this).val().substring(jQuery(this).val().indexOf('.'), jQuery(this).val().indexOf('.').length).length > 2)) {
+            if (e.keyCode !== 8 && e.keyCode !== 46) { //exception
+                e.preventDefault();
+            }
+        }
+
+        if(jQuery(this).val().length > 7){
+            e.preventDefault();
+        }
+
+    });
+
+    jQuery(".ups_small_quotes_markup_left_markup, .ups_small_quotes_markup_right_markup, #en_wd_origin_markup, #en_wd_dropship_markup, ._en_product_markup").keyup(function (e) {
+
+        var val = jQuery(this).val();
+        jQuery(this).css({"border": "1px solid #ddd"});
+
+        if (val.split('.').length - 1 > 1) {
+            var newval = val.substring(0, val.length - 1);
+            var countDots = newval.substring(newval.indexOf('.') + 1).length;
+            newval = newval.substring(0, val.length - countDots - 1);
+            jQuery(this).val(newval);
+
+        }
+
+        if (val.split('%').length - 1 > 1) {
+            var newval = val.substring(0, val.length - 1);
+            var countPercentages = newval.substring(newval.indexOf('%') + 1).length;
+            newval = newval.substring(0, val.length - countPercentages - 1);
+            jQuery(this).val(newval);
+        }
+        if (val.split('>').length - 1 > 0) {
+            var newval = val.substring(0, val.length - 1);
+            var countGreaterThan = newval.substring(newval.indexOf('>') + 1).length;
+            newval = newval.substring(newval, newval.length - countGreaterThan - 1);
+            jQuery(this).val(newval);
+        }
+        if (val.split('_').length - 1 > 0) {
+            var newval = val.substring(0, val.length - 1);
+            var countUnderScore = newval.substring(newval.indexOf('_') + 1).length;
+            newval = newval.substring(newval, newval.length - countUnderScore - 1);
+            jQuery(this).val(newval);
+        }
+    });
+
+});
+
+function ups_small_stop_special_characters(e) {
+    // Allow: backspace, delete, tab, escape, enter and .
+    if (jQuery.inArray(e.keyCode, [46, 9, 27, 13, 110, 190, 189]) !== -1 ||
+        // Allow: Ctrl+A, Command+A
+        (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
+        // Allow: home, end, left, right, down, up
+        (e.keyCode >= 35 && e.keyCode <= 40)) {
+        // let it happen, don't do anything
+        e.preventDefault();
+        return;
+    }
+    // Ensure that it is a number and stop the keypress
+    if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 90)) && (e.keyCode < 96 || e.keyCode > 105) && e.keyCode != 186 && e.keyCode != 8) {
+        e.preventDefault();
+    }
+    if (e.keyCode == 186 || e.keyCode == 190 || e.keyCode == 189 || (e.keyCode > 64 && e.keyCode < 91)) {
+        e.preventDefault();
+        return;
+    }
+}
+
+/*
+* Validate Selecting Services
+*/
+function no_service_selected_ups_small(num_of_checkboxes) {
+    jQuery(".updated").hide();
+    jQuery(".ups_small_quote_section h2:first-child").after('<div id="message" class="error inline no_srvc_select"><p><strong>Error! </strong>Please select at least one quote service.</p></div>');
+    jQuery('html, body').animate({
+        'scrollTop': jQuery('.no_srvc_select').position().top
+    });
+    return false;
+}
+
+function en_ups_small_domestic_markup_service(id) {
+
+    var en_ups_small_domestic_markup_service = jQuery('#' + id).val();
+    var en_ups_small_domestic_markup_service_regex = /^(-?[0-9]{1,4}%?)$|(\.[0-9]{1,2})%?$/;
+    var numeric_values_regex = /^[0-9]{1,7}$/;
+    if (numeric_values_regex.test(en_ups_small_domestic_markup_service)) {
+        return true;
+    } else if (!en_ups_small_domestic_markup_service_regex.test(en_ups_small_domestic_markup_service)) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_dom_markup_service_error"><p><strong>Error! </strong>Service Level Markup fee format should be 100.20 or 10%.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_dom_markup_service_error').position().top
+        });
+        jQuery("#" + id).css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function en_ups_small_international_markup_service(id) {
+
+    var en_ups_small_international_markup_service = jQuery('#' + id).val();
+    var en_ups_small_international_markup_service_regex = /^(-?[0-9]{1,4}%?)$|(\.[0-9]{1,2})%?$/;
+    var numeric_values_regex = /^[0-9]{1,7}$/;
+    if (numeric_values_regex.test(en_ups_small_international_markup_service)) {
+        return true;
+    } else if (!en_ups_small_international_markup_service_regex.test(en_ups_small_international_markup_service)) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_int_markup_service_error"><p><strong>Error! </strong>Service Level Markup fee format should be 100.20 or 10%.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_int_markup_service_error').position().top
+        });
+        jQuery("#" + id).css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function ups_small_palletshipclass() {
+    var en_ship_class = jQuery('#en_ignore_items_through_freight_classification').val();
+    var en_ship_class_arr = en_ship_class.split(',');
+    var en_ship_class_trim_arr = en_ship_class_arr.map(Function.prototype.call, String.prototype.trim);
+    if (en_ship_class_trim_arr.indexOf('ltl_freight') != -1) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_pallet_weight_error"><p><strong>Error! </strong>Shipping Slug of <b>ltl_freight</b> can not be ignored.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_pallet_weight_error').position().top
+        });
+        jQuery("#en_ignore_items_through_freight_classification").css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function en_ups_small_handling_fee_validation() {
+
+    var handling_fee = jQuery('#ups_small_hand_fee_mark_up').val();
+    var handling_fee_regex = /^(-?[0-9]{1,4}%?)$|(\.[0-9]{1,2})%?$/;
+    var numeric_values_regex = /^[0-9]{1,7}$/;
+    if (handling_fee != '' && numeric_values_regex.test(handling_fee)) {
+        return true;
+    } else if (handling_fee != '' && !handling_fee_regex.test(handling_fee) || handling_fee.split('.').length - 1 > 1) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_handlng_fee_error"><p><strong>Error! </strong>Handling fee format should be 100.20 or 10%.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_handlng_fee_error').position().top
+        });
+        jQuery("#ups_small_hand_fee_mark_up").css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function en_ups_small_air_hazardous_material_fee_validation() {
+
+    var air_hazardous_fee = jQuery('#ups_small_air_hazardous_fee').val();
+    var air_hazardous_fee_regex = /^([0-9]{1,4}%?)$|(\.[0-9]{1,2})%?$/;
+    var numeric_values_regex = /^[0-9]{1,7}$/;
+    if (air_hazardous_fee != '' && numeric_values_regex.test(air_hazardous_fee)) {
+        return true;
+    } else if (air_hazardous_fee != '' && (!air_hazardous_fee_regex.test(air_hazardous_fee) || airHazardousValidNumber(air_hazardous_fee))) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_air_hazardous_fee_error"><p><strong>Error! </strong>Air hazardous material fee format should be 100.20 or 10%.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_air_hazardous_fee_error').position().top
+        });
+        jQuery("#ups_small_air_hazardous_fee").css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function airHazardousValidNumber(air_hazardous_fee) {
+
+    if (air_hazardous_fee.indexOf("-") == -1) {
+        return false
+    } else {
+        return true;
+    }
+}
+
+function en_ups_small_ground_hazardous_material_fee_validation() {
+
+    var ground_hazardous_fee = jQuery('#ups_small_ground_hazardous_fee').val();
+    var ground_hazardous_regex = /^([0-9]{1,4}%?)$|(\.[0-9]{1,2})%?$/;
+    var numeric_values_regex = /^[0-9]{1,7}$/;
+    if (ground_hazardous_fee != '' && numeric_values_regex.test(ground_hazardous_fee)) {
+        return true;
+    } else if (ground_hazardous_fee != '' && (!ground_hazardous_regex.test(ground_hazardous_fee) || airHazardousValidNumber(ground_hazardous_fee))) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_small_ground_hazardous_fee_error"><p><strong>Error! </strong>Ground hazardous material fee format should be 100.20 or 10%.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_small_ground_hazardous_fee_error').position().top
+        });
+        jQuery("#ups_small_ground_hazardous_fee").css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+function groundTransitValidNumber(ground_hazardous_fee) {
+
+    if (ground_hazardous_fee.indexOf("-") == -1) {
+        return false
+    } else {
+        return true;
+    }
+}
+
+function en_ups_small_ground_transit_validation() {
+    var ground_transit_value = jQuery('#restrict_days_transit_package_ups_small').val();
+    var ground_transit_regex = /^[0-9]{1,2}$/;
+    if (ground_transit_value != '' && !ground_transit_regex.test(ground_transit_value)) {
+        jQuery("#mainform .ups_small_quote_section").prepend('<div id="message" class="error inline ups_ground_transit_error"><p><strong>Error! </strong>Maximum 2 numeric characters are allowed for transit day field.</p></div>');
+        jQuery('html, body').animate({
+            'scrollTop': jQuery('.ups_ground_transit_error').position().top
+        });
+        jQuery("#restrict_days_transit_package_ups_small").css({'border-color': '#e81123'});
+        return false;
+    } else {
+        return true;
+    }
+}
+
+
+/*
+ * Validate Input If Empty or Invalid
+ */
+
+function validateInput(form_id) {
+    var has_err = true;
+    jQuery(form_id + " input[type='text']").each(function () {
+        var input = jQuery(this).val();
+        var response = validateString(input);
+        var errorText = jQuery(this).attr('title');
+        var optional = jQuery(this).data('optional');
+
+        var errorElement = jQuery(this).parent().find('.err');
+        jQuery(errorElement).html('');
+
+        optional = (optional === undefined) ? 0 : 1;
+        errorText = (errorText != undefined) ? errorText : '';
+
+        if ((optional == 0) && (response == false || response == 'empty')) {
+            errorText = (response == 'empty') ? errorText + ' is required.' : 'Invalid input.';
+            jQuery(errorElement).html(errorText);
+        }
+
+        has_err = (response != true && optional == 0) ? false : has_err;
+    });
+    return has_err;
+}
+
+/*
+ * Check Input Value Is Not String
+ */
+
+function isValidNumber(value, noNegative) {
+    if (typeof (noNegative) === 'undefined')
+        noNegative = false;
+    var isValidNumber = false;
+    var validNumber = (noNegative == true) ? parseFloat(value) >= 0 : true;
+    if ((value == parseInt(value) || value == parseFloat(value)) && (validNumber)) {
+        if (value.indexOf(".") >= 0) {
+            var n = value.split(".");
+
+            if (n[n.length - 1].length <= 4) {
+                isValidNumber = true;
+            } else {
+                isValidNumber = 'decimal_point_err';
+            }
+        } else {
+            isValidNumber = true;
+        }
+    }
+    return isValidNumber;
+}
+
+/*
+ * Validate Input String
+ */
+
+function validateString(string) {
+    if (string == '') {
+        return 'empty';
+    } else {
+        return true;
+    }
+}
+
+/**
+ * Read a page's GET URL variables and return them as an associative array.
+ */
+function get_url_vars_ups_freight() {
+    var vars = [], hash;
+    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+    for (var i = 0; i < hashes.length; i++) {
+        hash = hashes[i].split('=');
+        vars.push(hash[0]);
+        vars[hash[0]] = hash[1];
+    }
+    return vars;
+}
+
+// Update plan
+if (typeof en_update_plan != 'function') {
+    function en_update_plan(input) {
+        let action = jQuery(input).attr('data-action');
+        jQuery.ajax({
+            type: "POST",
+            url: ajaxurl,
+            data: { action: action, wp_nonce: eniture_ups_small_admin_script.nonce },
+            success: function (data_response) {
+                window.location.reload(true);
+            }
+        });
+    }
+}
+
+/**
+ * Hide and show test connection fields based on API selection
+ */
+ function ups_connection_section_api_endpoint() {
+    jQuery("#ups_new_api_username").data('optional', '1');
+    jQuery("#ups_new_api_password").data('optional', '1');
+     
+    let api_endpoint = jQuery('#ups_api_endpoint').val();
+    if(api_endpoint == 'ups_old_api'){
+        jQuery('.ups_new_api_field').closest('tr').hide();
+        jQuery('.ups_old_api_field').closest('tr').show();
+
+        jQuery("#ups_client_id").data('optional', '1');
+        jQuery("#ups_client_secret").data('optional', '1');
+
+        jQuery("#ups_small_username").removeData('optional');
+        jQuery("#ups_small_password").removeData('optional');
+        jQuery("#ups_small_api_access_key").removeData('optional');
+
+    }else{
+        jQuery('.ups_old_api_field').closest('tr').hide();
+        jQuery('.ups_new_api_field').closest('tr').show();
+
+        jQuery("#ups_small_username").data('optional', '1');
+        jQuery("#ups_small_password").data('optional', '1');
+        jQuery("#ups_small_api_access_key").data('optional', '1');
+
+        jQuery("#ups_client_id").removeData('optional');
+        jQuery("#ups_client_secret").removeData('optional');
+    }
+
+}
+
+if (typeof ups_connection_section_api_endpoint == 'function') {
+    ups_connection_section_api_endpoint();
+}
+
+function toggle_ups_delivery_estimate_label_fields ()
+{   
+    const estimatedDeliveryOption = jQuery('input[name=ups_small_delivery_estimates]:checked').val();
+    
+    if (estimatedDeliveryOption === 'delivery_days') {
+        jQuery('.estimated_delivery_days_format_tr').show();
+        jQuery('.estimated_delivery_date_format_tr').hide();
+    } else if (estimatedDeliveryOption === 'delivery_date') {
+        jQuery('.estimated_delivery_days_format_tr').hide();
+        jQuery('.estimated_delivery_date_format_tr').show();
+    } else {
+        jQuery('.estimated_delivery_days_format_tr').hide();
+        jQuery('.estimated_delivery_date_format_tr').hide();
+    }
+}
+
+if (typeof setNestedMaterialsUI != 'function') {
+    function setNestedMaterialsUI() {
+        const nestedMaterials = jQuery('._nestedMaterials');
+        const productMarkups = jQuery('._en_product_markup');
+        
+        if (productMarkups?.length) {
+            for (const markup of productMarkups) {
+                jQuery(markup).attr('maxlength', '7');
+
+                jQuery(markup).keypress(function (e) {
+                    if (!String.fromCharCode(e.keyCode).match(/^[0-9.%-]+$/))
+                        return false;
+                });
+            }
+        }
+
+        if (nestedMaterials?.length) {
+            for (let elem of nestedMaterials) {
+                const className = elem.className;
+
+                if (className?.includes('_nestedMaterials')) {
+                    const checked = jQuery(elem).prop('checked'),
+                        name = jQuery(elem).attr('name'),
+                        id = name?.split('_nestedMaterials')[1];
+                    setNestMatDisplay(id, checked);
+                }
+            }
+        }
+    }
+}
+
+if (typeof setNestMatDisplay != 'function') {
+    function setNestMatDisplay(id, checked) {
+        jQuery(`input[name="_nestedPercentage${id}"]`).attr('min', '0');
+        jQuery(`input[name="_nestedPercentage${id}"]`).attr('max', '100');
+        jQuery(`input[name="_nestedPercentage${id}"]`).attr('maxlength', '3');
+        jQuery(`input[name="_maxNestedItems${id}"]`).attr('min', '0');
+        jQuery(`input[name="_maxNestedItems${id}"]`).attr('max', '100');
+        jQuery(`input[name="_maxNestedItems${id}"]`).attr('maxlength', '3');
+
+        jQuery(`input[name="_nestedPercentage${id}"], input[name="_maxNestedItems${id}"]`).keypress(function (e) {
+            if (!String.fromCharCode(e.keyCode).match(/^[0-9]+$/))
+                return false;
+        });
+
+        jQuery(`input[name="_nestedPercentage${id}"]`).closest('p').css('display', checked ? '' : 'none');
+        jQuery(`select[name="_nestedDimension${id}"]`).closest('p').css('display', checked ? '' : 'none');
+        jQuery(`input[name="_maxNestedItems${id}"]`).closest('p').css('display', checked ? '' : 'none');
+        jQuery(`select[name="_nestedStakingProperty${id}"]`).closest('p').css('display', checked ? '' : 'none');
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/js/wickedpicker.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/js/wickedpicker.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/js/wickedpicker.js	(revision 3237693)
@@ -0,0 +1,660 @@
+/**
+ * wickedpicker v0.4.1 - A simple jQuery timepicker.
+ * Copyright (c) 2015-2016 Eric Gagnon - http://github.com/wickedRidge/wickedpicker
+ * License: MIT
+ */
+(function ($, window, document) {
+
+    "use strict";
+
+    if (typeof String.prototype.endsWith != 'function') {
+        /*
+         * Checks if this string end ends with another string
+         *
+         * @param {string} the string to be checked
+         *
+         * @return {bool}
+         */
+        String.prototype.endsWith = function (string) {
+            return string.length > 0 && this.substring(this.length - string.length, this.length) === string;
+        }
+    }
+
+    /*
+     * Returns if the user agent is mobile
+     *
+     * @return {bool}
+     */
+    var isMobile = function () {
+        return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
+    };
+
+    var today = new Date();
+
+    var pluginName = "wickedpicker",
+        defaults = {
+            now: today.getHours() + ':' + today.getMinutes(),
+            twentyFour: false,
+            upArrow: 'wickedpicker__controls__control-up',
+            downArrow: 'wickedpicker__controls__control-down',
+            close: 'wickedpicker__close',
+            hoverState: 'hover-state',
+            title: 'Timepicker',
+            showSeconds: false,
+            timeSeparator: ' : ',
+            secondsInterval: 1,
+            minutesInterval: 1,
+            beforeShow: null,
+            afterShow: null,
+            show: null,
+            clearable: false,
+            closeOnClickOutside: true,
+            onClickOutside: function () {
+            },
+        };
+
+    /*
+     * @param {object} The input object the timepicker is attached to.
+     * @param {object} The object containing options
+     */
+    function Wickedpicker(element, options) {
+
+        this.element = $(element);
+        this.options = $.extend({}, defaults, options);
+
+        this.element.addClass('hasWickedpicker');
+        this.element.attr('onkeypress', 'return false;');
+        this.element.attr('aria-showingpicker', 'false');
+        this.createPicker();
+        this.timepicker = $('.wickedpicker');
+        this.up = $('.' + this.options.upArrow.split(/\s+/).join('.'));
+        this.down = $('.' + this.options.downArrow.split(/\s+/).join('.'));
+        this.separator = $('.wickedpicker__controls__control--separator');
+        this.hoursElem = $('.wickedpicker__controls__control--hours');
+        this.minutesElem = $('.wickedpicker__controls__control--minutes');
+        this.secondsElem = $('.wickedpicker__controls__control--seconds');
+        this.meridiemElem = $('.wickedpicker__controls__control--meridiem');
+        this.close = $('.' + this.options.close.split(/\s+/).join('.'));
+
+        //Create a new Date object based on the default or passing in now value
+        var time = this.timeArrayFromString(this.options.now);
+        if (this.options.now.length === 0) {
+            // this.options.now = new Date(today.getFullYear(), today.getMonth(), today.getDate(), time[0], time[1], time[2]);
+            this.selectedHour = '';
+            this.selectedMin = '';
+            this.selectedSec = '';
+            this.selectedMeridiem = '';
+            this.setHoverState();
+            this.attach(element);
+            this.setText(element);
+        } else {
+            this.options.now = new Date(today.getFullYear(), today.getMonth(), today.getDate(), time[0], time[1], time[2]);
+            this.selectedHour = this.parseHours(this.options.now.getHours());
+            this.selectedMin = this.parseSecMin(this.options.now.getMinutes());
+            this.selectedSec = this.parseSecMin(this.options.now.getSeconds());
+            this.selectedMeridiem = this.parseMeridiem(this.options.now.getHours());
+            this.setHoverState();
+            this.attach(element);
+            this.setText(element);
+        }
+    }
+
+    $.extend(Wickedpicker.prototype, {
+
+        /*
+         * Show given input's timepicker
+         *
+         * @param {object} The input being clicked
+         */
+        showPicker: function (element) {
+            //If there is a beforeShow function, then call it with the input calling the timepicker and the
+            // timepicker itself
+            if (typeof this.options.beforeShow === 'function') {
+                this.options.beforeShow(element, this.timepicker);
+            }
+            var timepickerPos = $(element).offset();
+
+            $(element).attr({'aria-showingpicker': 'true', 'tabindex': -1});
+
+            // Ticket: 3975
+            this.setText(element.outerHTML);
+            this.showHideMeridiemControl();
+
+            if (this.getText(element.outerHTML) !== this.getTime()) {
+
+                // Check meridiem
+                var text = this.getText(element);
+
+                var re = /\s[ap]m$/i;
+
+                var meridiem = re.test(text) ? text.substr(-2, 2) : null;
+
+                var inputTime = text.split(' ');
+
+                var newTime = {};
+                if (text === '') {
+                    newTime.hours = today.getHours();
+                    newTime.minutes = today.getMinutes();
+                    newTime.meridiem = this.parseMeridiem(today.getHours());
+                    if (this.options.showSeconds) {
+                        newTime.seconds = '';
+                    }
+                } else {
+                    newTime.hours = inputTime[0];
+                    newTime.minutes = inputTime[2];
+                    newTime.meridiem = (meridiem === 'PM' || meridiem === 'AM') ? meridiem : 'PM';
+
+                    if (this.options.showSeconds) {
+                        newTime.seconds = inputTime[3];
+                    }
+                }
+                this.setTime(newTime);
+            }
+            this.timepicker.css({
+                'z-index': this.element.css('z-index') + 1,
+                position: 'absolute',
+                left: timepickerPos.left,
+                top: timepickerPos.top + $(element)[0].offsetHeight
+            }).show();
+            //If there is a show function, then call it with the input calling the timepicker and the
+            // timepicker itself
+            if (typeof this.options.show === 'function') {
+                this.options.show(element, this.timepicker);
+            }
+
+            this.handleTimeAdjustments(element);
+        },
+
+        /*
+         * Hides the timepicker that is currently shown if it is not part of the timepicker
+         *
+         * @param {Object} The DOM object being clicked on the page
+         *
+         * BeinnLora: added trigger function to call on closing/hiding timepicker.
+         */
+        hideTimepicker: function (element) {
+            this.timepicker.hide();
+            if (typeof this.options.afterShow === 'function') {
+                this.options.afterShow(element, this.timepicker);
+            }
+            var pickerHidden = {
+                start: function () {
+                    var setShowPickerFalse = $.Deferred();
+                    $('[aria-showingpicker="true"]').attr('aria-showingpicker', 'false');
+                    return setShowPickerFalse.promise();
+                }
+            };
+
+            function setTabIndex(index) {
+                setTimeout(function () {
+                    $('[aria-showingpicker="false"]').attr('tabindex', index);
+                }, 400);
+            }
+
+            pickerHidden.start().then(setTabIndex(0));
+        },
+
+        /*
+         * Create a new timepicker. A single timepicker per page
+         */
+        createPicker: function () {
+
+            if ($('.wickedpicker').length === 0) {
+                var picker = '<div class="wickedpicker"><p class="wickedpicker__title">' + this.options.title + '<span class="wickedpicker__close"></span></p><ul class="wickedpicker__controls"><li class="wickedpicker__controls__control"><span class="' + this.options.upArrow + '"></span><span class="wickedpicker__controls__control--hours" tabindex="-1">00</span><span class="' + this.options.downArrow + '"></span></li><li class="wickedpicker__controls__control--separator"><span class="wickedpicker__controls__control--separator-inner">:</span></li><li class="wickedpicker__controls__control"><span class="' + this.options.upArrow + '"></span><span class="wickedpicker__controls__control--minutes" tabindex="-1">00</span><span class="' + this.options.downArrow + '"></span></li>';
+                if (this.options.showSeconds) {
+                    picker += '<li class="wickedpicker__controls__control--separator"><span class="wickedpicker__controls__control--separator-inner">:</span></li><li class="wickedpicker__controls__control"><span class="' + this.options.upArrow + '"></span><span class="wickedpicker__controls__control--seconds" tabindex="-1">00</span><span class="' + this.options.downArrow + '"></span> </li>';
+                }
+                picker += '<li class="wickedpicker__controls__control"><span class="' + this.options.upArrow + '"></span><span class="wickedpicker__controls__control--meridiem" tabindex="-1">AM</span><span class="' + this.options.downArrow + '"></span></li></ul></div>';
+                $('body').append(picker);
+                this.attachKeyboardEvents();
+            }
+        },
+
+        /*
+         * Hides the meridiem control if this timepicker is a 24 hour clock
+         */
+        showHideMeridiemControl: function () {
+            if (this.options.twentyFour === false) {
+                $(this.meridiemElem).parent().show();
+            } else {
+                $(this.meridiemElem).parent().hide();
+            }
+        },
+
+        /*
+         * Hides the seconds control if this timepicker has showSeconds set to true
+         */
+        showHideSecondsControl: function () {
+            if (this.options.showSeconds) {
+                $(this.secondsElem).parent().show();
+            } else {
+                $(this.secondsElem).parent().hide();
+            }
+        },
+
+        /*
+         * Bind the click events to the input
+         *
+         * @param {object} The input element
+         */
+        attach: function (element) {
+            var self = this;
+            if (this.options.clearable) {
+                self.makePickerInputClearable(element);
+            }
+
+            $(element).attr('tabindex', 0);
+            $(element).on('click focus', function (event) {
+
+                //Prevent multiple firings
+                if ($(self.timepicker).is(':hidden')) {
+                    self.showPicker($(this));
+                    window.lastTimePickerControl = $(this); //Put the reference on this timepicker into global scope for unsing that in afterShow function
+                    $(self.hoursElem).focus();
+                }
+            });
+
+
+            //Handle click events for closing Wickedpicker
+            var clickHandler = function (event) { //TODO: Fix double firing
+                //Only fire the hide event when you have to
+                if ($(self.timepicker).is(':visible')) {
+                    //Clicking the X
+                    if ($(event.target).is(self.close)) {
+                        self.hideTimepicker(window.lastTimePickerControl);
+                    } else if ($(event.target).closest(self.timepicker).length || $(event.target).closest($('.hasWickedpicker')).length) { //Clicking the Wickedpicker or one of it's inputs
+                        event.stopPropagation();
+                    } else {   //Everything else
+                        if (typeof self.options.onClickOutside === 'function') {
+                            self.options.onClickOutside();
+                        } else {
+                            console.warn("Type of onClickOutside must be a function");
+                        }
+
+                        if (!self.options.closeOnClickOutside) {
+                            return;
+                        }
+                        self.hideTimepicker(window.lastTimePickerControl);
+                    }
+                    window.lastTimePickerControl = null;
+                }
+            };
+            $(document).off('click', clickHandler).on('click', clickHandler);
+        },
+
+        /**
+         * Added keyboard functionality to improve usabil
+         */
+        attachKeyboardEvents: function () {
+            $(document).on('keydown', $.proxy(function (event) {
+                switch (event.keyCode) {
+                    case 9:
+                        if (event.target.className !== 'hasWickedpicker') {
+                            $(this.close).trigger('click');
+                        }
+                        break;
+                    case 27:
+                        $(this.close).trigger('click');
+                        break;
+                    case 37: //Left arrow
+                        if (event.target.className !== this.hoursElem[0].className) {
+                            $(event.target).parent().prevAll('li').not(this.separator.selector).first().children()[1].focus();
+                        } else {
+                            $(event.target).parent().siblings(':last').children()[1].focus();
+                        }
+                        break;
+                    case 39: //Right arrow
+                        if (event.target.className !== this.meridiemElem[0].className) {
+                            $(event.target).parent().nextAll('li').not(this.separator.selector).first().children()[1].focus();
+                        } else {
+                            $(event.target).parent().siblings(':first').children()[1].focus();
+                        }
+                        break;
+                    case 38: //Up arrow
+                        $(':focus').prev().trigger('click');
+                        break;
+                    case 40: //Down arrow
+                        $(':focus').next().trigger('click');
+                        break;
+                    default:
+                        break;
+                }
+            }, this));
+        },
+
+        /*
+         * Set the time on the timepicker
+         *
+         * @param {object} The date being set
+         */
+        setTime: function (time) {
+            this.setHours(time.hours);
+            this.setMinutes(time.minutes);
+            this.setMeridiem(time.meridiem);
+            if (this.options.showSeconds) {
+                this.setSeconds(time.seconds);
+            }
+        },
+
+        /*
+         * Get the time from the timepicker
+         */
+        getTime: function () {
+            return [this.formatTime(this.getHours(), this.getMinutes(), this.getMeridiem(), this.getSeconds())];
+        },
+
+        /*
+         * Set the timpicker's hour(s) value
+         *
+         * @param {string} hours
+         */
+        setHours: function (hours) {
+            var hour = new Date();
+            hour.setHours(hours);
+            var hoursText = this.parseHours(hour.getHours());
+            this.hoursElem.text(hoursText);
+            this.selectedHour = hoursText;
+        },
+
+        /*
+         * Get the hour(s) value from the timepicker
+         *
+         * @return {integer}
+         */
+        getHours: function () {
+            var hours = new Date();
+            hours.setHours(this.hoursElem.text());
+            return hours.getHours();
+        },
+
+        /*
+         * Returns the correct hour value based on the type of clock, 12 or 24 hour
+         *
+         * @param {integer} The hours value before parsing
+         *
+         * @return {string|integer}
+         */
+        parseHours: function (hours) {
+            return (this.options.twentyFour === false) ? ((hours + 11) % 12) + 1 : (hours < 10) ? '0' + hours : hours;
+        },
+
+        /*
+         * Sets the timpicker's minutes value
+         *
+         * @param {string} minutes
+         */
+        setMinutes: function (minutes) {
+            var minute = new Date();
+            minute.setMinutes(minutes);
+            var minutesText = minute.getMinutes();
+            var min = this.parseSecMin(minutesText);
+            this.minutesElem.text(min);
+            this.selectedMin = min;
+        },
+
+        /*
+         * Get the minutes value from the timepicker
+         *
+         * @return {integer}
+         */
+        getMinutes: function () {
+            var minutes = new Date();
+            minutes.setMinutes(this.minutesElem.text());
+            return minutes.getMinutes();
+        },
+
+
+        /*
+         * Return a human-readable minutes/seconds value
+         *
+         * @param {string} value seconds or minutes
+         *
+         * @return {string|integer}
+         */
+        parseSecMin: function (value) {
+            return ((value < 10) ? '0' : '') + value;
+        },
+
+        /*
+         * Set the timepicker's meridiem value, AM or PM
+         *
+         * @param {string} The new meridiem
+         */
+        setMeridiem: function (inputMeridiem) {
+            var newMeridiem = '';
+            if (inputMeridiem === undefined) {
+                var meridiem = this.getMeridiem();
+                newMeridiem = (meridiem === 'PM') ? 'AM' : 'PM';
+            } else {
+                newMeridiem = inputMeridiem;
+            }
+            this.meridiemElem.text(newMeridiem);
+            this.selectedMeridiem = newMeridiem;
+        },
+
+        /*
+         * Get the timepicker's meridiem value, AM or PM
+         *
+         * @return {string}
+         */
+        getMeridiem: function () {
+            return this.meridiemElem.text();
+        },
+
+        /*
+         * Set the timepicker's seconds value
+         *
+         * @param {string} seconds
+         */
+        setSeconds: function (seconds) {
+            var second = new Date();
+            second.setSeconds(seconds);
+            var secondsText = second.getSeconds();
+            var sec = this.parseSecMin(secondsText);
+            this.secondsElem.text(sec);
+            this.selectedSec = sec;
+        },
+
+        /*
+         * Get the timepicker's seconds value
+         *
+         * return {string}
+         */
+        getSeconds: function () {
+            var seconds = new Date();
+            seconds.setSeconds(this.secondsElem.text());
+            return seconds.getSeconds();
+        },
+
+        /*
+         * Get the correct meridiem based on the hours given
+         *
+         * @param {string|integer} hours
+         *
+         * @return {string}
+         */
+        parseMeridiem: function (hours) {
+            return (hours > 11) ? 'PM' : 'AM';
+        },
+
+        /*
+         * Handles time incrementing and decrementing and passes
+         * the operator, '+' or '-', the input to be set after the change
+         * and the current arrow clicked, to decipher if hours, ninutes, or meridiem.
+         *
+         * @param {object} The input element
+         */
+        handleTimeAdjustments: function (element) {
+
+            var timeOut = 0;
+            //Click and click and hold timepicker incrementer and decrementer
+            $(this.up).add(this.down).off('mousedown click touchstart').on('mousedown click', {
+                'Wickedpicker': this,
+                'input': element
+            }, function (event) {
+                if (event.which != 1) return false;
+                var operator = (this.className.indexOf('up') > -1) ? '+' : '-';
+                var passedData = event.data;
+                if (event.type == 'mousedown') {
+                    timeOut = setInterval($.proxy(function (args) {
+                        args.Wickedpicker.changeValue(operator, args.input, this);
+                    }, this, {'Wickedpicker': passedData.Wickedpicker, 'input': passedData.input}), 200);
+                } else {
+                    passedData.Wickedpicker.changeValue(operator, passedData.input, this);
+                }
+            }).bind('mouseup touchend', function () {
+                clearInterval(timeOut);
+            });
+        },
+
+        /*
+         * Change the timepicker's time base on what is clicked
+         *
+         * @param {string} The + or - operator
+         * @param {object} The timepicker's associated input to be set post change
+         * @param {object} The DOM arrow object clicked, determines if it is hours,
+         * minutes, or meridiem base on the operator and its siblings
+         */
+        changeValue: function (operator, input, clicked) {
+            var target = (operator === '+') ? clicked.nextSibling : clicked.previousSibling;
+            var targetClass = $(target).attr('class');
+            if (targetClass.endsWith('hours')) {
+                this.setHours(eval(this.getHours() + operator + 1));
+            } else if (targetClass.endsWith('minutes')) {
+                this.setMinutes(eval(this.getMinutes() + operator + this.options.minutesInterval));
+            } else if (targetClass.endsWith('seconds')) {
+                this.setSeconds(eval(this.getSeconds() + operator + this.options.secondsInterval));
+            } else {
+                this.setMeridiem();
+            }
+            this.setText(input);
+        },
+
+
+        /*
+         * Sets the give input's text to the current timepicker's time
+         *
+         * @param {object} The input element
+         */
+        setText: function (input) {
+
+            $(input).val(this.formatTime(this.selectedHour, this.selectedMin, this.selectedMeridiem, this.selectedSec)).change();
+        },
+
+        /*
+         * Get the given input's value
+         *
+         * @param {object} The input element
+         *
+         * @return {string}
+         */
+        getText: function (input) {
+            return $(input).val();
+        },
+
+        /*
+         * Returns the correct time format as a string
+         *
+         * @param {string} hour
+         * @param {string} minutes
+         * @param {string} meridiem
+         *
+         * @return {string}
+         */
+        formatTime: function (hour, min, meridiem, seconds) {
+            var formattedTime = '';
+
+            if (hour && min) {
+                formattedTime += hour + this.options.timeSeparator + min;
+            }
+
+            if (this.options.showSeconds) {
+                formattedTime += this.options.timeSeparator + seconds;
+            }
+
+            if (this.options.twentyFour === false && meridiem != '') {
+                formattedTime += ' ' + meridiem;
+            }
+
+            return formattedTime;
+        },
+
+        /**
+         *  Apply the hover class to the arrows and close icon fonts
+         */
+        setHoverState: function () {
+            var self = this;
+
+            if (!isMobile()) {
+                $(this.up).add(this.down).add(this.close).hover(function () {
+                    $(this).toggleClass(self.options.hoverState);
+                });
+            }
+        },
+
+        /**
+         * Wrapping the given input field with the clearable container
+         * , add a span that will contain the x, and bind the clear
+         * input event to the span
+         *
+         * @param input
+         */
+        makePickerInputClearable: function (input) {
+
+            $(input).wrap('<div class="clearable-picker"></div>').after('<span data-clear-picker>&times;</span>');
+
+            //When the x is clicked, clear its sibling input field
+            $('[data-clear-picker]').on('click', function (event) {
+                $(this).siblings('.hasWickedpicker').val('');
+            });
+        },
+
+        /**
+         * Convert the options time string format
+         * to an array
+         *
+         * returns => [hours, minutes, seconds]
+         *
+         * @param stringTime
+         * @returns {*}
+         */
+        timeArrayFromString: function (stringTime) {
+            if (stringTime.length) {
+                var time = stringTime.split(':');
+                time[2] = (time.length < 3) ? '00' : time[2];
+                return time;
+            }
+            return false;
+        },
+
+        //public functions
+        /*
+         * Returns the requested input element's value
+         */
+        _time: function () {
+            var inputValue = $(this.element).val();
+            return (inputValue === '') ? this.formatTime(this.selectedHour, this.selectedMin, this.selectedMeridiem, this.selectedSec) : inputValue;
+        },
+        _hide: function () {
+            this.hideTimepicker(this.element);
+        }
+    });
+
+    //optional index if multiple inputs share the same class
+    $.fn[pluginName] = function (options, index) {
+        if (!$.isFunction(Wickedpicker.prototype['_' + options])) {
+            return this.each(function () {
+                if (!$.data(this, "plugin_" + pluginName)) {
+                    $.data(this, "plugin_" + pluginName, new Wickedpicker(this, options));
+                }
+            });
+        } else if ($(this).hasClass('hasWickedpicker')) {
+            if (index !== undefined) {
+                return $.data($(this)[index], 'plugin_' + pluginName)['_' + options]();
+            } else {
+                return $.data($(this)[0], 'plugin_' + pluginName)['_' + options]();
+            }
+        }
+    };
+
+})(jQuery, window, document);
Index: /small-package-quotes-ups-edition/tags/4.5.17/lib/package-calculate-size.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/lib/package-calculate-size.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/lib/package-calculate-size.php	(revision 3237693)
@@ -0,0 +1,139 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of newPHPClass
+ *
+ * @author alignpx
+ */
+    if( !class_exists( 'Eniture_Plugin_Calculate_Size' ) ){
+        
+        class Eniture_Plugin_Calculate_Size {
+
+            /*extranal lib,classes*/
+            protected $virtualBoxObj;
+            protected $db;
+            protected $shop;
+
+
+            /*function controls, even logging*/
+            public $newRequest = true;
+            public $defaultMaxWeightSmall = '150';
+
+
+            /*extranal lib,classes*/
+            public $lineItems;
+            public $boxItems;
+            public $bins = array();
+            public $bin3D = array();
+
+            public $shipmentGroups = array();
+            public $requestKey;
+            public $totalCartWeight;
+            public $totalCartVolume;
+            public $packagSize = array();
+            public $numOfPackgs = array();
+
+            public $lengthSum;
+            public $widthSum;
+            public $heightSum;
+            public $lengthArr;
+            public $widthArr;
+            public $heightArr;
+
+            function set_line_items( $line_item ) {
+                $this->lineItems = $line_item;
+                return $this->wwe_smpkg_box_items();
+            }
+
+           function wwe_smpkg_box_items(){
+
+                if(in_array($this->requestKey, $this->shipmentGroups))
+                    return;// do nothing if data is already set
+
+                $this->shipmentGroups[] = $this->requestKey;
+                foreach ($this->lineItems as $key => $sItem) {
+
+                    /*whole shipment params*/
+                    $boxingParams = isset($sItem['additional_settings']['boxing'])?$sItem['additional_settings']['boxing']:array();
+                    $this->totalCartWeight = $this->totalCartWeight+($sItem['productQty'] * $sItem['productWeight']);
+                    $this->lineItems[$key]['volume'] = $sItem['productQty']*$sItem['productLength']*$sItem['productWidth']*$sItem['productHeight'];
+                    $this->totalCartVolume = $this->totalCartVolume+$this->lineItems[$key]['volume'];
+
+                    /*item params shipment level*/
+                    $this->lengthSum = $this->lengthSum + ($sItem['productQty'] * $sItem['productLength']);
+                    $this->widthSum = $this->widthSum + ($sItem['productQty'] * $sItem['productWidth']);
+                    $this->heightSum = $this->heightSum + ($sItem['productQty'] * $sItem['productHeight']);
+                    $this->lengthArr[] = $sItem['productLength'];
+                    $this->widthArr[] = $sItem['productWidth'];
+                    $this->heightArr[] = $sItem['productHeight'];
+
+                    /*line item params*/
+                    $this->boxItems[$key]['w'] = $sItem['productWidth']; 
+                    $this->boxItems[$key]['h'] = $sItem['productHeight'];
+                    $this->boxItems[$key]['d'] = $sItem['productLength'];  
+                    $this->boxItems[$key]['q'] = $sItem['productQty'];
+                    $this->boxItems[$key]['vr'] = isset($boxingParams['allow_v_rotate'])?$boxingParams['allow_v_rotate']:'';
+                    $this->boxItems[$key]['wg'] = $sItem['productWeight'];
+                    $this->boxItems[$key]['id'] = $sItem['productId'];
+                }
+
+
+                $this->packagSize = $this->calculatePkgSize($this->lengthSum, $this->lengthArr, $this->widthSum, $this->widthArr, $this->heightSum, $this->heightArr);
+                $this->newRequest = false;
+
+                return $this->packagSize;
+
+           }
+            public function calculatePkgSize($calLength, $cartLength, $calwidth, $cartWidth, $calheight, $cartHeight) {
+
+                // shipment level dimensional weight 
+                $iteration = array();
+                $iteration[1] = ceil($calLength) * ceil(max($cartWidth)) * ceil(max($cartHeight));
+                $iteration[2] = ceil(max($cartLength)) * ceil(max($cartWidth)) * ceil($calheight);
+                $iteration[3] = ceil(max($cartLength)) * ceil($calwidth) * ceil(max($cartHeight));
+                // Get minimum dimension
+
+                $dimensions = min($iteration);
+                $min_iteration = array_keys($iteration, $dimensions);
+                $min_iteration = $min_iteration[0];
+
+                if ($min_iteration == 1) {
+                    $box_lenght = ceil(max($cartLength));
+                    $box_width = ceil(max($cartWidth));
+                    $box_height = ceil($calheight);
+                }
+                if ($min_iteration == 2) {
+                    $box_lenght = ceil($calLength);
+                    $box_width = ceil(max($cartWidth));
+                    $box_height = ceil(max($cartHeight));
+                }
+                if ($min_iteration == 3) {
+                    $box_lenght = ceil(max($cartLength));
+                    $box_width = ceil($calwidth);
+                    $box_height = ceil(max($cartHeight));
+                }
+
+
+                $diminsion_size = array($box_lenght, $box_width, $box_height);
+                rsort($diminsion_size);
+                $response['size'] = $diminsion_size[0] + ((2 * $diminsion_size[1]) + (2 * $diminsion_size[2]));
+                $response['diminsion_size'] = $diminsion_size;
+                
+                if( $this->lengthSum > 108 || $this->widthSum > 108 || $this->heightSum > 108 ){
+                    $response['ltl_product'] = 'LTL';
+                }
+
+                return $response;
+            }
+        }
+    }
Index: /small-package-quotes-ups-edition/tags/4.5.17/license.txt
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/license.txt	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/license.txt	(revision 3237693)
@@ -0,0 +1,86 @@
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 
+ The precise terms and conditions for copying, distribution and modification follow.
+ 
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 
+    b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 
+    c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+    b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+    c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
Index: /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-script.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-script.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-script.js	(revision 3237693)
@@ -0,0 +1,180 @@
+function en_jtv_create_dom(json, en_jtv_show_generate_button = false) {
+    function impl(json, parent) {
+        var en_jtv_append_element = (parent, tag) => {
+            var e = document.createElement(tag);
+            parent.appendChild(e);
+            return e;
+        };
+
+        var en_jtv_create_element = (tag, en_jtv_class_name, en_jtv_text_content) => {
+            var e = document.createElement(tag);
+            e.className = en_jtv_class_name;
+            if (en_jtv_text_content)
+                e.textContent = en_jtv_text_content;
+            return e;
+        };
+
+        var en_jtv_append_text = (element, text) => {
+            element.appendChild(document.createTextNode(text));
+        }
+
+        var en_jtv_json_escaped = /\\(?:"|\\|b|f|n|r|t|u[0-1a-fA-F]{4})/;
+        switch (typeof (json)) {
+            case 'boolean':
+            case 'number':
+                var str = JSON.stringify(json);
+                var e = en_jtv_create_element('span', 'en_jtv_numeric_value', str);
+                e.dataset.valueData = str;
+                parent.appendChild(e);
+                break;
+            case 'string':
+                var str = JSON.stringify(json);
+                var str = str.substring(1, str.length - 1);
+                var inner = en_jtv_create_element('span', 'en_jtv_string_value', '"' + str + '"');
+                inner.dataset.valueData = str;
+                if (en_jtv_json_escaped.test(str)) {
+                    var outer = document.createElement('span');
+                    outer.appendChild(inner);
+                    parent.appendChild(outer);
+                } else {
+                    parent.appendChild(inner);
+                }
+                break;
+            case 'object':
+                if (json === null) {
+                    var e = en_jtv_create_element('span', 'en_jtv_show_null_value', 'null');
+                    e.dataset.valueData = 'null';
+                    parent.appendChild(e);
+                    break;
+                }
+
+            function en_jtv_show_add_copy_button(element, json) {
+                const button = en_jtv_append_element(element, 'div');
+                button.className = 'en_jtv_copy';
+                button.addEventListener('click', (event) => {
+                    const onFail = (e) => {
+                        button.classList.add('en_jtv_not_copied');
+                        void button.offsetWidth; // triggers animation transitions
+                        button.classList.remove('en_jtv_not_copied');
+                        console.log('Failed to copy to clipboard: ', e);
+                    };
+                    try {
+                        navigator.clipboard.writeText(JSON.stringify(json, null, '  '))
+                            .then(
+                                () => {
+                                    button.classList.add('en_jtv_copied');
+                                    void button.offsetWidth; // triggers animation transitions
+                                    button.classList.remove('en_jtv_copied');
+                                },
+                                onFail
+                            );
+                    } catch (e) {
+                        onFail(e.message);
+                    }
+                });
+            }
+
+            function en_jtv_show_create_number_of_elements(count) {
+                var e = en_jtv_create_element('span', 'en_jtv_number_of_elements');
+                e.dataset.itemCount = count;
+                return e;
+            }
+
+                var isArray = Array.isArray(json);
+                if (isArray) {
+                    if (json.length == 0) {
+                        en_jtv_append_text(parent, '[]');
+                        break;
+                    }
+                    en_jtv_append_text(parent, '[');
+                    var list = en_jtv_append_element(parent, 'ul');
+                    var item = null;
+                    for (var i = 0; i != json.length; ++i) {
+                        if (item)
+                            en_jtv_append_text(item, ',');
+                        item = document.createElement('li');
+                        var outer = en_jtv_append_element(item, 'div');
+                        outer.className = 'en_key';
+                        const value = json[i];
+                        en_jtv_append_element(outer, 'span');
+                        if (en_jtv_show_generate_button)
+                            en_jtv_show_add_copy_button(outer, value);
+                        impl(value, item);
+                        list.appendChild(item);
+                    }
+                    parent.appendChild(en_jtv_show_create_number_of_elements(json.length));
+                    en_jtv_append_text(parent, ']');
+                } else {
+                    var keys = Object.keys(json);
+                    if (keys.length == 0) {
+                        en_jtv_append_text(parent, '{}');
+                        break;
+                    }
+                    en_jtv_append_text(parent, '{');
+                    var list = en_jtv_append_element(parent, 'ul');
+                    var item = null;
+                    for (var key of keys) {
+                        if (item)
+                            en_jtv_append_text(item, ',');
+                        item = document.createElement('li');
+                        var outer = en_jtv_append_element(item, 'div');
+                        outer.className = 'en_key';
+                        const value = json[key];
+                        var inner = en_jtv_append_element(outer, 'span');
+                        if (en_jtv_show_generate_button)
+                            en_jtv_show_add_copy_button(outer, value);
+                        inner.dataset.keyData = key;
+                        inner.textContent = '"' + key + '"';
+                        en_jtv_append_text(item, ': ');
+                        impl(value, item);
+                        list.appendChild(item);
+                    }
+                    parent.appendChild(en_jtv_show_create_number_of_elements(keys.length));
+                    en_jtv_append_text(parent, '}');
+                }
+                if (parent.tagName == 'LI') {
+                    parent.classList.add('en_folder', 'en_folded');
+                }
+                break;
+            default:
+                en_jtv_append_text(parent, 'unexpected: ' + JSON.stringify(json));
+                break;
+        }
+    };
+    var holder = document.createElement('div');
+    holder.className = 'en_jtv';
+    impl(json, holder);
+    for (var e of holder.querySelectorAll('li.en_folder > div.en_key > span')) {
+        e.addEventListener('click', function (event) {
+            var parent = this.parentElement.parentElement;
+            var expanded = !parent.classList.toggle('en_folded');
+            if (event.ctrlKey || event.metaKey) {
+                var children = parent.querySelectorAll('li.en_folder');
+                if (expanded) {
+                    for (var e of children)
+                        e.classList.remove('en_folded');
+                } else {
+                    for (var e of children)
+                        e.classList.add('en_folded');
+                }
+            }
+        });
+    }
+
+    return holder;
+}
+
+function en_jtv_show_data(json) {
+    try {
+        json = JSON.stringify(json);
+        json = JSON.parse(json);
+        document.getElementById('en_jtv_parse_error').textContent = '';
+    } catch (e) {
+        document.getElementById('en_jtv_parse_error').textContent = e.message;
+        return;
+    }
+    var tree = en_jtv_create_dom(json, true);
+    var holder = document.getElementById('en_res_popup');
+    holder.removeChild(holder.querySelector('*'));
+    holder.appendChild(tree);
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-style.css
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-style.css	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv-style.css	(revision 3237693)
@@ -0,0 +1,391 @@
+.en_jtv {
+	font-family: 'Courier New', Courier, monospace;
+	white-space: nowrap;
+}
+
+.en_jtv ul {
+	list-style-type: none;
+	padding: 0;
+	margin-left: 3em;
+	margin-top: 0;
+	margin-bottom: 0;
+	counter-reset: childIndex;
+}
+
+.en_jtv li:not(:first-child) {
+	counter-increment: childIndex;
+}
+
+.en_jtv li::before {
+	content: counter(childIndex);
+	color: lightgray;
+	text-align: right;
+	display: inline-block;
+	min-width: 2.5em;
+	margin-left: -3em;
+	padding-right: 0.5em;
+}
+
+.en_jtv li.en_folded > span.en_jtv_number_of_elements::before {
+	content: attr(data-item-count);
+	display: inline-block;
+	margin-left: 0.5em;
+	margin-right: 0.5em;
+	color: gray;
+}
+
+.en_jtv li > div.en_key {
+	display: inline;
+}
+
+.en_jtv li > div.en_key div.en_jtv_copy {
+	display: inline;
+	position: relative;
+}
+
+.en_jtv li > div.en_key .en_jtv_copy::after {
+	content: '\1f4cb';
+	opacity: 0.33;
+	font-size: 1em;
+	background-color: #efefef;
+	visibility: hidden;
+	display: block;
+	position: absolute;
+	color: #111;
+	transition: background-color 0.5s, visibility 0s 0.3s;
+	text-align: center;
+	border-radius: 0.2em;
+	width: 1.4em;
+	height: 1.4em;
+	bottom: -0.2em;
+	left: 0.2em;
+	cursor: pointer;
+}
+
+.en_jtv li > div.en_key .en_jtv_copy:hover::after {
+	opacity: 1;
+	box-shadow: 0 0 3px black;
+}
+
+.en_jtv li > div.en_key:hover .en_jtv_copy::after {
+	visibility: visible;
+	transition: background-color 0.5s, visibility 0s 0.2s;
+}
+
+.en_jtv li > div.en_key:hover .en_jtv_copy .en_jtv_copied::after {
+	background-color: #0c0;
+	transition: background-color 0s;
+}
+
+.en_jtv li > div.en_key:hover .en_jtv_copy .en_jtv_not_copied::after {
+	background-color: #e55;
+	transition: background-color 0s;
+}
+
+.en_jtv li > div.en_key > span {
+	color: darkslateblue;
+}
+
+.en_jtv li > div.en_key > span:hover {
+	background-color: lightblue;
+}
+
+.en_jtv li.en_folder.en_folded > ul {
+	display: none;
+}
+
+.en_jtv li.en_folder > div.en_key > span::before {
+	content: '\2212';
+	opacity: 0.33;
+	color: #111;
+	background-color: #e0eaef;
+	text-align: center;
+	display: inline-block;
+	width: 1em;
+	height: 1em;
+	margin-left: -2.9em;
+	margin-right: 1.9em;
+	cursor: pointer;
+	border-radius: 0.2em;
+}
+
+.en_jtv li.en_folder.en_folded > div.en_key > span::before {
+	content: '+';
+}
+
+.en_jtv li.en_folder > div.en_key:hover > span::before {
+	opacity: 1;
+}
+
+.en_jtv .en_jtv_show_null_value {
+	color: gray;
+	font-weight: bold;
+}
+
+.en_jtv .en_jtv_numeric_value {
+	color: darkblue;
+	font-weight: bold;
+}
+
+.en_jtv .en_jtv_string_value {
+	color: brown;
+	font-weight: bold;
+}
+/*json tree view*/
+.response {
+	text-decoration: none;
+	cursor: pointer;
+	transition: all 0.3s ease-out;
+}
+
+.overlay {
+	position: fixed;
+	top: 100px;
+	bottom: 100px;
+	left: 0;
+	right: 0;
+	background: rgba(0, 0, 0, 0.7);
+	transition: opacity 500ms;
+	visibility: hidden;
+	opacity: 0;
+	height: 80%;
+	overflow-y: scroll;
+}
+
+.overlay:target {
+	visibility: visible;
+	opacity: 1;
+}
+
+.popup {
+	margin: 70px auto;
+	padding: 20px;
+	background: #fff;
+	border-radius: 5px;
+	width: 66%;
+	position: relative;
+	transition: all 5s ease-in-out;
+}
+
+.popup h2 {
+	margin-top: 0;
+	color: #333;
+	font-family: Tahoma, Arial, sans-serif;
+}
+
+.popup .close {
+	position: absolute;
+	top: 20px;
+	right: 30px;
+	transition: all 200ms;
+	font-size: 30px;
+	font-weight: bold;
+	text-decoration: none;
+	color: #333;
+}
+
+.popup .close:hover {
+	color: #06d85f;
+}
+
+.popup .content {
+	height: 60vh;
+	max-height: 60vh;
+	overflow: auto;
+}
+
+@media screen and (max-width: 700px) {
+	.box {
+		width: 70%;
+	}
+
+	.popup {
+		width: 70%;
+	}
+}
+/*Logs*/
+.en_logs {
+	font-family: Arial, Helvetica, sans-serif;
+	border-collapse: collapse;
+	width: 100%;
+}
+
+.en_logs td,
+.en_logs th {
+	border: 1px solid #ddd;
+	padding: 8px;
+}
+
+.en_logs tr:nth-child(even) {
+	background-color: #f2f2f2;
+}
+
+.en_logs tr:hover {
+	background-color: #ddd;
+}
+
+.en_logs th {
+	padding-top: 12px;
+	padding-bottom: 12px;
+	text-align: left;
+	background: #2271b1;
+	border-color: #2271b1;
+	color: #fff;
+}
+
+.en_logs + .submit {
+	display: none;
+}
+
+/* Box sizing */
+.postbox {
+	position: inherit !important;
+}
+.unpacked_setting {
+	margin-top: 1%;
+	margin-left: 2%;
+}
+.align_pkg_dims {
+	margin-left: 4.7%;
+}
+.align_pkg {
+	margin-left: 5%;
+}
+.reduce_space_total_item {
+	margin-bottom: 1%;
+	margin-top: -1%;
+	margin-left: 5%;
+}
+.reduce_space {
+	margin-bottom: 1%;
+	margin-top: -1%;
+	margin-left: 5%;
+}
+/*.set_position
+{
+    position: relative;
+    bottom: -3%;
+    padding-left: 26%;
+
+}*/
+.packed_items {
+	padding-left: 1%;
+	margin-bottom: 1%;
+}
+.unpacked_item_parent {
+	margin: 0 auto;
+	display: inline-flex;
+}
+.unpacked_item_child {
+	float: left;
+	width: available;
+	margin-bottom: 10%;
+}
+.image_setting_no_dims {
+	margin-top: 0px;
+	padding-bottom: 12px;
+	padding-left: 35px;
+	padding-top: 12px;
+}
+.product_weight {
+	margin-top: 20px !important;
+	position: relative;
+	bottom: -6%;
+	left: -46%;
+}
+._product_weight {
+	margin-top: 20px !important;
+	position: relative;
+	bottom: 3%;
+	left: 23%;
+}
+.image_setting {
+	padding-left: 35px;
+	padding-top: 14px;
+	margin-top: 9px;
+}
+.en_wwe_small_box_sizing p {
+	width: 90% !important;
+	margin: 15px 0px 0 41px;
+}
+.en_woo_addons_box_sizing .add_box p:nth-child(1) {
+	padding: 0px 20px 0px 20px;
+}
+.en-left {
+	float: left;
+	margin-right: 25px;
+	display: block;
+	width: 100%;
+}
+.en-columns {
+	width: 20%;
+	display: inline-block;
+}
+.en-full-row {
+	width: 100%;
+	display: block;
+}
+.package-steps-product {
+	width: 103px;
+	float: left;
+	margin-right: 48px;
+	padding-left: 9px;
+}
+/*.en-product-steps-details p{
+
+    margin: 2px 0 0 0;
+}*/
+.unpacked_item_child .en-product-steps-details {
+	width: 60%;
+	margin: 5px;
+	padding-left: 30px;
+}
+.en-clear {
+	clear: both;
+}
+.accessorials-list {
+	list-style-type: disc;
+	list-style-position: inside;
+}
+.package-steps-block {
+	margin-bottom: 30px;
+	margin-left: 5%;
+}
+.en-package-details hr {
+	margin-bottom: 20px;
+	border-top: 1px solid #a9a9a9 !important;
+}
+#bin-del {
+	cursor: pointer;
+	position: absolute;
+	right: 0;
+	top: 0px;
+	z-index: 99999;
+	padding: 11px 30px 10px 10px;
+	text-indent: -9999px;
+}
+
+.block-2:before,
+.block-6:before,
+.block-8:before,
+.block-10:before,
+.block-12:before {
+	content: '\A';
+	white-space: pre;
+}
+
+.disable {
+	cursor: not-allowed;
+	pointer-events: none;
+}
+
+/*usps flat rate*/
+
+.box_sizing_full {
+	clear: both;
+	padding: 1px;
+}
+
+.box_sizing_full select {
+	width: 100% !important;
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/logs/en-json-tree-view/en-jtv.php	(revision 3237693)
@@ -0,0 +1,211 @@
+﻿<?php
+
+if ( ! defined( 'ABSPATH' ) ) {
+    exit;
+}
+
+?>
+
+<div id="en_jtv_showing_res" class="overlay">
+    <div class="popup">
+        <h2 id="en_title_popup">Response</h2>
+        <a class="close" href="#">&times;</a>
+        <div class="content">
+            <div>
+                <span id="en_jtv_parse_error" style="color: darkred;"></span>
+            </div>
+            <div id="en_res_popup"></div>
+            <script type="text/javascript">
+                function en_jtv_res_detail(json) {
+                    jQuery('#en_title_popup').text('Response');
+                    jQuery("#en_res_popup").empty();
+                    var tree = en_jtv_create_dom(json, true);
+                    document.getElementById('en_res_popup').appendChild(tree);
+                    en_jtv_show_data(json);
+                }
+
+                let item_per_shipment = {}, unpacked_wt_dims, package_count = 0;
+                
+                function en_packging_details(data) {
+                    item_per_shipment = {};
+                    unpacked_wt_dims = '';
+                    package_count = 0;
+                    let count = 1, packaging_output = '';
+
+                    if (data.bins_array && Object.keys(data.bins_array).length) {
+                        const {unpacked_shipment, shipment, total_count, item_per_shipment, bins_array} = data;
+
+                        Object.keys(bins_array).forEach((details, zip) => {
+                            details = bins_array[details];
+                            
+                            packaging_output += "<div class='en-package-details'>";
+                            packaging_output += en_output_bins_packed(unpacked_shipment, shipment, details, zip, total_count);
+                            packaging_output += "</div>";
+                            count++;
+                        });
+
+                        jQuery('#en_title_popup').text('Packaging Details');
+                        jQuery("#en_res_popup").empty();
+                        jQuery("#en_res_popup").html(packaging_output);
+                    }
+                }
+
+                function en_output_bins_packed(unpacked_shipment, shipment, details, zip, total_count)
+                {
+                    let main_bin_img = '', item_own_pkg = '', bin_count = 1, unpacked_flag = 0, box_output = "", packed_items = 1, count = 0, index = 't', index_count = 0, previous_dims = null, packed_dims = null, current_dims = null, boxes_output_arr = [], total_complete_img = 0;
+                    
+                    box_output += "<div class='per-package'>";
+
+                    if (details && details?.length) {
+                        for (const bin_details of details) {
+                            box_output = "";
+                            let dims = box_dims(bin_details?.bin_data);
+
+                            switch (true) {
+                                case (bin_details?.bin_data?.type && bin_details?.bin_data?.type == "item" && dims):
+                                    index = "These items don't have dimensions and therefore couldn't be placed in a box. Shipping rates for these items were retrieved based on weight only.";
+                                    packed_items = 3;
+                                    break;
+
+                                case (bin_details?.bin_data?.type && bin_details?.bin_data?.type == "item"):
+                                    index = "These items were quoted as shipping as their own package.";
+                                    packed_items = 2;
+                                    break;
+                                default :
+                                    index = "Packed items";
+                                    packed_items = 1;
+                                    break;
+                            }
+
+                            let main_bin_img = bin_details?.image_complete;
+
+                            if (packed_items == 2 || packed_items > 3) {
+                                dims = bin_details?.items['0']?.w;
+
+                                if (packed_items == 2) {
+                                    dims = bin_details?.items['0']?.w . bin_details?.items['0']?.h . bin_details?.items['0']?.d;
+                                }
+
+                                dims && previous_dims == null ? previous_dims = dims : '';
+
+                                if (unpacked_shipment == 'single') {
+                                    !boxes_output_arr[packed_items] ? box_output += "<h4 class='packed_items'>" + index + "</h4>" : "";
+                                } else {
+                                    unpacked_flag && unpacked_flag == 0 ? box_output += "<h4 class='packed_items'>" + index + "</h4>" : '';
+
+                                    unpacked_flag = 1;
+                                    if (dims == previous_dims && (current_dims == null)) {
+                                        current_dims = previous_dims;
+                                    } else if (current_dims != dims) {
+                                        current_dims = dims;
+                                        box_output += "<h4 class='packed_items'>" + index + "</h4>";
+                                    }
+                                }
+
+                                box_output += '<div class="en-package-' + bin_count + ' unpacked_item_parent unpacked_setting">';
+                                box_output += '<div class="unpacked_item_child">';
+                                product_name = bin_details?.bin_data?.product_name ? bin_details?.bin_data?.product_name : '';
+
+                                if (packed_items != 3) {
+                                    box_output += '<div class="en-product-steps-details">';
+                                    box_output += "<span class='set_position'>" + product_name + "</span> <br>";
+                                    box_output += "<span class='en-prdouct-steps-dimensions'>" + bin_details?.bin_data?.d + ' x ' + bin_details?.bin_data?.w + ' x ' + bin_details?.bin_data?.h + "</span>";
+                                    box_output += '</div>';
+                                    box_output += '<img  class="package-complete-image-tag image_setting" src="' + main_bin_img + '" />';
+                                } else {
+                                    box_output += '<img  class="package-complete-image-tag image_setting_no_dims" src="' + main_bin_img + '" />';
+                                    box_output += '<div class="en-product-steps-details">';
+                                    box_output += '<span class="en_product_weight"> ' + product_name + ' </span> ';
+                                    box_output += '<span class="en_product_weight"> Weight = ' + bin_details?.bin_data?.weight + ' lbs</span> ';
+                                    box_output += '</div>';
+                                }
+
+                                box_output += '</div>';
+                                box_output += '</div>';
+                            } else {
+                                dims = bin_details?.items['0']?.w;
+                                dims && (previous_dims == null) ? previous_dims = dims : '';
+                                
+                                if (shipment == 'single') {
+                                    !boxes_output_arr[packed_items] ? box_output += "<h4 class=''>" + index + "</h4>" : "";
+                                } else {
+                                    if ((dims == previous_dims && (current_dims == null)) || (item_per_shipment['t' + (bin_count - 1)] && item_per_shipment['t' + (bin_count - 1)] == bin_count)) {
+                                        current_dims = previous_dims;
+                                        bin_count = (item_per_shipment['t' + (bin_count - 1)]) && (item_per_shipment['t' + (bin_count - 1)] == bin_count) ? 1 : bin_count;
+                                        box_output += "<h4 class=''>" + index + "</h4>";
+                                    } else if (current_dims != dims) {
+                                        current_dims = dims;
+                                        box_output += "<h4 class=''>" + index + "</h4>";
+                                    }
+                                }
+
+                                total_count = shipment && item_per_shipment['t' + (bin_count - 1)] && shipment != "single" ? item_per_shipment['t' + (bin_count - 1)] : total_count;
+
+                                box_output += '<div class="en-package-' + bin_count + ' packed_items">';
+                                box_output += '<div class="en-full-row">';
+                                box_output += '<div class="en-left before-steps-info">';
+                                box_output += '<p class="reduce_space"><b>Box ' + bin_count + ' of ' + total_count + '</b></p>';
+                                box_output += '<p class="reduce_space_total_item"><b>Number of items: ' + bin_details?.items?.length + '</b></p>';
+                                box_output += '<p class="reduce_space_total_item box-prod-title">' + bin_details?.bin_data?.box_title + ' <strong>' + item_own_pkg + '</strong></p>';
+                                box_output += '<div class="package-dimensions align_pkg_dims">'
+                                    + '<p>' + bin_details?.bin_data?.d + ' x ' + bin_details?.bin_data?.w + ' x ' + bin_details?.bin_data?.h + '</p>'
+                                    + '</div>';
+                                box_output += '</div>';
+
+                                bin_count = item_per_shipment['t' + (bin_count - 1)] && (item_per_shipment['t' + (bin_count - 1)] == bin_count) ? 0 : bin_count;
+
+                                box_output += '<div class="package-complete-image align_pkg">';
+                                box_output += '<img class="package-complete-image-tag" src="' + main_bin_img + '" />';
+                                box_output += '</div>';
+                                box_output += '</div>';
+                                box_output += '</div>';
+                                box_output += en_output_items_packed(bin_details, zip);
+                            }
+
+                            bin_count++;
+                            boxes_output_arr[packed_items] ? boxes_output_arr[packed_items] += box_output : boxes_output_arr[packed_items] = box_output;
+                        }
+                    }
+
+                    boxes_output_arr = boxes_output_arr.length > 0 ? boxes_output_arr.filter((el) => el) : '';
+
+                    return boxes_output_arr[0];
+                }
+
+                function box_dims(bin_data) {
+                    return (bin_data?.w && bin_data?.h && bin_data?.d) && !(bin_data?.w > 0 || bin_data?.h > 0 || bin_data?.d > 0) ? true : false;
+                }
+
+                function en_output_items_packed(bin_details, zip)
+                {
+                    box_output = "";
+                    box_output += '<div class="package-steps-block">';
+                    box_output += "<p class='packed_items'><strong>Steps:</strong></p>";
+                    total_items_packet = bin_details?.items?.length;
+                    item_image = '';
+
+                    /* Items packed details */
+                    for (const item_details of bin_details?.items) {                        
+                        box_output += '<div class="package-steps-product">';
+                        box_output += '<img class="en-prduct-steps-image" src="' + item_details?.image_sbs + '" />';
+                        box_output += '<div class="en-product-steps-details">';
+                        
+                        product_name = item_details?.product_name ? item_details?.product_name : '';
+                        box_output += '<p class="en-prdouct-steps-dimensions">' + product_name + '</p>';
+                        box_output += '<p class="en-prdouct-steps-dimensions">' + item_details?.d + ' x ' + item_details?.w + ' x ' + item_details?.h + '</p>';
+                        
+                        box_output += '</div>';
+                        box_output += '</div>';
+                    }
+
+                    /* Clear the float effect */
+                    box_output += '<div class="en-clear"></div>';
+                    box_output += '</div>';
+
+                    return box_output;
+                }
+            </script>
+        </div>
+    </div>
+</div>
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/logs/en-logs.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/logs/en-logs.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/logs/en-logs.php	(revision 3237693)
@@ -0,0 +1,229 @@
+<?php 
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+?>
+
+<script type="text/javascript">
+    jQuery(function() {
+        jQuery('a').on('click', function(e) {
+            const class_name = this.className;
+            const show_class_name = class_name.includes('show') ? class_name.replace('show', 'hide') : class_name.replace('hide', 'show');
+
+            if (class_name.includes('show') || class_name.includes('hide')) {
+                e.preventDefault();
+            }
+
+            jQuery('.' + class_name).hide();
+            jQuery('.' + show_class_name).show();
+        })
+    });
+</script>
+
+<style>
+    .hide {
+        display: none;
+    }
+    .dims_space {
+        padding-top: 0 !important;
+    }
+    .packaging_actions {
+        display: flex;
+        justify-content: space-evenly;
+        align-items: center;
+    }
+    .empty_packaging_actions {
+        text-align: center !important;
+    }
+</style>
+
+<?php
+
+if (!class_exists('Eniture_UpsSpqLogs')) {
+    class Eniture_UpsSpqLogs
+    {
+        public function __construct()
+        {
+            $this->enLogs();
+        }
+
+        // Logs request
+        public function enLogs()
+        {
+            $obj_classs = new \Eniture_UPS_Small_Curl_Request();
+            $data = array(
+                'serverName' => eniture_ups_small_get_domain(),
+                'licenseKey' => get_option('ups_small_licence_key'),
+                'lastLogs' => '25',
+                'carrierName' => 'UPS Small',
+            );
+
+            require_once 'en-json-tree-view/en-jtv.php';
+            require_once 'en-packaging-details/en-packaging-details.php';
+
+            $url = ENITURE_UPS_DOMAIN_HITTING_URL . '/request-log/index.php';
+            $logs = $obj_classs->ups_small_get_curl_response($url, $data);
+            $logs = (!empty($logs) && is_string($logs) && strlen($logs) > 0) ? json_decode($logs, true) : [];
+
+            // Eniture debug mode
+            do_action('eniture_debug_mode', 'UPS Small Logs', $logs);
+
+            echo '<table class="en_logs ups_small_wrapper">';
+
+            if (isset($logs['severity'], $logs['data']) && $logs['severity'] == 'SUCCESS') {
+                echo '<tr>';
+                echo '<th>Log ID</th>';
+                echo '<th>Request Time</th>';
+                echo '<th>Response Time</th>';
+                echo '<th>Latency</th>';
+                echo '<th>Items</th>';
+                echo '<th>DIMs (L x W x H)</th>';
+                echo '<th>Qty</th>';
+                echo '<th>Sender Address</th>';
+                echo '<th>Receiver Address</th>';
+                echo '<th>Response</th>';
+                echo '</tr>';
+
+                foreach ($logs['data'] as $key => $shipment) {
+                    if (empty($shipment) || !is_array($shipment)) continue;
+
+                    echo '<tr>';
+
+                    $request = $response = $carrier = $status = '';
+                    $receiverLineAddress = $ups_small_pkg_reciver_city = $ups_small_pkg_receiver_state = $ups_small_pkg_receiver_zip_code = $ups_small_pkg_receiver_countryCode = '';
+                    if (empty($shipment) || !is_array($shipment)) continue;
+                    extract($shipment);
+                    $request = is_string($request) && strlen($request) > 0 ? json_decode($request, true) : [];
+                    if (empty($request) || !is_array($request)) continue;
+                    extract($request);
+
+                    $en_fdo_meta_data = (isset($request['en_fdo_meta_data'])) ? $request['en_fdo_meta_data'] : [];
+                    if (empty($en_fdo_meta_data)) {
+                        continue;
+                    }
+
+                    $items = $address = [];
+                    if (empty($en_fdo_meta_data) || !is_array($en_fdo_meta_data)) continue;
+                    extract($en_fdo_meta_data);
+                    $en_address = $address;
+                    $en_qty = $en_items = $en_dim = '';
+                    $class_name = 'ups-small-log-' . $key . wp_rand(1, 100);
+
+                    foreach ($items as $key => $item) {
+                        $name = $quantity = $length = $width = $height = '';
+                        extract($item);
+
+                        $en_qty .= strlen($en_qty) > 0 ? "<br> $quantity" : $quantity;
+                        $en_items .= strlen($en_items) > 0 ? "<br> $name" : $name;
+                        $en_dim .= strlen($en_dim) > 0 ? "<br> $length X $width X $height" : "$length X $width X $height";
+                    }
+
+                    $en_updated_qty = $en_updated_items = $en_updated_dim = '';
+                    $updated_items = count($items) > 5 ? array_slice($items, 0, 5) : $items;
+                    if (!empty($updated_items)) {
+                        foreach ($updated_items as $key => $item) {
+                            $name = $quantity = $length = $width = $height = '';
+                            extract($item);
+
+                            $en_updated_qty .= strlen($en_updated_qty) > 0 ? "<br> $quantity" : $quantity;
+                            $en_updated_items .= strlen($en_updated_items) > 0 ? "<br> $name" : $name;
+                            $en_updated_dim .= strlen($en_updated_dim) > 0 ? "<br> $length X $width X $height" : "$length X $width X $height";
+                        }
+                    }
+
+                    // Sender address
+                    $address = $city = $state = $zip = $country = '';
+                    extract($en_address);
+                    $en_sender = strlen(trim($address) > 0) ? "$address, " : '';
+                    $en_sender .= "$city, $state $zip $country";
+
+                    // Receiver address
+                    $en_receiver = strlen(trim($receiverLineAddress) > 0) ? "$receiverLineAddress, " : '';
+                    $en_receiver .= "$ups_small_pkg_reciver_city, $ups_small_pkg_receiver_state $ups_small_pkg_receiver_zip_code $ups_small_pkg_receiver_countryCode";
+
+                    $carrier = ucfirst($carrier);
+                    $status = ucfirst($status);
+                    $status = !empty($status) ? ucfirst($status) : 'Error';
+                    $log_id = $shipment['id'];
+                    $request_time = $this->setTimeZone($request_time);
+                    $response_time = $this->setTimeZone($response_time);
+                    $latency = strtotime($response_time) - strtotime($request_time);
+                    $response = !empty($response) && is_string($response) ? $response : '';
+
+                    $response = str_replace(array("\r", "\n", "\t"), '', $response);
+                    $temp_resp = json_decode($response);
+
+                    // Handle packaging details
+                    $bin_response = [];
+                    if (isset($temp_resp->binPackaging) && !empty($temp_resp->binPackaging)) {
+                        $bin_response[] = isset($temp_resp->binPackaging, $temp_resp->binPackaging->response) ? $temp_resp->binPackaging->response : [];
+                        $bin_packaging = new \Eniture_UpsSpqLogsPackaging();
+                        $bin_packaging_markup = $bin_packaging->en_get_bins_packed($bin_response, $products);
+                    }
+
+                    echo "<td>" . esc_attr($log_id) . "</td>";
+                    echo "<td>" . esc_attr($request_time) . "</td>";
+                    echo "<td>" . esc_attr($response_time) . "</td>";
+                    echo "<td>" . esc_attr($latency) . "</td>";
+
+                    $name = 'show-' . $class_name;
+                    if (count($items) > 5) {
+                        echo "<td class='items_space " . esc_attr($name) . "'>" . $en_updated_items . "<br /> <a href='#' class='" . esc_attr($name) . "'>Show more items</a> </td>";
+                    } else {
+                        echo "<td class='items_space " . esc_attr($name) . "'>" . $en_updated_items . "</td>";
+                    }
+
+                    echo "<td class='" . esc_attr($name) . "'>" . $en_updated_dim . "</td>";
+                    echo "<td class='" . esc_attr($name) . "'>" . $en_updated_qty . "</td>";
+
+                    $name = 'hide-' . $class_name;
+                    echo "<td class='items_space hide " . esc_attr($name) . "'>" . $en_items . "<br /> <a href='#' class='" . esc_attr($name) . "'>Hide more items</a> </td>";
+                    echo "<td class='hide " . esc_attr($name) . "'>" . $en_dim . "</td>";
+                    echo "<td class='hide " . esc_attr($name) . "'>" . $en_qty . "</td>";
+
+                    echo "<td>" . esc_attr($en_sender) . " </td>";
+                    echo "<td>" . esc_attr($en_receiver) . " </td>";
+
+                    $action_links = '';
+                    
+                    if (!empty($bin_response) && strtolower($status) != 'error') {
+                        $action_links = '<td class="packaging_actions"><a href = "#en_jtv_showing_res" class="response" onclick=\'en_jtv_res_detail(' . esc_attr($response) . ')\'>' . esc_attr($status) . '</a>';
+
+                        $box_icon = plugins_url('en-packaging-details/box-icon.png', __FILE__);
+                        $packaging_link = ' <span> | </span> <a title="View packaging details" href="#en_jtv_showing_res" class="response" onclick=\'en_packging_details(' . wp_json_encode($bin_packaging_markup) . ')\' ><img src=' . $box_icon . ' /></a>';
+
+                        $action_links .= $packaging_link;
+                        $action_links .= '</td>';
+                    } else {
+                        $action_links = '<td class="empty_packaging_actions"><a href = "#en_jtv_showing_res" class="response" onclick=\'en_jtv_res_detail(' . esc_attr($response) . ')\'>' . esc_attr($status) . '</a></td>';
+                    }
+
+                    echo $action_links;
+                    echo '</tr>';
+                }
+            } else {
+                echo '<div class="user_guide">';
+                echo '<p>Logs are not available.</p>';
+                echo '</div>';
+            }
+
+            echo '</table>';
+        }
+
+        public function setTimeZone($date_time)
+        {
+            $time_zone = wp_timezone_string();
+            if (empty($time_zone)) {
+                return $date_time;
+            }
+
+            $converted_date_time = new DateTime($date_time, new DateTimeZone($time_zone));
+
+            return $converted_date_time->format('m/d/Y h:i:s');
+        }
+    }
+
+    new Eniture_UpsSpqLogs();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/logs/en-packaging-details/en-packaging-details.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/logs/en-packaging-details/en-packaging-details.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/logs/en-packaging-details/en-packaging-details.php	(revision 3237693)
@@ -0,0 +1,170 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists('Eniture_UpsSpqLogsPackaging')) {
+    class Eniture_UpsSpqLogsPackaging
+    {
+        public $package_count = 0;
+        public $item_per_shipment;
+        public $unpacked_wt_dims;
+        public $bin_response;
+        public $item_details;
+
+        public function en_get_bins_packed($bin_response, $products_name_arr)
+        {
+            $this->bin_response = $bin_response;
+            $total_count = 0;
+            $shipment = '';
+            $unpacked_shipment = '';
+            $bins_array = array();
+
+            $shipment_array = (array)$this->bin_response;
+            $shipment_origin = array_keys($shipment_array);
+            $bins_array = $this->arrange_bins_response_order($this->bin_response);
+
+            // get count of each shipment
+            if (isset($bins_array['1'])) {
+                $this->packed_item_shipment($shipment_array, $shipment_origin);
+            }
+
+            if (isset($bins_array['3'])) {
+                $this->unpacked_wt_dims = count($bins_array['3']);
+                $this->unpacked_wt_dims = isset($this->unpacked_wt_dims) && ($this->unpacked_wt_dims > 1) ? 'multiple' : 'single';
+            }
+            
+            $shipment = isset($shipment_origin) && (count($shipment_origin) == 1) ? 'single' : 'multiple';
+
+            // check shipment of unpacked items who have dims
+            if (isset($bins_array['2']) && count($bins_array['2']) > 1 && ($bins_array['2']['0']->bin_data->w != 0)) {
+                $dims = NULL;
+
+                foreach ($bins_array['2'] as $value) {
+                    if ($dims == NULL) {
+                        $dims = $value->bin_data->w;
+                    } else {
+                        if ($value->bin_data->w == $dims && $shipment != 'multiple') {
+                            $unpacked_shipment = 'single';
+                        } else {
+                            $unpacked_shipment = 'multiple';
+                        }
+                    }
+                }
+            }
+
+            foreach ($this->bin_response as $zip => $details) {
+                if (isset($details->home_ground_pricing->bins_packed)) {
+                    $details = $details->home_ground_pricing;
+                } elseif (isset($details->weight_based_pricing->bins_packed)) {
+                    $details = $details->weight_based_pricing;
+                } elseif (isset($details->one_rate_pricing->bins_packed)) {
+                    $details = $details->one_rate_pricing;
+                }
+
+                (isset($details->bins_packed) && !empty($details->bins_packed)) ? $total_count = $total_count + $this->getBinDataCount($details->bins_packed) : '';
+            }
+
+            foreach ($bins_array as $zip => $details) {
+                $bins_array[$zip] = $this->appendProductTitle($details, $products_name_arr);
+            }
+
+            $data = [
+                'bins_array'        => $bins_array,
+                'unpacked_shipment' => $unpacked_shipment,
+                'shipment'          => $shipment,
+                'total_count'       => $total_count,
+                'item_per_shipment' => $this->item_per_shipment
+            ];
+
+            return $data;
+        }
+
+        public function arrange_bins_response_order($bins_response)
+        {
+            $sorted_bins_resp = array();
+            foreach ($bins_response as $zip => $details) {
+
+                if (isset($details->home_ground_pricing->bins_packed)) {
+                    $details = $details->home_ground_pricing;
+                } elseif (isset($details->weight_based_pricing->bins_packed)) {
+                    $details = $details->weight_based_pricing;
+                } elseif (isset($details->one_rate_pricing->bins_packed)) {
+                    $details = $details->one_rate_pricing;
+                }
+
+                if (isset($details->bins_packed) && !empty($details->bins_packed)) {
+                    foreach ($details->bins_packed as $bins_detail) {
+                        if ($bins_detail->bin_data->w == 0 && $bins_detail->bin_data->type == 'item') {
+                            $sorted_bins_resp['3'][] = $bins_detail;
+                        } else {
+                            if (isset($bins_detail->bin_data->type) && $bins_detail->bin_data->type == 'item') {
+                                $sorted_bins_resp['2'][] = $bins_detail;
+                            } else {
+                                $sorted_bins_resp['1'][] = $bins_detail;
+                            }
+                        }
+                    }
+                }
+            }
+
+            $keys = array();
+            isset($sorted_bins_resp['1']) && !empty($sorted_bins_resp['1']) ? $keys['1'] = $sorted_bins_resp['1'] : array();
+            isset($sorted_bins_resp['2']) && !empty($sorted_bins_resp['2']) ? $keys['2'] = $sorted_bins_resp['2'] : array();
+            isset($sorted_bins_resp['3']) && !empty($sorted_bins_resp['3']) ? $keys['3'] = $sorted_bins_resp['3'] : array();
+
+            return $keys;
+        }
+
+        public function packed_item_shipment($shipment_array)
+        {
+            $count = 0;
+            $index = 't';
+            $index_count = 0;
+
+            foreach ($shipment_array as $bin_detail) {
+                $bin_data_w = (isset($bin_detail->bins_packed[$index_count]->bin_data->w)) ? $bin_detail->bins_packed[$index_count]->bin_data->w : 0;
+                
+                if (empty($bin_detail->bins_packed[$index_count]->bin_data->type) && ($bin_data_w != 0)) {
+                    $index = $index . $index_count;
+                    $this->item_per_shipment[$index] = count($bin_detail->bins_packed);
+                    $index_count = $index_count + 1;
+                    $index = 't';
+                }
+         
+                $count = $count + 1;
+            }
+        }
+
+        public function getBinDataCount($details)
+        {
+            $binDataCount = 0;
+            foreach ($details as $key => $binDetails) {
+                $bin_data_count = isset($binDetails->bin_data) && !empty($binDetails->bin_data) && !isset($binDetails->bin_data->w) ? count((array)$binDetails->bin_data) : 1;
+                $binDataCount = $binDataCount + $bin_data_count;
+            }
+         
+            $this->package_count = $this->package_count + $binDataCount;
+         
+            return $binDataCount;
+        }
+
+        public function appendProductTitle($bin_details, $products_name_arr)
+        {
+            /* Items packed details */
+            foreach ($bin_details as $k => $value) {
+                if (isset($value->bin_data->id) && isset($value->items)) {
+                    $bin_details[$k]->bin_data->box_title = get_the_title($value->bin_data->id);
+
+                    foreach ($value->items as $key => $item_details) {
+                        $product_title = !empty($products_name_arr[$item_details->id]) ? $products_name_arr[$item_details->id] : '';
+                        $bin_details[$k]->items[$key]->product_name = $product_title;
+                    }
+                }
+            }
+
+            return $bin_details;
+        }
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-export.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-export.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-export.php	(revision 3237693)
@@ -0,0 +1,225 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Order export.
+ */
+if (!class_exists('Eniture_OrderExport')) {
+
+    class Eniture_OrderExport
+    {
+        public $en_orders_per_step = 50;
+
+        public function __construct()
+        {
+            add_action('woocommerce_thankyou', [$this, 'en_woocommerce_thankyou'], 10, 1);
+            add_action('init', [$this, 'en_orders_ids']);
+            add_action('en_async_orders_exporting_process', [$this, 'en_async_orders_exporting_process']);
+            add_filter('cron_schedules', [$this, 'en_async_cron_schedule'], 10, 1);
+        }
+
+        // Async cron schedule.
+        public function en_async_cron_schedule($schedules)
+        {
+            $schedules['en_async_cron_every_5_minute'] = array(
+                'interval' => 60 * 5,
+                'display' => __('Every 5 minute', 'small-package-quotes-ups-edition'),
+            );
+            return $schedules;
+        }
+
+        // Async order exported.
+        public function en_async_orders_exporting_process()
+        {
+            try {
+                $en_orders_ids_flag = get_option('en_orders_ids_flag');
+                $en_async_orders_exporting_process = get_option('en_async_orders_exporting_process');
+                if ($en_orders_ids_flag == 'executed' && $en_async_orders_exporting_process != 'completed') {
+                    $en_orders_id = get_option('en_orders_ids');
+                    $en_orders_id = (isset($en_orders_id) && strlen($en_orders_id) > 0) ? json_decode($en_orders_id, true) : [];
+                    if (!empty($en_orders_id) && is_array($en_orders_id)) {
+                        $orders = array_slice($en_orders_id, 0, $this->en_orders_per_step);
+                        $en_orders_ids = $en_orders = [];
+                        foreach ($orders as $key => $order) {
+                            if (isset($order['ID'])) {
+                                $order_id = $order['ID'];
+                                if (in_array($order_id, $en_orders_ids)) {
+                                    continue;
+                                }
+
+                                $en_orders_ids[] = $order_id;
+                                $order_meta = wc_get_order($order_id);
+                                $en_order_data = $this->en_order_details_by_id($order_meta, $order_id);
+                                if (!empty($en_order_data)) {
+                                    $en_orders = array_merge($en_orders, $en_order_data);
+                                }
+                            }
+                        }
+
+                        $this->en_orders_sending($en_orders, $en_orders_ids);
+                        $en_remain_orders_id = array_slice($en_orders_id, $this->en_orders_per_step);
+                        update_option('en_orders_ids', wp_json_encode($en_remain_orders_id));
+
+                    } else {
+                        $en_orders_ids = ['completed'];
+                        update_option('en_async_orders_exporting_process', 'completed');
+                        function_exists('wp_clear_scheduled_hook') ? wp_clear_scheduled_hook('en_async_orders_exporting_process') : '';
+                    }
+
+                    $post_content = 'Note! Exported Orders : ' . wp_json_encode($en_orders_ids);
+                    $this->en_custom_post_save($post_content);
+                }
+            } catch (\Exception $ex) {
+                $post_content = 'Error! Exporting Orders : ' . $ex->getMessage();
+                $this->en_custom_post_save($post_content);
+            }
+        }
+
+        // First time when order exporting process in action.
+        public function en_orders_ids()
+        {
+            try {
+                $en_orders_ids_flag = get_option('en_orders_ids_flag');
+                if ($en_orders_ids_flag != 'executed') {
+                    global $wpdb;
+
+                    $date_from = gmdate('Y-m-d', strtotime('-3 month'));;
+                    $date_to = gmdate('Y-m-d');
+                    $orders_arr = wc_get_orders(array(
+                        'date_created' => "$date_from 00:00:00 ... $date_to 23:59:59",
+                    ));
+                    
+                    $orders = [];
+                    foreach ($orders_arr as $order) {
+                        $orders[] = [
+                            'ID' => $order->get_id(),
+                        ];
+                    }
+
+                    update_option('en_orders_ids', wp_json_encode($orders));
+                    update_option('en_orders_ids_flag', 'executed');
+
+                    $post_content = 'Note! Total Orders Ids: ' . wp_json_encode($orders);
+                    $this->en_custom_post_save($post_content);
+
+                    // Schedules the event if it's NOT already scheduled.
+                    if (!wp_next_scheduled('en_async_orders_exporting_process')) {
+                        wp_schedule_event(time(), 'en_async_cron_every_5_minute', 'en_async_orders_exporting_process');
+                    }
+                }
+            } catch (\Exception $ex) {
+                $post_content = 'Error! Getting Orders Ids: ' . $ex->getMessage();
+                $this->en_custom_post_save($post_content);
+            }
+        }
+
+        // When order places on the checkout page.
+        public function en_woocommerce_thankyou($order_id)
+        {
+            if (!$order_id)
+                return;
+            // Allow code execution only once
+            if (!get_post_meta($order_id, 'en_woocommerce_thankyou_done', true)) {
+
+                $order = wc_get_order($order_id);
+                $current_date = gmdate('Y-m-d h:i:s', time());
+                $order_details = $this->en_order_details_by_id($order, $order_id, $current_date);
+                $this->en_orders_sending($order_details, [$order_id]);
+                // Flag the action as done (to avoid repetitions on reload for example)
+                $order->update_meta_data('en_woocommerce_thankyou_done', true);
+                $order->save();
+            }
+        }
+
+        // Get order details by id.
+        public function en_order_details_by_id($order, $order_id, $current_date = '')
+        {
+            $en_widget_details_data = [];
+            if (empty($order)) {
+                return $en_widget_details_data;
+            }
+
+            // Get an instance of the WC_Order object
+            $order_created_date = isset($current_date) && strlen($current_date) > 0 ? $current_date : (isset($order->order_date) ? $order->order_date : '');
+            $shipping_details = $order->get_items('shipping');
+            foreach ($shipping_details as $item_id => $shipping_item_obj) {
+                $get_formatted_meta_data = $shipping_item_obj->get_formatted_meta_data();
+                foreach ($get_formatted_meta_data as $key => $meta_data) {
+                    switch ($meta_data->key) {
+                        case 'en_fdo_meta_data':
+                            $en_widget_details = json_decode($meta_data->value, true);
+                            if (!empty($en_widget_details)) {
+                                $en_widget_details_data[] = $en_widget_details;
+                            }
+                            break;
+                    }
+                }
+            }
+
+            $en_orders = [];
+            if (!empty($en_widget_details_data)) {
+                foreach ($en_widget_details_data as $key => $shipments) {
+                    $data = (isset($shipments['data'])) ? $shipments['data'] : [];
+                    $shipment_type = (isset($shipments['shipment'])) ? $shipments['shipment'] : 'single';
+                    if (is_array($data) && !empty($data)) {
+                        foreach ($data as $ship_nbr => $shipment) {
+                            $plugin_name = (isset($shipment['plugin_name'])) ? $shipment['plugin_name'] : '';
+                            $rate = (isset($shipment['rate'])) ? $shipment['rate'] : [];
+                            $cost = (isset($rate['cost'])) ? $rate['cost'] : 0;
+                            $label = (isset($rate['label'])) ? $rate['label'] : '';
+                            $en_orders[] = [
+                                'orderId' => $order_id,
+                                'serviceId' => $ship_nbr,
+                                'serviceName' => $label,
+                                'serviceCharge' => $cost,
+                                'orderCreatedDate' => $order_created_date,
+                                'carrierName' => $plugin_name,
+                                'shipmentType' => $shipment_type,
+                                'orderMeta' => base64_encode(wp_json_encode($shipment))
+                            ];
+                        }
+                    }
+                }
+            }
+
+            return $en_orders;
+        }
+
+        // Orders sending.
+        public function en_custom_post_save($post_content)
+        {
+            $wp_post = array(
+                "post_title" => gmdate("F j, Y, g:i a"),
+                "post_content" => $post_content,
+                "post_excerpt" => 'custom_post',
+                "post_type" => 'en_orders_exporting'
+            );
+
+            wp_insert_post($wp_post, true);
+        }
+
+        // Orders sending.
+        public function en_orders_sending($orders, $en_orders_ids)
+        {
+            $url = 'https://analytic-data.eniture.com/index.php';
+            $post_data = [
+                'serverName' => eniture_ups_small_get_domain(),
+                'licenseKey' => get_option('ups_small_licence_key'),
+                'currencyUnit' => get_option('woocommerce_currency'),
+                'platform' => 'wordpress',
+                'orders' => $orders,
+            ];
+
+            $curl_obj = new Eniture_UPS_Small_Curl_Request();
+            $response = $curl_obj->ups_small_get_curl_response($url, $post_data);
+            $post_content = "Response: " . $response . "<br>Count: " . count($en_orders_ids) . "<br>Orders ID: " . wp_json_encode($en_orders_ids);
+            $this->en_custom_post_save($post_content);
+            return $response;
+        }
+    }
+
+    new Eniture_OrderExport();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-widget.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-widget.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/order-details/en-order-widget.php	(revision 3237693)
@@ -0,0 +1,199 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Order widget page.
+ */
+if (!class_exists('Eniture_OrderWidget')) {
+
+    class Eniture_OrderWidget
+    {
+        public $en_widget_details = [];
+        public $en_free_rate_details = [];
+        public $en_flat_rate_details = [];
+        public $en_account_details = [];
+        public $en_flat_rate_total = 0;
+
+        public function __construct()
+        {
+            add_action('woocommerce_order_actions', [$this, 'en_order_actions'], 10, 2);
+        }
+
+        /**
+         * Assign order details.
+         */
+        function en_order_actions($actions, $order)
+        {
+            $shipping_details = $order->get_items('shipping');
+            foreach ($shipping_details as $item_id => $shipping_item_obj) {
+                $get_formatted_meta_data = $shipping_item_obj->get_formatted_meta_data();
+                foreach ($get_formatted_meta_data as $key => $meta_data) {
+                    switch ($meta_data->key) {
+                        case 'en_fdo_meta_data':
+                            $en_widget_details = json_decode($meta_data->value, true);
+
+                            // Eniture debug mode
+                            do_action("eniture_debug_mood", "Order Widget Details (UPS Small)", $en_widget_details);
+
+                            if (!empty($en_widget_details)) {
+                                $this->en_widget_details[] = $en_widget_details;
+                            }
+                            break;
+                        case 'en_flat_rate_details':
+                            $this->en_flat_rate_details = json_decode($meta_data->value, true);
+                            break;
+                        case 'en_flat_rate_total':
+                            $this->en_flat_rate_total = $meta_data->value;
+                            break;
+                        case 'en_free_rate_details':
+                            $this->en_free_rate_details = json_decode($meta_data->value, true);
+                            break;
+                        case 'en_account_details':
+                            $this->en_account_details = json_decode($meta_data->value, true);
+                            break;
+                    }
+                }
+            }
+
+            add_meta_box('en_additional_order_details', __('Additional Order Details', 'small-package-quotes-ups-edition'), [$this, 'en_order_widget'], get_current_screen()->id, 'side', 'low', 'core');
+
+            return $actions;
+        }
+
+        /**
+         * Show order details.
+         */
+        public function en_show_order_widget($number_shipment, $sender_origin, $label, $cost, $accessorials, $items, $en_extra_accessories)
+        {
+            if (!strlen($sender_origin) > 0) {
+                return;
+            }
+            echo '<h4 style="text-decoration: underline;margin: 4px 0px 4px 0px;">Shipment ' . esc_attr($number_shipment) . " > Origin & Services </h4>";
+            echo '<ul class="en-list" style="list-style: disc;list-style-position: inside;">';
+            echo '<li>';
+
+            echo esc_attr($sender_origin);
+
+            echo '<br>';
+            echo '</li>';
+
+            $label = strlen($label) > 0 ? $label : 'Shipping';
+            echo '<li>' . esc_attr($label) . ': ' . esc_attr($this->en_format_price($cost)) . '</li>';
+
+            /* Show Accessorials */
+            if ($cost > 0) {
+                $this->en_show_accessorials($accessorials);
+            }
+
+            foreach ($en_extra_accessories as $index => $value) {
+                echo '<li>' . esc_attr($index) . ': ' . esc_attr($value) . '</li>';
+            }
+
+            echo "</ul>";
+            echo "<br>";
+            echo '<h4 style="text-decoration: underline;margin: 4px 0px 4px 0px;">Shipment ' . esc_attr($number_shipment) . " > items </h4>";
+            echo '<ul id="product-details-order" class="en-list" style="list-style: disc;list-style-position: inside;">';
+
+            foreach ($items as $key => $item) {
+                echo '<li>' . esc_attr($item) . '</li>';
+            }
+
+            echo '</ul>';
+            echo "<br><br>";
+        }
+
+        /**
+         * Order details.
+         */
+        public function en_order_widget()
+        {
+            if (!empty($this->en_account_details) && is_array($this->en_account_details)) {
+                echo '<h4 style="text-decoration: underline;margin: 4px 0px 4px 0px;"> Shipment Account Number Details:</h4>';
+                echo '<ul class="en-list" style="list-style: disc;list-style-position: inside;">';
+                foreach ($this->en_account_details as $acc_field => $acc_field_val) {
+                    echo '<li>' . esc_attr($acc_field) . ': ' . esc_attr($acc_field_val) . '</li>';
+                }
+                echo '</ul>';
+                return;
+            }
+
+            foreach ($this->en_widget_details as $method_key => $en_widget_details) {
+                $shipments = isset($en_widget_details['data']) ? $en_widget_details['data'] : [];
+                $number_shipment = 1;
+                foreach ($shipments as $count => $shipment) {
+                    if (empty($shipment) || !is_array($shipment)) return [];
+                    
+                    $items = $accessorials = $address = $rate = $en_extra_accessories = [];
+                    extract($shipment);
+
+                    $label = (isset($rate['label'])) ? $rate['label'] : 'Shipping';
+                    $cost = (isset($rate['cost'])) ? $rate['cost'] : 0;
+
+                    $location = $city = $state = $zip = '';
+                    if (!empty($address)) {
+                        extract($address);
+                        $sender_origin = ucwords($location) . ": " . $city . ", " . $state . " " . $zip;
+                    } else {
+                        $sender_origin = $label;
+                    }
+
+                    $items_li = [];
+                    foreach ($items as $key => $item) {
+                        $quantity = $name = '';
+                        extract($item);
+                        $items_li[] = $quantity . " X " . $name;
+                    }
+
+                    $this->en_show_order_widget($number_shipment, $sender_origin, $label, $cost, $accessorials, $items_li, $en_extra_accessories);
+
+                    $number_shipment++;
+                }
+            }
+
+            if (!empty($this->en_flat_rate_details) && $this->en_flat_rate_total > 0) {
+                $this->en_show_order_widget($number_shipment, 'Flat Rate Shipping', 'Flat Rate', $this->en_flat_rate_total, [], $this->en_flat_rate_details, $en_extra_accessories);
+            }
+            if (!empty($this->en_free_rate_details)) {
+                $this->en_show_order_widget($number_shipment, 'Free Rate Shipping', 'Free Rate', [], [], $this->en_free_rate_details, $en_extra_accessories);
+            }
+        }
+
+        /**
+         * Show accessorial on order detail page.
+         * @param array $accessorials
+         */
+        public function en_show_accessorials($accessorials)
+        {
+            $en_accessorials = [
+                'residential' => 'Residential delivery',
+                'liftgate' => 'Lift gate delivery',
+                'hazmat' => 'Hazardous Material',
+                'holdatterminal' => 'Hold At Terminal',
+                'limitedaccess' => 'Limited access delivery',
+                'liftgate_pickup' => 'Lift gate pickup',
+            ];
+
+            foreach ($accessorials as $accessorial => $status) {
+                if ($status && isset($en_accessorials[$accessorial])) {
+                    echo '<li>' . esc_attr($en_accessorials[$accessorial]) . '</li>';
+                }
+            }
+        }
+
+        /**
+         * Price format.
+         * @param int/double/string $dollars
+         * @return string
+         */
+        function en_format_price($dollars)
+        {
+            $currency_symbol = get_woocommerce_currency_symbol(get_option('woocommerce_currency'));
+            return $currency_symbol . number_format(sprintf('%0.2f', preg_replace("/[^0-9.]/", "", $dollars)), 2);
+        }
+    }
+
+    new Eniture_OrderWidget();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/order-details/rates/order-rates.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/order-details/rates/order-rates.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/order-details/rates/order-rates.php	(revision 3237693)
@@ -0,0 +1,105 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Order page rates when click on "Save" OR "Recalculate".
+ */
+if (!class_exists('Eniture_UpsSpqOrderRates')) {
+
+    class Eniture_UpsSpqOrderRates
+    {
+        public $shipping_address = [];
+
+        public function __construct()
+        {
+            add_action('woocommerce_order_before_calculate_totals', [$this, 'en_order_before_calculate_totals'], 10, 2);
+            add_filter('en_order_accessories', [$this, 'en_order_accessories']);
+        }
+
+        // Receiver address along order page.
+        public function en_order_accessories($shipping_address)
+        {
+            return array_merge($this->shipping_address, $shipping_address);
+        }
+
+        // Calculate shipping
+        public function en_order_before_calculate_totals($and_taxes, $order)
+        {
+            global $woocommerce;
+            if (isset($woocommerce->cart)) {
+                $order_recreated = false;
+                $errors = [];
+                $order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
+
+                // Shipping address
+                if (method_exists($order, 'get_address')) {
+                    $shipping_address = $order->get_address('shipping');
+                    (strlen($shipping_address['postcode']) > 0) ? $shipping_address['zip'] = $shipping_address['postcode'] : $errors[] = "Please enter billing or shipping address.";
+                    $this->shipping_address = $shipping_address;
+                    $shipping = $order->get_items('shipping');
+                    foreach ($shipping as $item_id => $per_shipment) {
+                        $method_id = $per_shipment->get_method_id();
+                        switch ($method_id) {
+                            case 'ups_small':
+                                $woocommerce->cart->empty_cart();
+                                $items = $order->get_items();
+                                foreach ($items as $item) {
+                                    $product_id = (isset($item['variation_id']) && !empty($item['variation_id'])) ?
+                                        $item['variation_id'] : $item['product_id'];
+                                    $woocommerce->cart->add_to_cart($product_id, $item['qty']);
+                                    $cart = array('contents' => $woocommerce->cart->get_cart($product_id));
+                                }
+
+                                ((isset($cart['contents'])) && empty($cart['contents']) || (empty($items))) ? $errors[] = "Empty shipping cart content." : '';
+
+                                if (empty($errors)) {
+                                    $shipping_class = new WC_ups_small();
+                                    $response = $shipping_class->calculate_shipping($cart, true);
+                                    if (isset($response) && is_array($response) && !empty($response)) {
+                                        $response = current($response);
+                                    }
+
+                                    if (isset($response['cost']) && $response['cost'] > 0) {
+                                        // Delete old meta data
+                                        foreach ($per_shipment->get_meta_data() as $meta_key => $meta_value) {
+                                            unset($meta_value);
+                                        }
+                                        $per_shipment->update_meta_data('en_free_rate_details', wp_json_encode([]));
+                                        $per_shipment->update_meta_data('en_flat_rate_details', wp_json_encode([]));
+                                        $per_shipment->update_meta_data('en_account_details', wp_json_encode([]));
+                                        $per_shipment->update_meta_data('en_fdo_meta_data', wp_json_encode([]));
+                                        $per_shipment->set_method_title($response['label']);
+                                        $per_shipment->set_method_id($method_id);
+                                        $per_shipment->set_total($response['cost']);
+                                        foreach ($response['meta_data'] as $meta_key => $meta_data) {
+                                            $per_shipment->update_meta_data($meta_key, $meta_data);
+                                        }
+                                        $order_recreated = true;
+                                        $per_shipment->save();
+                                    } else {
+                                        $errors[] = "No Quotes return.";
+                                    }
+
+                                    break;
+                                }
+                        }
+                    }
+                }
+
+                if ($order_recreated) {
+                    $request_data = [
+                        'domain' => eniture_ups_small_get_domain(),
+                        'order_id' => $order_id
+                    ];
+                    $ups_curl_obj = new Eniture_UPS_Small_Curl_Request();
+                    $ups_curl_obj->ups_small_get_curl_response(ENITURE_UPS_SPQ_FDO_HITTING_URL, $request_data);
+                }
+            }
+        }
+    }
+
+    new Eniture_UpsSpqOrderRates();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/product/en-common-product-detail.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/product/en-common-product-detail.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/product/en-common-product-detail.php	(revision 3237693)
@@ -0,0 +1,241 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Product detail page.
+ */
+
+/**
+ * Add and show simple and variable products.
+ * Class Eniture_UpsSpqProductCommonDetail
+ * @package Eniture_UpsSpqProductCommonDetail
+ */
+if (!class_exists('Eniture_UpsSpqProductCommonDetail')) {
+
+    class Eniture_UpsSpqProductCommonDetail
+    {
+        // Insurance
+        public $insurance_disabled_plan = '';
+        public $insurance_plan_required = '';
+
+        /**
+         * Hook for call.
+         * Eniture_UpsSpqProductCommonDetail constructor.
+         */
+        public function __construct()
+        {
+            add_filter('en_app_common_plan_status', [$this, 'en_ups_freight_plan_status'], 10, 1);
+
+            if (!has_filter('en_insurance_filter')) {
+                // Add simple product fields
+                add_action('woocommerce_product_options_shipping', [$this, 'en_show_product_fields'], 101, 3);
+                add_action('woocommerce_process_product_meta', [$this, 'en_save_product_fields'], 101, 1);
+
+                // Add variable product fields.
+                add_action('woocommerce_product_after_variable_attributes', [$this, 'en_show_product_fields'], 101, 3);
+                add_action('woocommerce_save_product_variation', [$this, 'en_save_product_fields'], 101, 1);
+
+                // Check compatible with our old eniture plugins.
+                add_filter('en_insurance_filter', [$this, 'en_compatible_other_eniture_plugins']);
+            }
+        }
+
+        /**
+         * Transportation insight plan status
+         * @param array $plan_status
+         * @return array
+         */
+        public function en_ups_freight_plan_status($plan_status)
+        {
+            $en_plugin_name = 'Small Package Quotes - UPS Edition';
+
+            // Insurance plan status
+            $plan_required = '0';
+            $insurance_status = $en_plugin_name . ': Enabled.';
+            $insurance = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'insurance_fee');
+            if (is_array($insurance)) {
+                $plan_required = '1';
+                $insurance_status = $en_plugin_name . ': Upgrade to Standard Plan to enable.';
+            }
+
+            $plan_status['insurance']['ups_small'][] = 'ups_small';
+            $plan_status['insurance']['plan_required'][] = $plan_required;
+            $plan_status['insurance']['status'][] = $insurance_status;
+
+            return $plan_status;
+        }
+
+        /**
+         * Restrict to show duplicate fields on product detail page.
+         */
+        public function en_compatible_other_eniture_plugins()
+        {
+            return true;
+        }
+
+        /**
+         * Show product fields in variation and simple product.
+         * @param array $loop
+         * @param array $variation_data
+         * @param array $variation
+         */
+        public function en_show_product_fields($loop, $variation_data = [], $variation = [])
+        {
+            $postId = (isset($variation->ID)) ? $variation->ID : get_the_ID();
+            $this->en_custom_product_fields($postId);
+        }
+
+        /**
+         * Save the simple product fields.
+         * @param int $postId
+         */
+        public function en_save_product_fields($postId)
+        {
+            if (isset($postId) && $postId > 0) {
+                $en_product_fields = $this->en_product_fields_arr();
+
+                foreach ($en_product_fields as $key => $custom_field) {
+                    $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : '';
+                    $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash($_POST[$custom_field][$postId])) : '';
+                    $en_updated_product = $custom_field == '_dropship_location' ?
+                        (maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product)) : esc_attr($en_updated_product);
+                    update_post_meta($postId, $custom_field, $en_updated_product);
+                }
+            }
+        }
+
+        /**
+         * Product Fields Array
+         * @return array
+         */
+        public function en_product_fields_arr()
+        {
+            $en_product_fields = [
+                [
+                    'type' => 'checkbox',
+                    'id' => '_en_insurance_fee',
+                    'line_item' => 'insurance',
+                    'class' => '_en_insurance_fee ' . $this->insurance_disabled_plan,
+                    'label' => 'Insure this item',
+                    'plans' => 'insurance_fee',
+                    'description' => $this->insurance_plan_required,
+                ]
+            ];
+
+            // We can use hook for add new product field from other plugin add-on
+            $en_product_fields = apply_filters('en_product_fields', $en_product_fields);
+            return $en_product_fields;
+        }
+
+        /**
+         * Common plans status
+         */
+        public function en_app_common_plan_status()
+        {
+            $plan_status = apply_filters('en_app_common_plan_status', []);
+
+            // Insurance plan status
+            if (isset($plan_status['insurance'])) {
+                if (!in_array(0, $plan_status['insurance']['plan_required'])) {
+                    $this->insurance_disabled_plan = 'disabled_me';
+                    $this->insurance_plan_required = apply_filters("eniture_ups_small_plans_notification_link", [2, 3]);
+                } elseif (isset($plan_status['insurance']['status'])) {
+                    $this->insurance_plan_required = implode(" <br>", $plan_status['insurance']['status']);
+                }
+            }
+        }
+
+        /**
+         * Show Product Fields
+         * @param int $postId
+         */
+        public function en_custom_product_fields($postId)
+        {
+            $this->en_app_common_plan_status();
+            $en_product_fields = $this->en_product_fields_arr();
+
+            // Check compatability hazardous materials with other plugins.
+            if (class_exists("UpdateProductInsuranceDetailOption")) {
+                array_pop($en_product_fields);
+            }
+
+            foreach ($en_product_fields as $key => $custom_field) {
+                $en_field_type = (isset($custom_field['type'])) ? $custom_field['type'] : '';
+                $en_action_function_name = 'en_product_' . $en_field_type;
+
+                if (method_exists($this, $en_action_function_name)) {
+                    $this->$en_action_function_name($custom_field, $postId);
+                }
+            }
+        }
+
+        /**
+         * Dynamic checkbox field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_checkbox($custom_field, $postId)
+        {
+            $custom_checkbox_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'value' => get_post_meta($postId, $custom_field['id'], true),
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+            ];
+
+            if (isset($custom_field['description'])) {
+                $custom_checkbox_field['description'] = $custom_field['description'];
+            }
+
+            woocommerce_wp_checkbox($custom_checkbox_field);
+        }
+
+        /**
+         * Dynamic dropdown field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_dropdown($custom_field, $postId)
+        {
+            $get_meta = get_post_meta($postId, $custom_field['id'], true);
+            $assigned_option = is_serialized($get_meta) ? maybe_unserialize($get_meta) : $get_meta;
+            $custom_dropdown_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+                'value' => $assigned_option,
+                'options' => $custom_field['options']
+            ];
+
+            woocommerce_wp_select($custom_dropdown_field);
+        }
+
+        /**
+         * Dynamic input field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_input_field($custom_field, $postId)
+        {
+            $custom_input_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+                'placeholder' => $custom_field['label'],
+                'value' => get_post_meta($postId, $custom_field['id'], true)
+            ];
+
+            if (isset($custom_field['description'])) {
+                $custom_input_field['desc_tip'] = true;
+                $custom_input_field['description'] = $custom_field['description'];
+            }
+
+            woocommerce_wp_text_input($custom_input_field);
+        }
+    }
+
+    new Eniture_UpsSpqProductCommonDetail();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/product/en-product-detail.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/product/en-product-detail.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/product/en-product-detail.php	(revision 3237693)
@@ -0,0 +1,402 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Product detail page.
+ */
+
+/**
+ * Add and show simple and variable products.
+ * Class Eniture_UpsSpqProductDetail
+ * @package Eniture_UpsSpqProductDetail
+ */
+if (!class_exists('Eniture_UpsSpqProductDetail')) {
+
+    class Eniture_UpsSpqProductDetail
+    {
+        // Hazardous
+        public $hazardous_disabled_plan = '';
+        public $hazardous_plan_required = '';
+
+        /**
+         * Hook for call.
+         * Eniture_UpsSpqProductDetail constructor.
+         */
+        public function __construct()
+        {
+            add_filter('en_app_common_plan_status', [$this, 'en_ups_small_plan_status'], 10, 1);
+
+            if (!has_filter('en_compatible_optimized_product_options') &&
+                !has_filter('En_Plugins_dropship_filter') &&
+                !has_filter('En_Plugins_variable_freight_classification_filter')) {
+                // Add simple product fields
+                add_action('woocommerce_product_options_shipping', [$this, 'en_show_product_fields'], 101, 3);
+                add_action('woocommerce_process_product_meta', [$this, 'en_save_product_fields'], 101, 1);
+
+                // Add variable product fields.
+                add_action('woocommerce_product_after_variable_attributes', [$this, 'en_show_product_fields'], 101, 3);
+                add_action('woocommerce_save_product_variation', [$this, 'en_save_product_fields'], 101, 1);
+
+                // Check compatible with our old eniture plugins.
+                add_filter('En_Plugins_dropship_filter', [$this, 'en_compatible_other_eniture_plugins']);
+                add_filter('En_Plugins_variable_freight_classification_filter', [$this, 'en_compatible_other_eniture_plugins']);
+            }
+
+            $this->add_small_package_quote_fields();
+        }
+
+        /**
+         * Transportation insight plan status
+         * @param array $plan_status
+         * @return array
+         */
+        public function en_ups_small_plan_status($plan_status)
+        {
+            $en_plugin_name = 'Small Package Quotes - UPS Edition';
+
+            // Hazardous plan status
+            $plan_required = '0';
+            $hazardous_material_status = $en_plugin_name . ': Enabled.';
+            $hazardous_material = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'hazardous_material');
+            if (is_array($hazardous_material)) {
+                $plan_required = '1';
+                $hazardous_material_status = $en_plugin_name . ': Upgrade to Standard Plan to enable.';
+            }
+
+            $plan_status['hazardous_material']['ups_small'][] = 'ups_small';
+            $plan_status['hazardous_material']['plan_required'][] = $plan_required;
+            $plan_status['hazardous_material']['status'][] = $hazardous_material_status;
+
+            // Nesting this item
+            $plan_required = '0';
+            $nesting_status = $en_plugin_name . ': Enabled.';
+            $nesting_material = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'nested_material');
+            if (is_array($nesting_material)) {
+                $plan_required = '1';
+                $nesting_status = $en_plugin_name . ': Upgrade to Advanced Plan to enable.';
+            }
+
+            $plan_status['nesting']['ups_small'][] = 'ups_small';
+            $plan_status['nesting']['plan_required'][] = $plan_required;
+            $plan_status['nesting']['status'][] = $nesting_status;
+
+            return $plan_status;
+        }
+
+        /**
+         * Restrict to show duplicate fields on product detail page.
+         */
+        public function en_compatible_other_eniture_plugins()
+        {
+            return true;
+        }
+
+        /**
+         * Show product fields in variation and simple product.
+         * @param array $loop
+         * @param array $variation_data
+         * @param array $variation
+         */
+        public function en_show_product_fields($loop, $variation_data = [], $variation = [])
+        {
+            $postId = (isset($variation->ID)) ? $variation->ID : get_the_ID();
+            $this->en_custom_product_fields($postId);
+        }
+
+        /**
+         * Save the simple product fields.
+         * @param int $postId
+         */
+        public function en_save_product_fields($postId)
+        {
+            if (isset($postId) && $postId > 0) {
+                $en_product_fields = $this->en_product_fields_arr();
+
+                foreach ($en_product_fields as $key => $custom_field) {
+                    $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : '';
+                    $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash( $_POST[$custom_field][$postId] )) : '';
+                    $en_updated_product = $custom_field == '_dropship_location' ?
+                        (maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product)) : esc_attr($en_updated_product);
+                    update_post_meta($postId, $custom_field, $en_updated_product);
+                }
+            }
+        }
+
+        /**
+         * Created dropship list get from db
+         * @return array
+         */
+        public function en_dropship_list()
+        {
+            global $wpdb;
+            $dropship = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "warehouse WHERE location = 'dropship'"), ARRAY_A);
+            $en_dropship_list = [];
+            foreach ($dropship as $list) {
+                $en_nickname = (isset($list['nickname']) && strlen($list['nickname']) > 0) ? $list['nickname'] . ' - ' : '';
+                $en_country = (isset($list['country']) && strlen($list['country']) > 0) ? '(' . $list['country'] . ')' : '';
+                $en_zip = (isset($list['zip']) && strlen($list['zip']) > 0) ? $list['zip'] : '';
+                $en_city = (isset($list['city']) && strlen($list['city']) > 0) ? $list['city'] : '';
+                $en_state = (isset($list['state']) && strlen($list['state']) > 0) ? $list['state'] : '';
+                $location = "$en_nickname $en_zip, $en_city, $en_state $en_country";
+                $en_dropship_list[$list['id']] = $location;
+            }
+
+            return $en_dropship_list;
+        }
+
+        /**
+         * Product Fields Array
+         * @return array
+         */
+        public function en_product_fields_arr()
+        {
+            $en_product_fields = [
+                [
+                    'type' => 'checkbox',
+                    'id' => '_enable_dropship',
+                    'class' => '_enable_dropship',
+                    'line_item' => 'location',
+                    'label' => 'Enable Drop Ship Location',
+                ],
+                [
+                    'type' => 'dropdown',
+                    'id' => '_dropship_location',
+                    'class' => '_dropship_location short',
+                    'line_item' => 'locationId',
+                    'label' => 'Drop ship location',
+                    'options' => $this->en_dropship_list()
+                ],
+                [
+                    'type' => 'input_field',
+                    'id' => '_en_product_markup',
+                    'class' => '_en_product_markup short',
+                    'label' => __( 'Markup', 'small-package-quotes-ups-edition' ),
+                    'placeholder' => 'e.g Currency 1.00 or percentage 5%',
+                    'description' => 'Increases the amount of the returned quote by a specified amount prior to displaying it in the shopping cart. The number entered will be interpreted as dollars and cents unless it is followed by a % sign. For example, entering 5.00 will cause $5.00 to be added to the quotes. Entering 5.00% will cause each quote to be multiplied by 1.05 (= 1 + 5%).'
+                ],
+                [
+                    'type' => 'checkbox',
+                    'id' => '_hazardousmaterials',
+                    'line_item' => 'isHazmatLineItem',
+                    'class' => '_en_hazardous_material ' . $this->hazardous_disabled_plan,
+                    'label' => 'Hazardous material',
+                    'plans' => 'hazardous_material',
+                    'description' => $this->hazardous_plan_required,
+                ]
+            ];
+
+            // Micro Warehouse
+            $all_plugins = apply_filters('active_plugins', get_option('active_plugins'));
+            if (stripos(implode($all_plugins), 'micro-warehouse-shipping.php') || is_plugin_active_for_network('micro-warehouse-shipping-for-woocommerce/micro-warehouse-shipping.php')) {
+                $en_product_fields = array_slice($en_product_fields, 2);
+            }
+
+            // We can use hook for add new product field from other plugin add-on
+            $en_product_fields = apply_filters('en_product_fields', $en_product_fields);
+            return $en_product_fields;
+        }
+
+        /**
+         * Common plans status
+         */
+        public function en_app_common_plan_status()
+        {
+            $plan_status = apply_filters('en_app_common_plan_status', []);
+
+            // Hazardous plan status
+            if (isset($plan_status['hazardous_material'])) {
+                if (!in_array(0, $plan_status['hazardous_material']['plan_required'])) {
+                    $this->hazardous_disabled_plan = 'disabled_me';
+                    $this->hazardous_plan_required = apply_filters("eniture_ups_small_plans_notification_link", [2, 3]);
+                } elseif (isset($plan_status['hazardous_material']['status'])) {
+                    $this->hazardous_plan_required = implode(" <br>", $plan_status['hazardous_material']['status']);
+                }
+            }
+        }
+
+        /**
+         * Show Product Fields
+         * @param int $postId
+         */
+        public function en_custom_product_fields($postId)
+        {
+            $this->en_app_common_plan_status();
+            $en_product_fields = $this->en_product_fields_arr();
+
+            // Check compatability hazardous materials with other plugins.
+            if (class_exists("UpdateProductDetailOption")) {
+                array_pop($en_product_fields);
+            }
+
+            $this->populate_product_fields($en_product_fields, $postId);
+        }
+
+        /**
+         * Dynamic checkbox field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_checkbox($custom_field, $postId)
+        {
+            $custom_checkbox_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'value' => get_post_meta($postId, $custom_field['id'], true),
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+            ];
+
+            if (isset($custom_field['description'])) {
+                $custom_checkbox_field['description'] = $custom_field['description'];
+            }
+
+            woocommerce_wp_checkbox($custom_checkbox_field);
+        }
+
+        /**
+         * Dynamic dropdown field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_dropdown($custom_field, $postId)
+        {
+            $get_meta = get_post_meta($postId, $custom_field['id'], true);
+            $assigned_option = is_serialized($get_meta) ? maybe_unserialize($get_meta) : $get_meta;
+            $custom_dropdown_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+                'value' => $assigned_option,
+                'options' => $custom_field['options']
+            ];
+
+            woocommerce_wp_select($custom_dropdown_field);
+        }
+
+        /**
+         * Dynamic input field show on product detail page
+         * @param array $custom_field
+         * @param int $postId
+         */
+        public function en_product_input_field($custom_field, $postId)
+        {
+            $placeholder = (isset($custom_field['placeholder'])) ? $custom_field['placeholder'] : $custom_field['label'];
+
+            $custom_input_field = [
+                'id' => $custom_field['id'] . '[' . $postId . ']',
+                'label' => $custom_field['label'],
+                'class' => $custom_field['class'],
+                'placeholder' => $placeholder,
+                'value' => get_post_meta($postId, $custom_field['id'], true)
+            ];
+
+            if (isset($custom_field['description'])) {
+                $custom_input_field['desc_tip'] = true;
+                $custom_input_field['description'] = $custom_field['description'];
+            }
+
+            woocommerce_wp_text_input($custom_input_field);
+        }
+
+        /**
+         * Add small package quotes fields
+         */
+        public function add_small_package_quote_fields(){
+            if (!has_filter('en_small_package_quotes_fields')) {
+                // Add simple product fields
+                add_action('woocommerce_product_options_shipping', [$this, 'en_show_spq_fields'], 101, 3);
+                add_action('woocommerce_process_product_meta', [$this, 'en_save_spq_fields'], 101, 1);
+
+                // Add variable product fields.
+                add_action('woocommerce_product_after_variable_attributes', [$this, 'en_show_spq_fields'], 101, 3);
+                add_action('woocommerce_save_product_variation', [$this, 'en_save_spq_fields'], 101, 1);
+
+                // Check compatible with our old eniture plugins.
+                add_filter('en_small_package_quotes_fields', [$this, 'en_small_package_quotes_fields']);
+            }
+        }
+
+        /**
+         * Show product fields in variation and simple product.
+         * @param array $loop
+         * @param array $variation_data
+         * @param array $variation
+         */
+        public function en_show_spq_fields($loop, $variation_data = [], $variation = [])
+        {
+            $postId = (isset($variation->ID)) ? $variation->ID : get_the_ID();
+            $this->en_show_spq_custom_product_fields($postId);
+        }
+
+        /**
+         * Show SPQ Fields
+         * @param int $postId
+         */
+        public function en_show_spq_custom_product_fields($postId)
+        {
+            $this->populate_product_fields($this->en_spq_fields_arr(), $postId);
+        }
+
+        /**
+         * Populate Product Fields
+         */
+        public function populate_product_fields($en_product_fields, $postId){
+            foreach ($en_product_fields as $key => $custom_field) {
+                $en_field_type = (isset($custom_field['type'])) ? $custom_field['type'] : '';
+                $en_action_function_name = 'en_product_' . $en_field_type;
+
+                if (method_exists($this, $en_action_function_name)) {
+                    $this->$en_action_function_name($custom_field, $postId);
+                }
+            }
+        }
+
+        /**
+         * Save SPQ product fields.
+         * @param int $postId
+         */
+        public function en_save_spq_fields($postId)
+        {
+            if (isset($postId) && $postId > 0) {
+                $en_product_fields = $this->en_spq_fields_arr();
+
+                foreach ($en_product_fields as $key => $custom_field) {
+                    $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : '';
+                    $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash( $_POST[$custom_field][$postId] )) : '';
+                    update_post_meta($postId, $custom_field, $en_updated_product);
+                }
+            }
+        }
+
+        /**
+         * SPQ Fields Array
+         * @return array
+         */
+        public function en_spq_fields_arr()
+        {
+            $en_product_fields = [];
+            $transit_restriction_enable_carrier_arr = apply_filters('eniture_check_ground_transit_restrict_status', []);
+            if(count($transit_restriction_enable_carrier_arr) > 0){
+                $en_product_fields[] = [
+                    'type' => 'checkbox',
+                    'id' => '_en_exempt_ground_transit_restriction',
+                    'class' => '_en_exempt_ground_transit_restriction',
+                    'label' => 'Exempt from Ground Transit Time Restriction',
+                ];
+            }
+            return $en_product_fields;
+        }
+
+        /**
+         * Restrict to show duplicate fields on product detail page.
+         */
+        public function en_small_package_quotes_fields()
+        {
+            return true;
+        }
+    }
+
+    new Eniture_UpsSpqProductDetail();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/readme.txt
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/readme.txt	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/readme.txt	(revision 3237693)
@@ -0,0 +1,421 @@
+﻿=== Small Package Quotes - UPS Edition ===
+Contributors: enituretechnology
+Tags: eniture,UPS,parcel rates, parcel quotes, shipping estimates
+Requires at least: 6.6
+Tested up to: 6.7.1
+Stable tag: 4.5.17
+License:           GPL-2.0-or-later
+License URI:       https://www.gnu.org/licenses/gpl-2.0.html
+
+Real-time UPS quotes from UPS. Fifteen day free trial.
+
+== Description ==
+
+UPS is headquartered in Sandy Springs, Georgia and is the world’s largest package delivery company. UPS delivers more than 15 million packages per day to more than 7.9 million customers in more than 220 countries and territories around the world. If you don’t have a UPS account number, contact them at 800-742-5877, or register online[https://www.ups.com/one-to-one/login].
+
+**Key Features**
+
+* Includes negotiated shipping rates in the shopping cart and on the checkout page.
+* Ability to control which UPS small package services to display
+* Support for variable products.
+* Option to include residential delivery surcharge
+* Option to mark up shipping rates by a set dollar amount or by a percentage.
+
+**Requirements**
+
+* WooCommerce 6.4 or newer.
+* A UPS account number.
+* Your username and password to ups.com.
+* Your UPS web services authentication key.
+* An API Key from Eniture Technology.
+
+== Installation ==
+
+**Installation Overview**
+
+Before installing this plugin you should have the following information handy:
+
+* Your UPS account number.
+* Your username and password to ups.com.
+* Your UPS web services authentication key.
+
+If you need assistance obtaining any of the above information, contact your local UPS office
+or call the [UPS](http://ups.com) corporate headquarters at 1-800-333-7400.
+
+A more comprehensive and graphically illustrated set of instructions can be found on the *Documentation* tab at
+[eniture.com](https://eniture.com/woocommerce-ups-small-package/).
+
+**1. Install and activate the plugin**
+In your WordPress dashboard, go to Plugins => Add New. Search for "Small Package Quotes - UPS Edition", and click Install Now.
+After the installation process completes, click the Activate Plugin link to activate the plugin.
+
+**2. Get an API key from Eniture Technology**
+Go to [Eniture Technology](https://eniture.com/woocommerce-ups-small-package/) and pick a
+subscription package. When you complete the registration process you will receive an email containing your API key and
+your login to eniture.com. Save your login information in a safe place. You will need it to access your customer dashboard
+where you can manage your licenses and subscriptions. A credit card is not required for the free trial. If you opt for the free
+trial you will need to login to your [Eniture Technology](http://eniture.com) dashboard before the trial period expires to purchase
+a subscription to the license. Without a paid subscription, the plugin will stop working once the trial period expires.
+
+**3. Establish the connection**
+Go to WooCommerce => Settings => UPS. Use the *Connection* link to create a connection to your UPS account.
+
+**5. Select the plugin settings**
+Go to WooCommerce => Settings => UPS. Use the *Quote Settings* link to enter the required information and choose
+the optional settings.
+
+**6. Enable the plugin**
+Go to WooCommerce => Settings => Shipping. Click edit for shipping zone you want to add UPS. Click Add Shipping Method. Select UPS from dropdown. Click "Add Shipping Method" button. 
+
+**Third-Party Services
+This plugin relies on the following third-party services to provide some functionalities:
+
+Eniture Technology APIs (https://eniture.com): Used for functionalities like retrieving shipping rates and managing connections.
+Terms of Service: link https://eniture.com/eniture-technology-terms-of-use/
+Privacy Policy: https://eniture.com/eniture-llc-privacy-policy/
+
+FreightDesk.Online (https://freightdesk.online): Used for functionalities like applying promo code status. Only when a user have an account on freightdesk.online.
+Privacy Policy: https://freightdesk.online/privacy-statement
+
+Validate Addresses (https://validate-addresses.com): Used for functionalities like applying and using promo codes, only when user have an acount on validate addresses portal. 
+Terms of Service: https://validate-addresses.com/terms-of-use
+Privacy Policy: https://validate-addresses.com/privacy-statement
+
+
+== Frequently Asked Questions ==
+
+= How do I get a UPS account number? =
+
+Contact them at 800-742-5877, or register online.
+
+= Where do I find my UPS.com username and password? =
+
+Contact UPS customer service at 800-742-5877 or the UPS account manager assigned to your account.
+
+
+= Where do I get my UPS API Access Key? =
+
+Obtaining a UPS API Access Key is done on UPS.com and requires a few steps. Refer to the Documentation tab on this page for detailed instructions.
+
+= Why do I sometimes get a message that a shipping rate estimate couldn’t be provided? =
+
+There are several possibilities:
+
+UPS has restrictions on a shipment’s maximum weight, length and girth which your shipment may have exceeded.
+
+There wasn’t enough information about the weight or dimensions for the products in the shopping cart to retrieve a shipping rate estimate.
+
+The city entered for the shipping address may not be valid for the postal code entered. A valid City+State+Postal Code combination is required to retrieve a rate estimate and Shopify does not perform this level of address validation. Contact us by phone (404-369-0680) or email (support@eniture.com) to inquire about solutions to this problem.
+
+The UPS web service isn’t operational.
+
+Your UPS account has been suspended or cancelled.
+
+Your subscription to the application has expired because payment could not be processed.
+
+There is an issue with the Eniture Technology servers.
+
+There is an issue with the Shopify servers.
+
+= Why were the shipment charges I received on the invoice from UPS different than what was quoted by the plugin? =
+
+Common reasons include one of the shipment parameters (weight, dimensions) is different, or additional services (such as residential 
+delivery) were required. Compare the details of the invoice to the shipping settings on the products included in the shipment. 
+Consider making changes as needed. Remember that the weight of the packing materials is included in the billable weight for the shipment. 
+If you are unable to reconcile the differences call your local UPS office for assistance.
+
+= Why do I sometimes get a message that a shipping rate estimate couldn’t be provided? =
+
+There are several possibilities:
+
+* UPS has restrictions on a shipment’s maximum weight, length and girth which your shipment may have exceeded.
+* There wasn’t enough information about the weight or dimensions for the products in the shopping cart to retrieve a shipping rate estimate.
+* The UPS web service isn’t operational.
+* Your UPS account has been suspended or cancelled.
+* Your Eniture Technology API key for this plugin has expired.
+
+== Screenshots ==
+
+1. Quote settings page
+2. Warehouses and Drop Ships page
+3. Quotes displayed in cart
+
+== Changelog ==
+
+= 4.5.17 =
+* Update:  Added a new "Review Plugin" button for improved user feedback and engagement.
+* Update:  Override Rates Shipping Rule: added Negative & Percentage Service Rate.
+* Update:  Restrict To Location Rule: Introduced filters support.
+* Update:  Minimum Shipping Charge Rule: Implemented a new rule to set a minimum charge for shipping.
+* Update:  Free Shipping Rule: Added functionality to allow free shipping conditions based on configured rules.
+* Fix: Export Products Functionality: Fixed issues with old nested material attributes of products to ensure accurate exports.
+* Fix:Security Enhancements: Resolved vulnerability issues for improved plugin security and compliance.
+* Fix:Request Parameters Sanitization: Improved sanitization in shipping rules to enhance data integrity
+
+
+= 4.5.16 =
+* Fix: Fixed order the shipping rule "Type" alphabetically. 
+
+= 4.5.15 =
+* Fix: Fixed an issue with double quotes in product names affecting log to display.
+
+= 4.5.14 =
+* Fix: Fixed issue with getting product shipping class.
+
+= 4.5.13 =
+* Fix: Fixed issues with overriding shipping rules and handling multiple shipments.
+
+= 4.5.11 =
+* Fix: Fixed delivery estimate string 
+
+= 4.5.10 =
+* Fix: Fixed conflict with LTL plugins.
+
+= 4.5.9 = 
+* Fix: Fixed issues reported by WordPress team
+
+= 4.5.8 = 
+* Update: Implements changes to enable free shipping for override rate shipping rules.
+
+= 4.5.7 = 
+* Update: Updated connection tab according to WordPress requirements 
+
+= 4.5.6 = 
+* Fix: Fixed issues with escape characters in product names.
+
+= 4.5.5 = 
+* Update: Fixes rates not showing for Puerto richo 
+
+= 4.5.4 = 
+* Update: Compatibility with WordPress version 6.5.2
+* Update: Compatibility with PHP version 8.2.0
+* Update: Introduced an additional option to packaging method when standard boxes is not in use
+
+= 4.5.3 = 
+* Update: Introduced quotes overriding shipping rules.
+* Update: Enables merchants to save delivery estimate labels in the plugin settings and display them during checkout.
+
+= 4.5.2 = 
+* Update: Resolved Ground Freight Pricing (GFP) API response changed.
+
+= 4.5.1 =
+* Update: Resolved a CSS conflict with other Eniture Technology plugins
+
+= 4.5.0 =
+* Update: Introduced Shipping Rules feature
+
+= 4.4.2 =
+* Update: Revised the number format for length, width, and height to ensure consistency with other Eniture Technology parcel plugins.
+
+= 4.4.1 =
+* Update: Suppress parcel(UPS) rates when the weight threshold is met for LTL Freight Quotes.
+
+= 4.4.0 =
+* Update: Display “Free Shipping” at checkout when handling fee in the quote settings is -100% .
+* Update: Introduced the Shipping Logs feature.
+* Fix: Markup fee applied to shipping quotes in the following order; 1) Product-specific Mark Up (Product settings); 2) Location-specific Handling Fee / Mark Up (Warehouse settings) and 3) General Handling Fee / Mark Up (Quote settings).
+
+= 4.3.11 =
+* Fix: Fixed the product ID and product title in the metadata required for freightdesk.online
+
+= 4.3.10 =
+* Update: Changed required plan from standard to basic for delivery estimate options.
+
+= 4.3.9 =
+* Update: Compatibility with WooCommerce HPOS(High-Performance Order Storage)
+
+= 4.3.8 =
+* Fix: Compatibility of rounding function with PHP 7.4
+
+= 4.3.7 =
+* Fix: Remove rounding of dimensions values.
+
+= 4.3.6 =
+* Update: Introduced an option in quote settings for hazardous fee a)hazardous items ship as its own packages b) Apply hazardous fee on packages that have hazardous items.
+
+= 4.3.5 =
+* Update: Introduced filters for weight and dimensions. 
+
+= 4.3.4 =
+* Update: Apply hazardous fee on packages that have hazardous items instead of the whole shipment.
+
+= 4.3.3 =
+* Update: Fixed grammatical mistakes in "Ground transit time restrictions" admin settings.
+
+= 4.3.2 =
+* Update: Introduced username and password fields on connection settings field. 
+
+= 4.3.1 =
+* Update: Introduced a setting in Quote Setting tab to show negotiated VS List rates on the cart/checkout. 
+
+= 4.3.0 =
+* Update: Introduced optimizing space utilization.
+* Update: Modified expected delivery message at front-end from “Estimated number of days until delivery” to “Expected delivery by”.
+* Fix: Inherent Flat Rate value of parent to variations.
+
+= 4.2.1 =
+* Fix: Right selection of the API for quotes.
+
+= 4.2.0 =
+* Update: Introduced UPS new API AOuth process.
+
+= 4.1.3 =
+* Update: Introduced a settings on product page to Exempt ground Transit Time restrictions.
+
+= 4.1.2 =
+* Update: Added compatibility with "Address Type Disclosure" in Residential address detection 
+
+= 4.1.1 =
+* Update: Added origin level markup. 
+
+= 4.1.0 =
+* Update: Added product level markup. 
+
+= 4.0.9 =
+* Fix: Fixed LTL weight threshold set to all the weight units  
+
+= 4.0.8 =
+* Update: Added support for the setting “Only show LTL rates if the parcel shipment weight exceeds the weight threshold” found in Eniture Technology’s family of LTL Freight Quotes plugins.
+
+= 4.0.7 =
+* Update: Conflict resolved with “Flexible Product Fields” plugin
+
+= 4.0.6 =
+* Update: Introduced connectivity from the plugin to FreightDesk.Online using Company ID
+
+= 4.0.5 =
+* Update: Compatibility with WordPress version 6.0.
+* Update: Included tabs for freightdesk.online and validate-addresses.com
+
+= 4.0.4 =
+* Update: Compatibility with PHP version 8.1.
+* Update: Compatibility with WordPress version 5.9.
+
+
+= 4.0.3 =
+* Update: Compatibility with preferred origin custom work.
+* Fix: Fixes for PHP version 8.0.
+
+= 4.0.2 =
+* Update: Introduced debug logs tab.
+* Fix: In case of multiply shipment, wil show rates if all shipments will return rates. 
+
+= 4.0.1 =
+* Fix: Fixed delivery days options.
+* Update: added data analysis.
+
+= 4.0.0 =
+* Update: Compatibility with PHP version 8.0
+* Update: Compatibility with WordPress version 5.8
+* Fix: Corrected product page URL in connection settings tab
+
+= 3.6.1 =
+* Update: Updates to the description of UPS contract services supported by the plugin.
+
+= 3.6.0 =
+* Update: Added feature "Weight threshold limit".
+* Update: Added feature In-store pickup with terminal information.
+
+= 3.5.0 =
+* Update: Added images URL for FDO portal.
+* Update: CSV columns updated.
+* Update: Virtual product details added in order meta data.
+* Update: Compatibility with shippable addon.
+
+= 3.4.1 =
+* Update: Added compatibility with WP 5.7, compatibility with shippable ad-don, compatibility with account number ad-don fields showing on the checkout page.
+
+= 3.4.0 =
+* Update: Compatibility with WordPress 5.6
+
+= 3.3.9 =
+* Fix: Fixed In Store and Local delivery as an default selection.
+
+= 3.3.8 =
+* Update: Compatibility with WordPress 5.5, Compatibility with shipping solution freightdesk.online and added a link in plugin to get updated plans from eniture.com.
+
+= 3.3.7 =
+* Fix: Fixed database query to created warehouse table
+
+= 3.3.6 =
+* Fix: Resolved conflict with third party plugin.
+
+= 3.3.5 =
+* Fix: Compatibility with Eniture Technology Freight plugins
+
+= 3.3.4 =
+* Update: Compatibility with WordPress 5.4
+
+= 3.3.3 =
+* Update: Ignore items with given Shipping Class(es).
+
+= 3.3.2 =
+* Update: Introduced Features: 1) Multi Packaging. 2) Box Fee. 3) Programming improved for order detail widget.
+
+= 3.3.1 =
+* Fix: Fixed UI of quote settings tab.
+
+= 3.3.0 =
+* Update: Introduce product nesting property feature. 
+
+= 3.2.3 =
+* Fix: Fix compatibility issue with Standard Box Sizes Addon. 
+
+= 3.2.2 =
+* Update: Relocation of auto residential address detection settings. 
+
+= 3.2.1 =
+* Fix: Fixed compatibility issue with Eniture Technology LTL Freight Quotes plugins.
+
+= 3.2.0 = 
+* Update: This update introduces: 1 Compatibility for the WooCommerce Measurement Price Calculator plugin; 2. The ability to mark up individual services; 3. Improved support for UPS Contract Services; 4) Customizable error message in the event the plugin is unable to retrieve rates from UPS; 5) An option to disable the sorting of shipping rates by price in ascending order.  The update also fixes a compatibility issue with the Residential Address Detection plugin.
+
+= 3.1.0 = 
+* Update: Introduced settings to control quotes sorting on frontend
+
+= 3.0.4 = 
+* Update: Introduced settings for frontend message when shipping cannot be calculated 
+
+= 3.0.3 =
+* Update: Introduced new feature, shipping rates estimates on manual orders.
+
+= 3.0.2 =
+* Update: Compatibility with WordPress 5.1
+
+= 3.0.1 =
+* Fix: Identify one warehouse and multiple drop ship locations in basic plan.
+
+= 3.0.0 =
+* Update: Introduced new features and Basic, Standard and Advanced plans.
+
+= 2.1.2 =
+* Update: Compatibility with WordPress 5.0
+
+= 2.1.1 =
+* Update: Compatibility with WooCommerce 3.4.2 and PHP 7.1.
+
+= 2.1.0 =
+* Update: Added new subscription options for Residential Address Detection plug-in and Standard Box Sizes plug-in
+
+= 2.0.1 =
+* Fix: Corrected headings CSS 
+
+= 2.0.0 =
+* Update: Introduction of Standard Box Sizes and Residential Address Detection features which are enabled though the installation of plugin add ons.
+
+= 1.1.3 =
+* Fix: Fixed issue with CSS on textarea 
+
+= 1.1.2 =
+* Fix: CSV export conflict with LTL plugin 
+
+= 1.1.1 =
+* Fix: Fixed issue with new reserved word in PHP 7.1
+
+= 1.1.0 =
+* Update: Compatibility with WordPress 4.9
+
+= 1.0 =
+* Initial release.
+
+== Upgrade Notice ==
Index: /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/css/shipping_rules.css
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/css/shipping_rules.css	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/css/shipping_rules.css	(revision 3237693)
@@ -0,0 +1,57 @@
+.en_sr_add_btn {
+	display: flex;
+	justify-content: flex-end;
+}
+
+.en_sr_form_control {
+	display: flex;
+	flex-direction: column;
+	padding: 10px;
+	flex: 1;
+}
+
+.en_sr_form_control label {
+	font-weight: 500 !important;
+	margin-bottom: 5px !important;
+}
+
+.en_sr_form_control #en_ups_small_filter_by_state_label,
+.en_sr_form_control #en_ups_small_filter_by_origin_label,
+.en_sr_form_control #en_ups_small_filter_by_sevices_label,
+.en_sr_form_control #en_ups_small_msc_filter_by_sevices_label {
+	margin-bottom: -15px !important;
+}
+
+.en_sr_form_control input[type='text'] {
+	padding: 4px;
+}
+
+.en_sr_form_control select {
+	max-width: 100% !important;
+}
+
+.group_sr_form_control {
+	display: flex;
+	justify-content: space-between;
+	flex-wrap: wrap;
+}
+
+.en_sr_err {
+	color: red !important;
+	font-size: 11px;
+}
+
+.en_shipping_rules_setting_section p.submit {
+	display: none !important;
+}
+
+label[for='en_sr_service_name']::after,
+label[for='en_ups_small_sr_service_rate']::after,
+label[for='en_ups_small_filter_by_state']::after,
+label[for='en_ups_small_filter_by_origin']::after,
+label[for='en_ups_small_filter_by_sevices']::after,
+label[for='en_ups_small_msc_filter_by_sevices']::after,
+label[for='en_sr_minimum_shipping_charge']::after {
+	content: ' *';
+	color: red;
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/js/shipping_rules.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/js/shipping_rules.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/assets/js/shipping_rules.js	(revision 3237693)
@@ -0,0 +1,823 @@
+jQuery(document).ready(function () {
+	const form = jQuery('#add_shipping_rule');
+	if (form) {
+		form.on('submit', enUpsSmallSaveShippingRule);
+	}
+
+	// Hide add shipping rule form on page load
+	if (window.location.hash.includes('en_wd_add_warehouse_btn')) window.location.hash = '';
+
+	const rule_types = {
+		free_shipping: 'Free Shipping',
+		hide_methods: 'Hide Methods',
+		hide_methods_by_origin_location: 'Hide Methods By Origin',
+		large_cart_settings: 'Large Cart Settings',
+		minimum_shipping_charge: 'Minimum Shipping Charge',
+		override_rates: 'Override Rates',
+		restrict_to_state: 'Restrict To State',
+	};
+
+	enUpsSmalltoggleRuleTypeFields();
+	enUpsSmallSetStatesValidation(false, true);
+
+	jQuery('#en_sr_add_shipping_rule_btn').on('click', function () {
+		form[0]?.reset();
+		jQuery('.en_sr_err').html('');
+		setDataAttribute(
+			'en_sr_weight_from',
+			'en_sr_price_from',
+			'en_sr_quantity_from',
+			'en_sr_product_tags_list',
+			'en_sr_service_name',
+			'en_ups_small_sr_service_rate',
+			'en_sr_max_items',
+			'en_sr_max_weight_per_package'
+		);
+		jQuery('#en_sr_product_tags_list').val('');
+		jQuery('.select2-selection__choice').hide();
+		jQuery('#edit_sr_form_id').val('');
+		jQuery('.content').animate({ scrollTop: 0 }, 0);
+		// Restrict to state
+		jQuery('#en_ups_small_sr_country').val('US');
+		jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').val([]);
+		jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').val([]);
+		// Hide methods by origin location
+		jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val([]);
+		jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val([]);
+		// Override rates
+		jQuery('#en_ups_small_or_sr_country').val('');
+		jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val([]);
+		jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val([]);
+		// Minimum shipping charge
+		jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val([]);
+
+		enUpsSmalltoggleRuleTypeFields();
+		
+		// Restrict to state
+		enUpsSmallToggleCountryStates();
+		enUpsSmallSetStatesValidation(false, true);
+
+		// Override rates shipping rule
+		enUpsSmallORToggleCountryStates();
+	});
+
+	jQuery('#en_ups_small_rule_type').on('change', enUpsSmalltoggleRuleTypeFields);
+
+	jQuery(
+		'#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_max_items, #en_sr_max_weight_per_package, #en_sr_minimum_shipping_charge'
+	).keypress(function (e) {
+		if (!String.fromCharCode(e.keyCode).match(/^[0-9.]+$/)) return false;
+	});
+	jQuery('#en_sr_quantity_from, #en_sr_quantity_to').keypress(function (e) {
+		if (!String.fromCharCode(e.keyCode).match(/^[0-9]+$/)) return false;
+	});
+	jQuery('#en_ups_small_sr_service_rate').keypress(function (e) {
+		if (!String.fromCharCode(e.keyCode).match(/^[0-9.%+-]+$/)) return false;
+	});
+
+	// Restrict to state
+	enUpsSmallToggleCountryStates();
+	jQuery('#en_ups_small_sr_country').on('change load', function() {
+		enUpsSmallToggleCountryStates();
+		enUpsSmallSetStatesValidation(true, false);
+	});
+
+	// Override rates shipping rule
+	enUpsSmallORToggleCountryStates();
+	jQuery('#en_ups_small_or_sr_country').on('change load', enUpsSmallORToggleCountryStates);
+	jQuery('#filter_by_country_or').on('change', function () {
+		!this.checked && jQuery('#filter_by_state_or').prop('checked', false);
+	});
+	jQuery('#filter_by_state_or').on('change', function () {
+		this.checked && jQuery('#filter_by_country_or').prop('checked', true);
+	});
+
+	jQuery('#en_ups_small_filter_by_country').on('change load', function () {
+		// if country is unchecked, then uncheck state also
+		if (!this.checked) jQuery('#en_ups_small_filter_by_state').prop('checked', false);
+	});
+	jQuery('#en_ups_small_filter_by_state').on('change', function () {
+		this.checked && jQuery('#en_ups_small_filter_by_country').prop('checked', this.checked);
+	});
+
+	jQuery(
+		'#filter_by_weight, #en_sr_filter_price, #filter_by_quantity, #filter_by_vendor, #filter_by_product_tag'
+	).on('change', function () {
+		const id = this.id;
+
+		if (this.checked) {
+			if (id === 'filter_by_weight') removeDataAttribute('en_sr_weight_from');
+			else if (id === 'en_sr_filter_price') removeDataAttribute('en_sr_price_from');
+			else if (id === 'filter_by_quantity') removeDataAttribute('en_sr_quantity_from');
+			else if (id === 'filter_by_vendor') removeDataAttribute('en_vendor_filter_value');
+			else if (id === 'filter_by_product_tag') removeDataAttribute('en_sr_product_tags_list');
+			// else if (id === 'en_ups_small_filter_by_state') enUpsSmallSetStatesValidation(true);
+		} else {
+			if (id === 'filter_by_weight') setDataAttribute('en_sr_weight_from');
+			else if (id === 'en_sr_filter_price') setDataAttribute('en_sr_price_from');
+			else if (id === 'filter_by_quantity') setDataAttribute('en_sr_quantity_from');
+			else if (id === 'filter_by_vendor') setDataAttribute('en_vendor_filter_value');
+			else if (id === 'filter_by_product_tag') setDataAttribute('en_sr_product_tags_list');
+			// else if (id === 'en_ups_small_filter_by_state') enUpsSmallSetStatesValidation();
+		}
+	});
+
+	jQuery(document).on('click', '.en_ups_sr_edit_link', function () {
+		const id = jQuery(this).attr('data-id');
+		enUpsSmallEditShippingRule(id, this);
+	});
+	jQuery(document).on('click', '.en_ups_sr_delete_link', function () {
+		const id = jQuery(this).attr('data-id');
+		enUpsSmallDeleteShippingRule(id, this);
+	});
+	jQuery(document).on('click', '.en_ups_sr_status_link', function (e) {
+		enUpsSmallUpdateShippingRuleStatus(this);
+	});
+
+	function setDataAttribute(...attr_ids) {
+		for (let id of attr_ids) {
+			jQuery('#' + id).attr('data-optional', '1');
+		}
+	}
+
+	function removeDataAttribute(...attr_ids) {
+		for (let id of attr_ids) {
+			jQuery('#' + id).removeAttr('data-optional');
+		}
+	}
+
+	// #region: Validate rule form data
+	function enUpsSmallSRValidateInput(form_id = '') {
+		let is_valid = true;
+		let input = (response = errorText = optional = errorElement = to = '');
+
+		jQuery('#en_sr_service_name').parent().find('.en_sr_err').html('');
+
+		let state_check = false;
+
+		jQuery(form_id + " input[type='text']").each(function () {
+			input = jQuery(this).val();
+			response = enUpsSmallValidateString(input);
+			errorText = jQuery(this).attr('title');
+			optional = jQuery(this).attr('data-optional');
+			errorElement = jQuery(this).parent().find('.en_sr_err');
+
+			if (this?.className?.includes('select2-search__field') && !state_check) {
+				const id = jQuery('#en_ups_small_sr_country').val() === 'US' ? '.en_ups_small_sr_us_states_list #en_sr_states_list' : '.en_ups_small_sr_ca_states_list #en_sr_states_list';
+				input = jQuery(id).val();
+				response = input?.length > 0 ? true : 'empty';
+				errorText = jQuery(id).attr('title');
+				optional = jQuery(id).attr('data-optional');
+				errorElement = jQuery(id).parent().find('.en_sr_err');
+				state_check = true;
+			}
+
+			if (this?.className?.includes('select2-search__field') && !errorText?.includes('States')) {
+				const id = '#en_sr_product_tags_list';
+				input = jQuery(id).val();
+				response = input?.length > 0 ? true : 'empty';
+				errorText = jQuery(id).attr('title');
+				optional = jQuery(id).attr('data-optional');
+				errorElement = jQuery(id).parent().find('.en_sr_err');
+			}
+
+			jQuery(errorElement).html('');
+
+			optional = optional === undefined ? 0 : 1;
+			errorText = errorText != undefined ? errorText : '';
+
+			if (optional == 0 && (response == false || response == 'empty')) {
+				const word = errorText?.includes('States') ? 'are' : 'is';
+				errorText = response == 'empty' ? `${errorText} ${word} required.` : 'Invalid input.';
+				jQuery(errorElement).html(errorText);
+			} else {
+				errorText = '';
+			}
+
+			is_valid = response != true && optional == 0 ? false : is_valid;
+
+			if (!errorText && input) {
+				if (
+					['en_sr_weight_from', 'en_sr_price_from', 'en_sr_quantity_from'].includes(
+						this.id
+					)
+				) {
+					const title =
+						this.id === 'en_sr_weight_from'
+							? 'weight'
+							: this.id === 'en_sr_price_from'
+							? 'price'
+							: 'quantity';
+					to =
+						title === 'weight'
+							? '#en_sr_weight_to'
+							: title === 'price'
+							? '#en_sr_price_to'
+							: '#en_sr_quantity_to';
+					to = jQuery(to).val();
+
+					if (to && +input >= +to) {
+						errorText = `From ${title} cannot be greater than or equal to To ${title}.`;
+						jQuery(errorElement).html(errorText);
+						is_valid = false;
+					}
+				}
+			}
+		});
+
+		// validate service name select field
+		if (jQuery('#en_ups_small_rule_type').val() === rule_types.override_rates) {
+			const serviceName = jQuery('#en_sr_service_name').val();
+			if (!serviceName) {
+				is_valid = false;
+				jQuery('#en_sr_service_name')
+					.parent()
+					.find('.en_sr_err')
+					.html('Service is required.');
+			}
+		}
+
+		return is_valid;
+	}
+
+	function enUpsSmallValidateString(string) {
+		return string == '' ? 'empty' : true;
+	}
+
+	// #region: Save Shipping Rule
+	function enUpsSmallSaveShippingRule(e) {
+		e.preventDefault();
+		jQuery('.en_ups_small_sr_form .en_sr_err').html('');
+
+		let is_valid = enUpsSmallSRValidateInput('#add_shipping_rule');
+		const rule_type = jQuery('#en_ups_small_rule_type').val();
+		
+		// Check if max weight is greater than 150 for large cart settings shipping rule
+		if (rule_type === rule_types.large_cart_settings && jQuery('#en_sr_max_weight_per_package').val() > 150) {
+			jQuery('#en_sr_max_weight_per_package').parent().find('.en_sr_err').html(
+				'Max weight per package cannot be greater than 150 lbs.'
+			);
+			is_valid = false;
+		}
+
+		// apply required field validations for override rates rule
+		if (rule_type === rule_types.override_rates) {
+			const validate = enUpsSmallORValidations();
+			is_valid = is_valid && validate;
+		}
+
+		// apply required field validations for hide methods by origin location rule
+		if (rule_type === rule_types.hide_methods_by_origin_location) {
+			const validate = enUpsSmallHMBLValidations();
+			is_valid = is_valid && validate;
+		}
+
+		// apply required field validations for minimum shipping charge rule
+		if (rule_type === rule_types.minimum_shipping_charge) {
+			const validate = enUpsSmallMSCValidations();
+			is_valid = is_valid && validate;
+		}
+
+		if (!is_valid) {
+			jQuery('.content').delay(200).animate({ scrollTop: 0 }, 300);
+			return false;
+		}
+		
+		const restrict_state_rule = rule_type === rule_types.restrict_to_state;
+		const states_value = jQuery('#en_ups_small_sr_country').val() === 'US' ? jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').val() : jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').val();
+
+		const hide_methods_by_origin_rule = rule_type === rule_types.hide_methods_by_origin_location;
+		const origins_value = hide_methods_by_origin_rule ? jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val() : [];
+		const services_value = hide_methods_by_origin_rule ? jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val() : [];
+		// Override rates rule
+		const or_rule = rule_type === rule_types.override_rates;
+		let or_states_values = [];
+		or_states_values = jQuery('#en_ups_small_or_sr_country').val() === 'US' ? jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val(): or_states_values;
+		or_states_values = jQuery('#en_ups_small_or_sr_country').val() === 'CA' ? jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val(): or_states_values;
+		// Minimum shipping charge rule
+		const msc_rule = rule_type === rule_types.minimum_shipping_charge;
+
+		// Submit the form to save settings
+		const postData = {
+			action: 'en_save_shipping_rule',
+			wp_nonce: sr_script.nonce,
+			rule_id: jQuery('#edit_sr_form_id').val(),
+			name: jQuery('#en_sr_rule_name').val(),
+			type: rule_type,
+			is_active: Number(jQuery('#en_sr_avialable').prop('checked')),
+			settings: {
+				filter_name: '',
+				apply_to: jQuery('input[name="apply_to"]:checked').val(),
+				// Filter by country
+				filter_by_country: restrict_state_rule,
+				filter_by_country_value: restrict_state_rule ? jQuery('#en_ups_small_sr_country').val() : '',
+				// Filter by state
+				filter_by_state: restrict_state_rule,
+				filter_by_state_value: restrict_state_rule ? states_value : [],
+				// Filter by weight
+				filter_by_weight: jQuery('#filter_by_weight').prop('checked'),
+				filter_by_weight_from: jQuery('#en_sr_weight_from').val(),
+				filter_by_weight_to: jQuery('#en_sr_weight_to').val(),
+				// Filter by price
+				filter_by_price: jQuery('#en_sr_filter_price').prop('checked'),
+				filter_by_price_from: jQuery('#en_sr_price_from').val(),
+				filter_by_price_to: jQuery('#en_sr_price_to').val(),
+				// Filter by quantity
+				filter_by_quantity: jQuery('#filter_by_quantity').prop('checked'),
+				filter_by_quantity_from: jQuery('#en_sr_quantity_from').val(),
+				filter_by_quantity_to: jQuery('#en_sr_quantity_to').val(),
+				// Filter by product tag
+				filter_by_product_tag: jQuery('#filter_by_product_tag').prop('checked'),
+				filter_by_product_tag_value: jQuery('#en_sr_product_tags_list').val(),
+				// Service info
+				service: or_rule ? jQuery('#en_sr_service_name').val() : '',
+				service_rate: or_rule ? jQuery('#en_ups_small_sr_service_rate').val() : '',
+				// Large cart settings
+				max_items: jQuery('#en_sr_max_items').val(),
+				max_weight_per_package: jQuery('#en_sr_max_weight_per_package').val(),
+				// Hide methods by origin location
+				filter_by_origin: hide_methods_by_origin_rule,
+				filter_by_origin_value: hide_methods_by_origin_rule ? origins_value : [],
+				filter_by_service: hide_methods_by_origin_rule,
+				filter_by_service_value: hide_methods_by_origin_rule ? services_value : [],
+				// Override rates country and state filters
+				filter_by_country_or: or_rule ? jQuery('#filter_by_country_or').prop('checked') : false,
+				filter_by_country_value_or: or_rule ? jQuery('#en_ups_small_or_sr_country').val() : '',
+				filter_by_state_or: or_rule ? jQuery('#filter_by_state_or').prop('checked') : false,
+				filter_by_state_value_or: or_rule ? or_states_values : [],
+				// Minimum shipping charge
+				minimum_shipping_charge: msc_rule ? jQuery('#en_sr_minimum_shipping_charge').val() : '',
+				minimum_shipping_charge_services: msc_rule ? jQuery('#en_msc_sr_services_list').val() : [],
+			},
+		};
+
+		jQuery.ajax({
+			type: 'POST',
+			url: ajaxurl,
+			data: postData,
+			dataType: 'json',
+			beforeSend: function () {
+				jQuery('.save_shipping_rule_form').addClass('spinner_disable').val('Loading...');
+			},
+			success: function (data) {
+				jQuery('.save_shipping_rule_form').removeClass('spinner_disable').val('Save');
+				const rowMarkup = enUpsSmallGetRowMarkup({ ...data, ...postData });
+				jQuery('.en_ups_empty_sr_row').hide();
+
+				if (data.insert_qry == 1) {
+					const newRowMarkup = `<tr id='sr_row_${data.id}' class="en_ups_sr_row">${rowMarkup}</tr>`;
+					jQuery('#en_ups_shipping_rules_list tbody').append(newRowMarkup);
+					window.location.href = jQuery('.close').attr('href');
+					jQuery('.sr_created').show('slow').delay(3000).hide('slow');
+				} else if (data.update_qry == 1) {
+					jQuery(`#sr_row_${data.id}`).html(rowMarkup);
+					window.location.href = jQuery('.close').attr('href');
+					jQuery('.sr_updated').show('slow').delay(3000).hide('slow');
+				} else if (data.error) {
+					jQuery('.sr_already_exist').show('slow');
+					jQuery('.content').delay(200).animate({ scrollTop: 0 }, 300);
+					setTimeout(function () {
+						jQuery('.sr_already_exist').hide('slow');
+					}, 3000);
+				}
+			},
+			error: function (error) {
+				jQuery('.save_shipping_rule_form').removeClass('spinner_disable').val('Save');
+			},
+		});
+
+		return false;
+	}
+
+	// #region: Edit Shipping Rule
+	/**
+	 * Edit Shipping Rule
+	 * @param event
+	 * @returns {Boolean}
+	 */
+	function enUpsSmallEditShippingRule(rule_id, elem) {
+		form[0]?.reset();
+		jQuery('.en_sr_err').html('');
+		setDataAttribute(
+			'en_sr_weight_from',
+			'en_sr_price_from',
+			'en_sr_quantity_from',
+			'en_sr_product_tags_list'
+		);
+		jQuery('#en_sr_product_tags_list').val('');
+		jQuery('.select2-selection__choice').hide();
+		jQuery('#en_ups_small_sr_country').val('US');
+		enUpsSmallSetStatesValidation(false, true);
+		enUpsSmallToggleCountryStates();
+		jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').val([]);
+		jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').val([]);
+		jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val([]);
+		jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val([]);
+		jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val([]);
+
+		const postForm = {
+			action: 'en_edit_shipping_rule',
+			edit_id: rule_id,
+			wp_nonce: sr_script.nonce,
+		};
+
+		jQuery.ajax({
+			type: 'POST',
+			url: ajaxurl,
+			data: postForm,
+			dataType: 'json',
+			beforeSend: function () {
+				jQuery(elem).closest('a').addClass('spinner_disable');
+				jQuery(elem).css(
+					'background',
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+				);
+			},
+			success: function (data) {
+				jQuery(elem).closest('a').removeClass('spinner_disable');
+				jQuery(elem).css('background', 'none');
+
+				if (data) {
+					enUpsSmallSRPopulateData(data);
+					jQuery('.content').animate({ scrollTop: 0 }, 0);
+
+					// Show popup modal
+					window.location.href = jQuery('.en_wd_add_warehouse_btn').attr('href');
+					setTimeout(function () {
+						if (jQuery('.en_wd_add_warehouse_popup').is(':visible')) {
+							jQuery('.en_wd_add_warehouse_input > input').eq(0).focus();
+						}
+					}, 100);
+				}
+			},
+			error: function (error) {
+				jQuery(elem).closest('a').removeClass('spinner_disable');
+				jQuery(elem).css('background', 'none');
+			},
+		});
+
+		return false;
+	}
+
+	// #region: Delete Shipping Rule
+	/**
+	 * Delete Shipping Rule
+	 * @param event
+	 * @returns {Boolean}
+	 */
+	function enUpsSmallDeleteShippingRule(id, elem) {
+		const postForm = {
+			action: 'en_delete_shipping_rule',
+			delete_id: id,
+			wp_nonce: sr_script.nonce,
+		};
+
+		jQuery.ajax({
+			type: 'POST',
+			url: ajaxurl,
+			data: postForm,
+			dataType: 'json',
+			beforeSend: function () {
+				jQuery(elem).closest('a').addClass('spinner_disable');
+				jQuery(elem).css(
+					'background',
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+				);
+			},
+			success: function (data) {
+				jQuery('#sr_row_' + id).remove();
+				jQuery('.sr_deleted').show('slow').delay(3000).hide('slow');
+				if (jQuery('.en_ups_sr_row')?.length) return false;
+				
+				if (jQuery('.en_ups_empty_sr_row')?.length) {
+				 jQuery('.en_ups_empty_sr_row').show();
+				 } else {
+				 const newRowMarkup = `<tr class="new_warehouse_add en_ups_empty_sr_row" data-id=0><td class="en_wd_warehouse_list_data" colspan="5" style="text-align: center;">No data found!</td></tr>`;
+				 jQuery('#en_ups_shipping_rules_list tbody').append(newRowMarkup);
+				 }
+			},
+			error: function (error) {},
+		});
+
+		return false;
+	}
+
+	// #region: Update Shipping Rule Status
+	function enUpsSmallUpdateShippingRuleStatus(elem) {
+		const rule_id = jQuery(elem).attr('data-id');
+		const is_active = jQuery(elem).attr('data-status');
+
+		// Submit the form to save settings
+		const postData = {
+			action: 'en_update_shipping_rule_status',
+			rule_id,
+			is_active: Number(!Number(is_active)),
+			wp_nonce: sr_script.nonce,
+		};
+
+		jQuery.ajax({
+			type: 'POST',
+			url: ajaxurl,
+			data: postData,
+			dataType: 'json',
+			beforeSend: function () {
+				jQuery(elem).addClass('spinner_disable');
+				jQuery(elem).css(
+					'background',
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+				);
+			},
+			success: function (data) {
+				jQuery(elem).removeClass('spinner_disable');
+				jQuery(elem).css('background', 'none');
+
+				if (data.update_qry == 1) {
+					jQuery(elem).attr('data-status', data?.is_active);
+					jQuery(elem).text(Number(data?.is_active) ? 'Yes' : 'No');
+					jQuery('.sr_updated').show('slow').delay(3000).hide('slow');
+				}
+			},
+			error: function (error) {
+				jQuery(elem).removeClass('spinner_disable');
+				jQuery(elem).css('background', 'none');
+			},
+		});
+
+		return false;
+	}
+
+	// #region: Get Row Markup
+	function enUpsSmallGetRowMarkup(rule) {
+		const rowMarkup = `
+				<td class="en_wd_warehouse_list_data">${rule?.name}</td>
+				<td class="en_wd_warehouse_list_data">${rule?.type}</td>
+				<td class="en_wd_warehouse_list_data"><a href="#" class='en_ups_sr_status_link' data-id='${
+					rule?.id
+				}' data-status='${rule?.is_active}'>${rule?.is_active ? 'Yes' : 'No'}</a></td>
+				<td class="en_wd_warehouse_list_data">
+					<!-- Edit rule link -->
+					<a href="#" class="en_ups_sr_edit_link" data-id="${rule?.id}">
+						<img src="${
+							sr_script.pluginsUrl
+						}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png" title="Edit">
+					</a>
+					<!-- Delete rule link -->
+					<a href="#" class="en_ups_sr_delete_link" data-id="${rule?.id}">
+						<img src="${
+							sr_script.pluginsUrl
+						}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png" title="Delete">
+					</a>
+				</td>
+		`;
+
+		return rowMarkup;
+	}
+
+	// #region: Toggle Rule Type Fields
+	function enUpsSmalltoggleRuleTypeFields() {
+		const type = jQuery('#en_ups_small_rule_type').val();
+		jQuery('#en_ups_small_sr_content').css('height', '80vh');
+		enUpsSmallSetStatesValidation(false, true);
+		jQuery('.en_sr_hide_methods_by_origin_location, .en_ups_small_sr_large_cart_settings, .en_sr_min_shipping_charge, .en_sr_override_rates, .en_sr_restrict_to_state, #en_sr_apply_to_product').hide();
+
+		if (type === rule_types.override_rates) {
+			jQuery('.en_sr_override_rates, .en_ups_small_sr_apply_to, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section, .en_or_sr_filters').show();
+			jQuery('#en_sr_apply_to_cart').hide();
+			jQuery('input[name="apply_to"]').val(['shipment']);
+			
+			setDataAttribute('en_sr_max_items', 'en_sr_max_weight_per_package');
+			removeDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate');
+		} else if (type === rule_types.restrict_to_state) {
+			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, .en_sr_restrict_to_state, .en_ups_small_sr_filters_section').show();
+			jQuery('input[name="apply_to"]').val(['cart']);
+			jQuery('#en_sr_apply_to_shipment, .en_or_sr_filters').hide();
+
+			setDataAttribute('en_sr_service', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			enUpsSmallSetStatesValidation();
+		} else if (type === rule_types.large_cart_settings) {
+			jQuery('.en_ups_small_sr_apply_to, .en_ups_small_sr_filters_section, .en_or_sr_filters').hide();
+			jQuery('.en_ups_small_sr_large_cart_settings').show();
+			jQuery('input[name="apply_to"]').val(['cart']);
+
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate');
+			removeDataAttribute('en_sr_max_items', 'en_sr_max_weight_per_package');
+		} else if (type === rule_types.hide_methods_by_origin_location) {
+			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_shipment, .en_sr_hide_methods_by_origin_location').show();
+			jQuery('#en_sr_apply_to_cart, .en_ups_small_sr_filters_section, .en_or_sr_filters').hide();
+			jQuery('input[name="apply_to"]').val(['shipment']);
+			
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			removeDataAttribute('en_sr_locations_list, en_sr_services_list');
+		} else if (type === rule_types.minimum_shipping_charge) {
+			jQuery('.en_or_sr_filters').hide();
+			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, #en_sr_apply_to_shipment, .en_sr_min_shipping_charge, .en_ups_small_sr_filters_section').show();
+			jQuery('input[name="apply_to"]').val(['shipment']);
+
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			removeDataAttribute('en_sr_minimum_shipping_charge', 'en_msc_sr_services_list');
+		} else {
+			jQuery('.en_or_sr_filters').hide();
+
+			if (type === rule_types.free_shipping) {
+				jQuery('#en_sr_apply_to_cart, #en_sr_apply_to_shipment').hide();
+				jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_product, .en_ups_small_sr_filters_section').show();
+				jQuery('input[name="apply_to"]').val(['product']);
+			} else {
+				jQuery('#en_sr_apply_to_product').hide();
+				jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section').show();
+				jQuery('input[name="apply_to"]').val(['cart']);
+			}
+
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package', 'en_sr_locations_list', 'en_sr_services_list', 'en_sr_minimum_shipping_charge', 'en_msc_sr_services_list');
+		}
+	}
+
+	// #region: Set States Validation
+	function enUpsSmallSetStatesValidation(toggle = false, optional = false) {
+		if (toggle) {
+			if (jQuery('#en_ups_small_sr_country').val() === 'US') {
+				jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').removeAttr('data-optional');
+				jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').attr('data-optional', '1');
+			} else {
+				jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').removeAttr('data-optional');
+				jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').attr('data-optional', '1');
+			}
+		} else if (optional) {
+			jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list, .en_ups_small_sr_us_states_list #en_sr_states_list').attr('data-optional', '1');
+		} else {
+			jQuery('.en_ups_small_sr_us_states_list #en_sr_states_list').removeAttr('data-optional');
+			jQuery('.en_ups_small_sr_ca_states_list #en_sr_states_list').attr('data-optional', '1');
+		}
+	}
+
+	// #region Toggle country states (Restrict to State rule)
+	function enUpsSmallToggleCountryStates() {
+		const selectedCountry = jQuery('#en_ups_small_sr_country').val();
+		jQuery('.en_ups_small_sr_us_states_list').css('display', selectedCountry === 'US' ? '' : 'none');
+		jQuery('.en_ups_small_sr_ca_states_list').css('display', selectedCountry === 'CA' ? '' : 'none');
+	}
+
+	// #region Toggle country states (Override rates rule)
+	function enUpsSmallORToggleCountryStates() {
+		const selectedCountry = jQuery('#en_ups_small_or_sr_country').val();
+
+		if (!selectedCountry) {
+			jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val([]);
+			jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val([]);
+		}
+
+		jQuery('.en_ups_small_or_empty_sr_states_list').css('display', !selectedCountry ? '' : 'none');
+		jQuery('.en_ups_small_or_sr_us_states_list').css('display', selectedCountry === 'US' ? '' : 'none');
+		jQuery('.en_ups_small_or_sr_ca_states_list').css('display', selectedCountry === 'CA' ? '' : 'none');
+	}
+
+	// #region: Hide Methods by Origin Location Validations
+	function enUpsSmallHMBLValidations() {
+		const ids = ['#en_sr_locations_list', '#en_sr_services_list'];
+		let is_valid = true;
+
+		for (const id of ids) {
+			const input = jQuery(id).val();
+			const errorText = !input?.length ? jQuery(id).attr('title') + ' are required.' : '';
+			const errorElement = jQuery(id).parent().find('.en_sr_err');
+
+			if (errorText) is_valid = false;
+			jQuery(errorElement).html(errorText);
+		}
+
+		return is_valid;
+	}
+
+	// #region: Override Rates Validations
+	function enUpsSmallORValidations() {
+		let is_valid = true;
+
+		// Filter by country
+		if (jQuery('#filter_by_country_or').prop('checked') && !jQuery('#en_ups_small_or_sr_country').val()) {
+			jQuery('#en_ups_small_or_sr_country').parent().find('.en_sr_err').html('Country is required.');
+			is_valid = false;
+		}
+
+		// Filter by state
+		if (jQuery('#filter_by_state_or').prop('checked')) {
+			const selectedCountry = jQuery('#en_ups_small_or_sr_country').val(),
+						us_states_value = jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val(),
+						ca_states_value = jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val(),
+						parent_elem = '.en_ups_small_or_empty_sr_states_list, .en_ups_small_or_sr_us_states_list, .en_ups_small_or_sr_ca_states_list';
+
+			if (!selectedCountry || (selectedCountry === 'US' && !us_states_value?.length) || 
+					(selectedCountry === 'CA' && !ca_states_value?.length)) {
+				jQuery(parent_elem).find('.en_sr_err').html('State is required.');
+				is_valid = false;
+			}
+		}
+
+		return is_valid;
+	}
+
+	// #region: Populate Shipping Rule Data
+	function enUpsSmallSRPopulateData(data) {
+		jQuery('#edit_sr_form_id').val(data?.rule_data.id);
+		jQuery('#en_sr_rule_name').val(data?.rule_data?.name);
+		jQuery('#en_ups_small_rule_type').val(data?.rule_data?.type);
+		jQuery('#en_sr_avialable').prop(
+			'checked',
+			Number(data?.rule_data?.is_active)
+		);
+
+		enUpsSmalltoggleRuleTypeFields();
+
+		const settings = JSON.parse(data?.rule_data?.settings) ?? {};
+		
+		jQuery('input[name="apply_to"]').val([settings?.apply_to]);
+		// Override rates
+		jQuery('#en_sr_service_name').val(settings?.service);
+		jQuery('#en_ups_small_sr_service_rate').val(settings?.service_rate);
+		// Large cart settings
+		jQuery('#en_sr_max_items').val(settings?.max_items);
+		jQuery('#en_sr_max_weight_per_package').val(
+			settings?.max_weight_per_package
+		);
+
+		const rule_type = jQuery('#en_ups_small_rule_type').val();
+
+		// Hide methods by origin location
+		if (rule_type === rule_types.hide_methods_by_origin_location) {
+			jQuery('#filter_by_origin').prop('checked', settings?.filter_by_origin === 'true');
+			jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').html(data?.origins_markup).trigger('change');
+
+			jQuery("#filter_by_service").prop('checked', settings?.filter_by_service === 'true');
+			jQuery('.en_ups_small_sr_services_list #en_sr_services_list').html(data?.services_markup).trigger('change');
+		}
+
+		// Minimum shipping charge
+		if (rule_type === rule_types.minimum_shipping_charge) {
+			jQuery('#en_sr_minimum_shipping_charge').val(settings?.minimum_shipping_charge);
+			jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').html(data?.services_markup).trigger('change');
+		}
+
+		// Override rates
+		if (rule_type === rule_types.override_rates) {
+			jQuery('#filter_by_country_or').prop('checked', settings?.filter_by_country_or === 'true');
+			jQuery('#en_ups_small_or_sr_country').val(settings?.filter_by_country_value_or);
+			jQuery('#filter_by_state_or').prop('checked', settings?.filter_by_state_or === 'true');
+
+			if (data?.or_country_states_markup) {
+				const country = settings?.filter_by_country_value_or;
+				jQuery(!country && '.en_ups_small_or_empty_sr_states_list #en_or_empty_sr_states_list').html('').trigger('change');
+				jQuery(country === 'US' && '.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').html(data?.or_country_states_markup).trigger('change');
+				jQuery(country === 'CA' && '.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').html(data?.or_country_states_markup).trigger('change');
+			}
+
+			enUpsSmallORToggleCountryStates();
+		}
+
+		// Restrict to state
+		if (rule_type === rule_types.restrict_to_state) {
+			jQuery('#en_ups_small_filter_by_country').prop('checked', settings?.filter_by_country === 'true');
+			jQuery('#en_ups_small_sr_country').val(settings?.filter_by_country_value || 'US');
+			jQuery('#en_ups_small_filter_by_state').prop('checked', settings?.filter_by_state === 'true');
+			enUpsSmallSetStatesValidation(true, false);
+			
+			if (data?.country_states_markup) {
+				const countryId = settings?.filter_by_country_value;
+				jQuery(countryId === 'US' ? '.en_ups_small_sr_us_states_list #en_sr_states_list' : '.en_ups_small_sr_ca_states_list #en_sr_states_list').html(data?.country_states_markup).trigger('change');
+			}
+			
+			enUpsSmallToggleCountryStates();
+		}
+
+		// Common filters settings
+		// Weight
+		jQuery('#filter_by_weight').prop('checked', settings?.filter_by_weight === 'true');
+		settings?.filter_by_weight === 'true' && removeDataAttribute('en_sr_weight_from');
+		jQuery('#en_sr_weight_from').val(settings?.filter_by_weight_from);
+		jQuery('#en_sr_weight_to').val(settings?.filter_by_weight_to);
+		// Price
+		jQuery('#en_sr_filter_price').prop('checked', settings?.filter_by_price === 'true');
+		settings?.filter_by_price === 'true' && removeDataAttribute('en_sr_price_from');
+		jQuery('#en_sr_price_from').val(settings?.filter_by_price_from);
+		jQuery('#en_sr_price_to').val(settings?.filter_by_price_to);
+		// Quantity
+		jQuery('#filter_by_quantity').prop('checked', settings?.filter_by_quantity === 'true');
+		settings?.filter_by_quantity === 'true' && removeDataAttribute('en_sr_quantity_from');
+		jQuery('#en_sr_quantity_from').val(settings?.filter_by_quantity_from);
+		jQuery('#en_sr_quantity_to').val(settings?.filter_by_quantity_to);
+		// Product tags
+		jQuery('#filter_by_product_tag').prop('checked', settings?.filter_by_product_tag === 'true');
+		settings?.filter_by_product_tag === 'true' && removeDataAttribute('en_sr_product_tags_list');
+		jQuery('#en_sr_product_tags_list').html(data?.product_tags_markup).trigger('change');
+	}
+
+	// #region: Minimum Shipping Charge Validations
+	function enUpsSmallMSCValidations() {
+		let is_valid = true;
+
+		if (!jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val()?.length) {
+			jQuery('.en_ups_small_msc_sr_services_list').find('.en_sr_err').html('Services is required.');
+			is_valid = false;
+		}
+
+		return is_valid;
+	}
+});
Index: /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-save.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-save.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-save.php	(revision 3237693)
@@ -0,0 +1,584 @@
+<?php
+
+/**
+ * Includes Shipping Rules Ajax Request class
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists("Eniture_UpsSmallShippingRulesAjaxReq")) {
+
+    class Eniture_UpsSmallShippingRulesAjaxReq
+    {
+        /**
+         * Get shipping rules ajax request
+         */
+        public function __construct()
+        {
+            add_action('wp_ajax_nopriv_en_save_shipping_rule', array($this, 'save_shipping_rule_ajax'));
+            add_action('wp_ajax_en_save_shipping_rule', array($this, 'save_shipping_rule_ajax'));
+
+            add_action('wp_ajax_nopriv_en_edit_shipping_rule', array($this, 'edit_shipping_rule_ajax'));
+            add_action('wp_ajax_en_edit_shipping_rule', array($this, 'edit_shipping_rule_ajax'));
+
+            add_action('wp_ajax_nopriv_en_delete_shipping_rule', array($this, 'delete_shipping_rule_ajax'));
+            add_action('wp_ajax_en_delete_shipping_rule', array($this, 'delete_shipping_rule_ajax'));
+
+            add_action('wp_ajax_nopriv_en_update_shipping_rule_status', array($this, 'update_shipping_rule_status_ajax'));
+            add_action('wp_ajax_en_update_shipping_rule_status', array($this, 'update_shipping_rule_status_ajax'));
+        }
+
+        // MARK: Save Shipping Rule
+        /**
+         * Save Shipping Rule Function
+         * @global $wpdb
+         */
+        function save_shipping_rule_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+
+            $insert_qry = $update_qry = '';
+            $error = false;
+            $data = $_POST;
+            $data = $this->sanitize_request_data($data);
+            $get_shipping_rule_id = (isset($data['rule_id']) && intval($data['rule_id'])) ? intval($data['rule_id']) : "";
+            $last_id = $get_shipping_rule_id;
+            $get_shipping_rule = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules WHERE name = %s", $data['name']));
+            unset($data['action']);
+            unset($data['rule_id']);
+            unset($data['wp_nonce']);
+
+            if (!empty($get_shipping_rule_id)) {
+                $data['settings'] = wp_json_encode($data['settings']);
+                $update_qry = $wpdb->update(
+                    $wpdb->prefix . 'eniture_ups_small_shipping_rules', $data, array('id' => $get_shipping_rule_id)
+                );
+
+                $update_qry = (!empty($get_shipping_rule) && reset($get_shipping_rule)->id == $get_shipping_rule_id) ? 1 : $update_qry;
+            } else {
+                if (!empty($get_shipping_rule)) {
+                    $error = true;
+                } else {
+                    $data['settings'] = wp_json_encode($data['settings']);
+                    $insert_qry = $wpdb->insert($wpdb->prefix . 'eniture_ups_small_shipping_rules', $data);
+                    $last_id = $wpdb->insert_id;
+                }
+            }
+
+            $shipping_rules_list = array('name' => $data["name"], 'type' => $data["type"], 'is_active' => $data["is_active"], 'insert_qry' => $insert_qry, 'update_qry' => $update_qry, 'id' => $last_id, 'error' => $error);
+
+            echo wp_json_encode($shipping_rules_list);
+            exit;
+        }
+
+        // MARK: Edit Shipping Rule
+        /**
+         * Edit Shipping Rule Function
+         * @global $wpdb
+         */
+        function edit_shipping_rule_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? intval($_POST['edit_id']) : "";
+            $shipping_rules_list = $wpdb->get_results(
+                "SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules WHERE id=$get_shipping_rule_id"
+            );
+            $shipping_rules_type = isset(reset($shipping_rules_list)->type) ? reset($shipping_rules_list)->type : '';
+
+            $product_tags_markup = $this->get_product_tags_markup($shipping_rules_list);
+            $states_markup = $this->get_country_states_markup($shipping_rules_list);
+            $origins_markup = $this->get_origins_markup($shipping_rules_list);
+            $services_markup = $this->get_services_markup($shipping_rules_list, $shipping_rules_type);
+            // override rates rule
+            $or_states_markup = $shipping_rules_type == 'Override Rates' ? $this->get_country_states_markup($shipping_rules_list, true) : '';
+
+            $data = ['rule_data' => reset($shipping_rules_list), 'product_tags_markup' => $product_tags_markup, 'country_states_markup' => $states_markup, 'origins_markup' => $origins_markup, 'services_markup' => $services_markup, 'or_country_states_markup' => $or_states_markup,];
+
+            echo wp_json_encode($data);
+            exit;
+        }
+
+        // MARK: Delete Shipping Rule
+        /**
+         * Delete Shipping Rule Function
+         * @global $wpdb
+         */
+        function delete_shipping_rule_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? intval($_POST['delete_id']) : "";
+            $qry = $wpdb->delete($wpdb->prefix . 'eniture_ups_small_shipping_rules', array('id' => $get_shipping_rule_id));
+
+            echo wp_json_encode(['query' => $qry]);
+            exit;
+        }
+
+        // MARK: Update Shipping Rule Status
+        /**
+         * Update Shipping Rule Status Function
+         * @global $wpdb
+         */
+        function update_shipping_rule_status_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['rule_id']) && intval($_POST['rule_id'])) ? intval($_POST['rule_id']) : "";
+            $is_active = isset($_POST['is_active']) ? sanitize_text_field(wp_unslash($_POST['is_active'])) : "";
+            $data = ['is_active' => $is_active];
+
+            $update_qry = $wpdb->update(
+                $wpdb->prefix . 'eniture_ups_small_shipping_rules', $data, array('id' => $get_shipping_rule_id)
+            );
+
+            echo wp_json_encode(['id' => $get_shipping_rule_id, 'is_active' => $is_active, 'update_qry' => $update_qry]);
+            exit;
+        }
+
+        // MARK: Get Product Tags
+        /**
+         * Get Product Tags Function
+         * @global $wpdb
+         */
+        function get_product_tags_markup($shipping_rules_list)
+        {
+            $tags_options = '';
+            $shipping_rules_list = reset($shipping_rules_list);
+            $tags_data = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
+            $selected_tags_detials = $this->get_selected_tags_details($tags_data['filter_by_product_tag_value']);
+
+            if (!empty($selected_tags_detials) && is_array($selected_tags_detials)) {
+                foreach ($selected_tags_detials as $key => $tag) {
+                    $tags_options .= "<option selected='selected' value='" . esc_attr($tag['term_taxonomy_id']) . "'>" . esc_html($tag['name']) . "</option>";
+                }
+            }
+
+            if (empty($tags_data['filter_by_product_tag_value']) || !is_array($tags_data['filter_by_product_tag_value'])) {
+                $tags_data['filter_by_product_tag_value'] = [];
+            }
+
+            $en_woo_product_tags = get_tags( array( 'taxonomy' => 'product_tag' ) );
+            if (!empty($en_woo_product_tags) && is_array($tags_data['filter_by_product_tag_value'])) {
+                foreach ($en_woo_product_tags as $key => $tag) {
+                    if (!in_array($tag->term_id, $tags_data['filter_by_product_tag_value'])) {
+                        $tags_options .= "<option value='" . esc_attr($tag->term_taxonomy_id) . "'>" . esc_html($tag->name) . "</option>";
+                    }
+                }
+            }
+
+            return $tags_options;
+        }
+
+        // MARK: Get Selected Tags Details
+        /**
+         * Get Selected Tags Details Function
+         * @global $wpdb
+         */
+        function get_selected_tags_details($products_tags_arr)
+        {
+            if (empty($products_tags_arr) || !is_array($products_tags_arr)) {
+                return [];
+            }
+
+            $tags_detail = [];
+            $count = 0;
+            $en_woo_product_tags = get_tags( array( 'taxonomy' => 'product_tag' ) );
+
+            if (isset($en_woo_product_tags) && !empty($en_woo_product_tags)) {
+                foreach ($en_woo_product_tags as $key => $tag) {
+                    if (in_array($tag->term_taxonomy_id, $products_tags_arr)) {
+                        $tags_detail[$count]['term_id'] = $tag->term_id;
+                        $tags_detail[$count]['name'] = $tag->name;
+                        $tags_detail[$count]['slug'] = $tag->slug;
+                        $tags_detail[$count]['term_taxonomy_id'] = $tag->term_taxonomy_id;
+                        $tags_detail[$count]['description'] = $tag->description;
+                        $count++;
+                    }
+                }
+            }
+
+            return $tags_detail;
+        }
+
+        // MARK: Get Country States
+        /**
+         * Get Country States Function
+         * @global $wpdb
+         */
+        function get_country_states_markup($shipping_rules_list, $override_rates_rule = false)
+        {
+            $states_options = '';
+            $shipping_rules_list = reset($shipping_rules_list);
+            $settings = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
+            $filter_by_state_val = $override_rates_rule ? 'filter_by_state_value_or' : 'filter_by_state_value';
+            $filter_by_country_val = $override_rates_rule ? 'filter_by_country_value_or' : 'filter_by_country_value';
+            $selected_states_detials = $this->get_selected_states_details($settings, $filter_by_state_val, $filter_by_country_val);
+
+            if (!empty($selected_states_detials) && is_array($selected_states_detials)) {
+                foreach ($selected_states_detials as $s_code => $s_label) {
+                    $states_options .= "<option selected='selected' value='" . esc_attr($s_code) . "'>" . esc_html($s_label) . "</option>";
+                }
+            }
+
+            if (empty($settings[$filter_by_state_val]) || !is_array($settings[$filter_by_state_val])) {
+                $settings[$filter_by_state_val] = [];
+            }
+
+            $countries_obj = new WC_Countries();
+            $selected_country = isset($settings[$filter_by_country_val]) ? $settings[$filter_by_country_val] : '';
+            $en_woo_states = $countries_obj->get_states($selected_country);
+
+            if (!empty($en_woo_states) && is_array($settings[$filter_by_state_val])) {
+                foreach ($en_woo_states as $s_code => $s_label) {
+                    if (!in_array($s_code, $settings[$filter_by_state_val])) {
+                        $states_options .= "<option value='" . esc_attr($s_code) . "'>" . esc_html($s_label) . "</option>";
+                    }
+                }
+            }
+
+            return $states_options;
+        }
+
+        // MARK: Get Selected States Details
+        /**
+         * Get Selected States Details
+         * @global $wpdb
+         */
+        function get_selected_states_details($settings, $filter_by_state_val, $filter_by_country_val)
+        {
+            $states_arr = isset($settings[$filter_by_state_val]) ? $settings[$filter_by_state_val] : [];
+            if (empty($states_arr) || !is_array($states_arr)) {
+                return [];
+            }
+
+            $countries_obj = new WC_Countries();
+            $selected_country = isset($settings[$filter_by_country_val]) ? $settings[$filter_by_country_val] : '';
+            $en_woo_states = $countries_obj->get_states($selected_country);
+            $states_detail = [];
+
+            if (isset($en_woo_states) && !empty($en_woo_states)) {
+                foreach ($en_woo_states as $key => $state) {
+                    if (in_array($key, $states_arr)) $states_detail[$key] = $state;
+                }
+            }
+
+            return $states_detail;
+        }
+
+        function get_origins_markup($shipping_rules_list)
+        {
+            $origins_options = '';
+            $shipping_rules_list = reset($shipping_rules_list);
+            $settings = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
+
+            global $wpdb;
+            $warehouse_table = $wpdb->prefix . "warehouse";
+            $origins = $wpdb->get_results("SELECT * FROM $warehouse_table", ARRAY_A);
+            $selected_origins_detials = $this->get_selected_origins_details($settings, $origins);
+
+            if (!empty($selected_origins_detials) && is_array($selected_origins_detials)) {
+                foreach ($selected_origins_detials as $origin) {
+                    $location = $origin['city'] . ' ' . $origin['state'] . ' ' . $origin['zip'] . ', ' . $origin['country'];
+                    $origins_options .= "<option selected='selected' value='" . esc_attr($origin['zip']) . "'>" . esc_html($location) . "</option>";
+                }
+            }
+
+            if (empty($settings['filter_by_origin_value']) || !is_array($settings['filter_by_origin_value'])) {
+                $settings['filter_by_origin_value'] = [];
+            }
+
+            if (empty($origins) || !is_array($origins) || !is_array($settings['filter_by_origin_value'])) {
+                return $origins_options;
+            }
+
+            foreach ($origins as $origin) {
+                if (in_array($origin['zip'], $settings['filter_by_origin_value'])) continue;
+
+                $location = $origin['city'] . ' ' . $origin['state'] . ' ' . $origin['zip'] . ', ' . $origin['country'];
+                $origins_options .= "<option value='" . esc_attr($origin['zip']) . "'>" . esc_html($location) . "</option>";
+            }
+
+            return $origins_options;
+        }
+
+        function get_selected_origins_details($settings, $origins)
+        {
+            $origins_arr = isset($settings['filter_by_origin_value']) ? $settings['filter_by_origin_value'] : [];
+            if (empty($origins_arr) || !is_array($origins_arr) || empty($origins)) return [];
+
+            $origins_detail = [];
+            foreach ($origins as $origin) {
+                if (in_array($origin['zip'], $origins_arr)) $origins_detail[] = $origin;
+            }
+
+            return $origins_detail;
+        }
+
+        function get_services_markup($shipping_rules_list, $type)
+        {
+            $services_options = '';
+            $shipping_rules_list = reset($shipping_rules_list);
+            $settings = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
+            $services = $this->get_all_services();
+            $selected_services_detials = $this->get_selected_services_details($settings, $services, $type);
+
+            if (!empty($selected_services_detials) && is_array($selected_services_detials)) {
+                foreach ($selected_services_detials as $key => $service) {
+                    $services_options .= "<option selected='selected' value='" . esc_attr($key) . "'>" . esc_html($service) . "</option>";
+                }
+            }
+
+            $filter_by_service = $type == 'Hide Methods By Origin' ? 'filter_by_service_value' : 'minimum_shipping_charge_services';
+            if (empty($settings[$filter_by_service]) || !is_array($settings[$filter_by_service])) {
+                $settings[$filter_by_service] = [];
+            }
+
+            foreach ($services as $key => $service) {
+                if (in_array($key, $settings[$filter_by_service])) continue;
+                $services_options .= "<option value='" . esc_attr($key) . "'>" . esc_html($service) . "</option>";
+            }
+
+            return $services_options;
+        }
+
+        function get_selected_services_details($settings, $services, $type)
+        {
+            $filter_by_service = $type == 'Hide Methods By Origin' ? 'filter_by_service_value' : 'minimum_shipping_charge_services';
+            $services_arr = isset($settings[$filter_by_service]) ? $settings[$filter_by_service] : [];
+            if (empty($services_arr) || !is_array($services_arr)) return [];
+
+            $services_detail = [];
+            foreach ($services as $key => $service) {
+                if (in_array($key, $services_arr)) $services_detail[$key] = $service;
+            }
+
+            return $services_detail;
+        }
+
+        function get_all_services()
+        {
+            $services = ['03' => 'UPS Ground', '02' => 'UPS 2nd Day Air', '59' => 'UPS 2nd Day Air A.M', '13' => 'UPS Next Day Air Saver', '01' => 'UPS Next Day Air', '14' => 'UPS Next Day Air Early', '12' => 'UPS 3 Day Select', '11' => 'UPS Standard', '08' => 'UPS Expedited | UPS Worldwide Expedited', '65' => 'UPS Express Saver | UPS Worldwide Saver', '07' => 'UPS Express | UPS Worldwide Express', '54' => 'UPS Express Plus | UPS Worldwide Express Plus', '92' => 'UPS SurePost Less than 1LB', '93' => 'UPS SurePost 1LB or greater', '94' => 'UPS SurePost Bound Printed Matter', '95' => 'UPS SurePost Media Mail', 'GFP' => 'UPS Ground with Freight Pricing', 'usrg' => 'UPS Simple Rate - Ground', 'usr3' => 'UPS Simple Rate - 3-day Select', 'usr2' => 'UPS Simple Rate - 2-day Air', 'usr1' => 'UPS Simple Rate - Next Day Air Saver'];
+
+            return $services;
+        }
+
+        /**
+         * Get the large cart settings array.
+         * @return array Returns the max items and max weight per package in an array format or empty array if not found.
+         */
+        function get_large_cart_settings()
+        {
+            global $wpdb;
+            $rules = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"), ARRAY_A);
+            if (empty($rules)) return [];
+
+            $response = [];
+            foreach ($rules as $rule) {
+                if (!$rule['is_active']) continue;
+
+                $settings = isset($rule['settings']) ? json_decode($rule['settings'], true) : [];
+                if (empty($settings)) continue;
+
+                $rule_type = isset($rule['type']) ? $rule['type'] : '';
+                if ($rule_type == 'Large Cart Settings' && !empty($settings['max_items']) && !empty($settings['max_weight_per_package'])) {
+                    $response['largeCartSettingFlag'] = '1';
+                    $response['largeCartMaxItems'] = $settings['max_items'];
+                    $response['largeCartWeightPerPackage'] = $settings['max_weight_per_package'];
+                    break;
+                }
+            }
+
+            return $response;
+        }
+
+        function ups_small_get_service_rate($net_rate, $settings, $min_ship_charge)
+        {
+            $service_rate = $settings['service_rate'];
+            if ($min_ship_charge) {
+                $min_shipping_rate = isset($settings['minimum_shipping_charge']) ? $settings['minimum_shipping_charge'] : 0;
+
+                return $net_rate < $min_shipping_rate ? $min_shipping_rate : $net_rate;
+            }
+
+            if (strpos($service_rate, '%') === false) return $service_rate;
+
+            // Calculate the percentage of service rate based on net rate and add it to net rate
+            $service_rate = str_replace('%', '', $service_rate) / 100;
+            $service_rate = floatval($net_rate) * floatval($service_rate);
+            $net_rate = floatval($net_rate) + floatval($service_rate);
+
+            return $net_rate;
+        }
+
+        function apply_free_shipping_rule($ups_small_package)
+        {
+            if (empty($ups_small_package)) return [];
+
+            global $wpdb;
+            $rules = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"), ARRAY_A);
+            if (empty($rules)) return [];
+
+            $filtered_products_ids = [];
+
+            // check if free shipping rule exists
+            foreach ($rules as $rule) {
+                if (!$rule['is_active'] || $rule['type'] != 'Free Shipping') continue;
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Free Shipping Rule", $rule);
+
+                $products = [];
+                $product_tags = [];
+                foreach ($ups_small_package as $package) {
+                    if (!isset($package['items']) || empty($package['items'])) continue;
+
+                    $products = array_merge($products, $package['items']);
+                    $product_tags = isset($package['product_tags']) && !empty($package['product_tags']) ? array_merge($product_tags, $package['product_tags']) : $product_tags;
+                }
+
+                if (empty($products)) return [];
+
+                $settings = isset($rule['settings']) ? json_decode($rule['settings'], true) : [];
+                $filters_checks = ['filter_by_weight', 'filter_by_price', 'filter_by_quantity', 'filter_by_product_tag'];
+                $any_filter_checked = false;
+
+                foreach ($filters_checks as $check) {
+                    if (isset($settings[$check]) && filter_var($settings[$check], FILTER_VALIDATE_BOOLEAN)) {
+                        $any_filter_checked = true;
+                        break;
+                    }
+                }
+
+                if (!$any_filter_checked) {
+                    $rates = array(
+                        'id' => 'ups_small:' . 'free',
+                        'label' => 'Free Shipping',
+                        'cost' => 0,
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+
+                    return $rates;
+                }
+
+                $is_filter_applied = false;
+                $filters = ['weight', 'price', 'quantity', 'product_tag'];
+                $count = 0;
+
+                foreach ($products as $product) {
+                    $is_filter_applied = false;
+                    $qty = isset($product['productQty']) ? $product['productQty'] : 1;
+
+                    $product['quantity'] = $qty;
+                    $product['weight'] = isset($product['productWeight']) ? $product['productWeight'] * $qty : 1;
+                    $product['price'] = isset($product['productPrice']) ? $product['productPrice'] * $qty : 1;
+
+                    foreach ($filters as $filter) {
+                        if (isset($settings['filter_by_' . $filter]) && filter_var($settings['filter_by_' . $filter], FILTER_VALIDATE_BOOLEAN)) {
+                            if ($filter == 'product_tag') {
+                                $product_id = isset($product['variantId']) && $product['variantId'] > 0 ? $product['variantId'] : $product['productId'];
+                                $parent_id = wp_get_post_parent_id($product_id);
+                                $product_tags = get_the_terms($product_id, 'product_tag');
+                                $product_tags = empty($product_tags) ? get_the_terms($parent_id, 'product_tag') : $product_tags;
+                                $product_tag_ids = empty($product_tags) || !is_array($product_tags) ? [] : array_map(function($tag) { return $tag->term_id; }, $product_tags);
+
+                                if (isset($settings['filter_by_product_tag']) && filter_var($settings['filter_by_product_tag'], FILTER_VALIDATE_BOOLEAN)) {
+                                    $rule_tags = $settings['filter_by_product_tag_value'];
+                                    $tags_check = array_filter($rule_tags, function ($tag) use ($product_tag_ids) {
+                                        return in_array($tag, $product_tag_ids);
+                                    });
+                                    $is_filter_applied = count($tags_check) > 0;
+                                }
+                            } else {
+                                $is_filter_applied = $product[$filter] >= $settings['filter_by_' . $filter . '_from'];
+                                if ($is_filter_applied && !empty($settings['filter_by_' . $filter . '_to'])) {
+                                    $is_filter_applied = $product[$filter] < $settings['filter_by_' . $filter . '_to'];
+                                }
+                            }
+                        }
+
+                        if ($is_filter_applied) break;
+                    }
+
+                    if ($is_filter_applied) {
+                        $count++;
+                        $filtered_products_ids[] = $product['productId'];
+                    }
+                }
+
+                // If all products match the filter, return free shipping
+                if ($is_filter_applied && $count == count($products)) {
+                    $rates = array(
+                        'id' => 'ups_small:' . 'free',
+                        'label' => 'Free Shipping',
+                        'cost' => 0,
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+
+                    return [
+                        'rates' => $rates,
+                        'package' => $ups_small_package
+                    ];
+                }
+            }
+
+            if (!empty($filtered_products_ids)) {
+                foreach ($ups_small_package as $key => $package) {
+                    foreach ($package['items'] as $ik => $item) {
+                        if (in_array($item['productId'], $filtered_products_ids)) {
+                            unset($ups_small_package[$key]['items'][$ik]);
+                        }
+                    }
+                }
+            }
+
+            return [
+                'rates' => [],
+                'package' => $ups_small_package 
+            ];
+        }
+
+        function sanitize_request_data($data)
+        {
+            if (empty($data)) return $data;
+
+            if (is_array($data)) {
+                foreach ($data as $key => $value) {
+                    if (is_array($value)) {
+                        $data[$key] = $this->sanitize_request_data($value);
+                    } else {
+                        $data[$key] =  isset($value) ? esc_attr(sanitize_text_field( wp_unslash($value) )) : '';
+                    }
+                }
+            } else {
+                $data = isset($data) ? esc_attr(sanitize_text_field( wp_unslash($data) )) : '';
+            }
+
+            return $data;
+        }
+    }
+}
+
+new Eniture_UpsSmallShippingRulesAjaxReq();
Index: /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-template.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-template.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/shipping-rules/shipping-rules-template.php	(revision 3237693)
@@ -0,0 +1,585 @@
+<?php
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Shipping Rules Template
+ */
+if (!function_exists('eniture_shipping_rules_template')) {
+    function eniture_shipping_rules_template($action = false)
+    {
+      ob_start();
+
+      global $wpdb;
+      $shipping_rules_list = $wpdb->get_results(
+          "SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"
+      );
+
+      // Eniture debug mode
+      do_action("eniture_debug_mood", "UPS Small Shipping Rules", $shipping_rules_list);
+
+      ?>
+        <div>
+          <table class="en_wd_warehouse_list" id="en_ups_shipping_rules_list">
+            <!-- Table Headings -->
+            <thead>
+                  <tr>
+                      <th class="en_wd_warehouse_list_heading">
+                          Rule Name
+                      </th>
+                      <th class="en_wd_warehouse_list_heading">
+                          Type
+                      </th>
+                      <th class="en_wd_warehouse_list_heading">
+                          Available
+                      </th>
+                      <th class="en_wd_warehouse_list_heading">
+                          Action
+                      </th>
+                  </tr>
+            </thead>
+
+            <!-- Table Body -->
+            <tbody>
+              <?php
+                if (count($shipping_rules_list) > 0) {
+                  $count = 0;
+                  foreach ($shipping_rules_list as $rule) {
+                    $rule->settings = !empty($rule->settings) ? json_decode($rule->settings) : [];
+                    $rule_type = isset($rule->type) ? $rule->type : '';
+                    $rule_type = $rule_type == 'Hide Methods By Origin' ? 'Hide Methods By Origin Location' : $rule_type;
+
+                    ?>
+                      <tr id="sr_row_<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>" class="en_ups_sr_row">
+                        <td class="en_wd_warehouse_list_data"><?php echo esc_attr($rule->name); ?></td>
+                        <td class="en_wd_warehouse_list_data"><?php echo esc_attr($rule_type); ?></td>
+                        <td class="en_wd_warehouse_list_data">
+                          <a href="#" class="en_ups_sr_status_link" data-id="<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>" data-status="<?php echo esc_attr($rule->is_active); ?>"><?php echo esc_attr($rule->is_active) ? 'Yes' : 'No'; ?></a>
+                        </td>
+                        <td class="en_wd_warehouse_list_data">
+                          <!-- Edit rule link -->
+                          <a href="#" class="en_ups_sr_edit_link" data-id="<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>">
+                            <img src="<?php echo esc_attr(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png" title="Edit">
+                          </a>
+                          <!-- Delete rule link -->
+                          <a href="#" class="en_ups_sr_delete_link" data-id="<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>">
+                            <img src="<?php echo esc_attr(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png" title="Delete">
+                          </a>
+                        </td>
+                      </tr>
+                    <?php
+
+                    $count++;
+                  }
+                } else {
+                  ?>
+                    <tr class="new_warehouse_add en_ups_empty_sr_row" data-id=0>
+                      <td class="en_wd_warehouse_list_data" colspan="5" style="text-align: center;">
+                        No data found!
+                      </td>
+                    </tr>
+                  <?php
+                }
+              ?>
+            </tbody>
+          </table>
+        </div>
+      <?php
+
+      if ($action) {
+          $ob_get_clean = ob_get_clean();
+          return $ob_get_clean;
+      }
+    }
+}
+
+if (!function_exists('eniture_shipping_rules_list_services')) {
+    function eniture_shipping_rules_get_services_list()
+    {
+      $services = ['03' => 'Ground', '02' => '2nd Day Air', '59' => '2nd Day Air A.M', '13' => 'Next Day Air Saver', '01' => 'Next Day Air', '14' => 'Next Day Air Early', '12' => '3 Day Select', '11' => 'Standard', '08' => 'Expedited | Worldwide Expedited', '65' => 'Express Saver | Worldwide Saver', '07' => 'Express | Worldwide Express', '54' => 'Express Plus | Worldwide Express Plus', '92' => 'SurePost Less than 1LB', '93' => 'SurePost 1LB or greater', '94' => 'SurePost Bound Printed Matter', '95' => 'SurePost Media Mail', 'GFP' => 'Ground with Freight Pricing', 'usrg' => 'Simple Rate - Ground', 'usr3' => 'Simple Rate - 3-day Select', 'usr2' => 'Simple Rate - 2-day Air', 'usr1' => 'Simple Rate - Next Day Air Saver'];
+
+      return $services;
+    }
+}
+?>
+
+<!-- Shipping rules html markup -->
+<div class="en_shipping_rules_setting_section ups_small_wrapper">
+    <br />
+    <!-- Add rule button -->
+    <div class="en_sr_add_btn">
+      <a href="#en_wd_add_warehouse_btn" onclick="" title="Add Rule"
+             class="en_wd_add_warehouse_btn" id="en_sr_add_shipping_rule_btn" name="avc">Add Rule</a>
+    </div>
+
+    <div class="updated inline warehouse_deleted sr_deleted">
+      <p><strong>Success!</strong> Shipping rule is deleted successfully.</p>
+    </div>
+    <div class="updated inline warehouse_created sr_created">
+        <p><strong>Success!</strong> Shipping rule is added successfully.</p>
+    </div>
+    <div class="updated inline warehouse_updated sr_updated">
+        <p><strong>Success!</strong> Shipping rule is updated successfully.</p>
+    </div>
+
+    <!-- Shipping rules data table -->
+    <?php eniture_shipping_rules_template(); ?>
+
+    <!-- Add popup for new rule -->
+    <div id="en_wd_add_warehouse_btn" class="en_wd_warehouse_overlay en_ups_small_sr_popup">
+        <div class="en_wd_add_warehouse_popup">
+            <h2 class="warehouse_heading">Add Rule</h2>
+            <a class="close" href="#">&times;</a>
+            <div class="content" id="en_ups_small_sr_content" style="overflow-y: auto; height: 80vh;">
+
+              <div class="already_exist sr_already_exist">
+                <strong>Error!</strong> Shipping rule with this name already exists.
+              </div>
+                <!-- Wordpress Form closed -->
+                </form>
+
+                <!-- Add shipping rule form -->
+                <form id="add_shipping_rule" class="en_ups_small_sr_form" role="form">
+                    <input type="hidden" name="edit_sr_form_id" value="" id="edit_sr_form_id">
+                    <!-- Rule name -->
+                    <div class="en_sr_form_control">
+                        <label for="en_sr_rule_name">Rule Name <span style="color: red;">*</span></label>
+                        <input type="text" title="Rule Name" name="en_sr_rule_name" id="en_sr_rule_name" maxlength="50">
+                        <span class="en_sr_err"></span>
+                    </div>
+
+                    <!-- Rule type -->
+                    <div class="en_sr_form_control">
+                        <label for="en_ups_small_rule_type">Type</label>
+                        <select name="en_ups_small_rule_type" id="en_ups_small_rule_type" title="Type">
+                          <option value="Free Shipping">Free Shipping</option>
+                          <option value="Hide Methods">Hide Methods</option>
+                          <option value="Hide Methods By Origin">Hide Methods By Origin Location</option>
+                          <option value="Large Cart Settings">Large Cart Settings</option>
+                          <option value="Minimum Shipping Charge">Minimum Shipping Charge</option>
+                          <option value="Override Rates">Override Rates</option>
+                          <option value="Restrict To State">Restrict To State</option>
+                        </select>
+                        <span class="en_sr_err"></span>
+                    </div>
+
+                    <!-- Apply to -->
+                    <div class="en_sr_form_control en_ups_small_sr_apply_to">
+                        <label for="apply_to">Apply to:</label>
+                        <div id="en_sr_apply_to_cart">
+                          <div><p></p></div>
+                          <input type="radio" name="apply_to" value="cart" checked title="Cart"> <span>Cart</span>
+                        </div>
+                        <div id="en_sr_apply_to_shipment">
+                          <div><p></p></div>
+                          <input type="radio" name="apply_to" value="shipment" title="Shipment"> <span>Shipment</span>
+                        </div>
+                        <div id="en_sr_apply_to_product">
+                          <div><p></p></div>
+                          <input type="radio" name="apply_to" value="product" title="Product"> <span>Product</span>
+                        </div>
+                        <span class="en_sr_err"></span>
+                    </div>
+
+                    <!-- Hide methods by origin location section -->
+                    <div class="en_sr_hide_methods_by_origin_location">
+                      <!-- Filter by Origins -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_origin" id="en_ups_small_filter_by_origin_label">
+                            Origins
+                        </label>
+                      </div>
+
+                      <!-- Origins list -->
+                      <div class="en_sr_form_control en_ups_small_sr_locations_list">
+                        <select name="en_sr_locations_list" id="en_sr_locations_list" multiple="multiple" data-attribute="en_location_list_value" data-optional="1" class="chosen_select en_location_list_value" style="width: 100% !important;" title="Origins">
+                          <?php 
+                            global $wpdb;
+                            $warehouse_table = $wpdb->prefix . "warehouse";
+                            $locations = $wpdb->get_results("SELECT * FROM $warehouse_table", ARRAY_A);
+
+                            if (isset($locations) && !empty($locations)) {
+                              foreach ($locations as $key => $value) {
+                                  $location = $value['city'] . ' ' . $value['state'] . ' ' . $value['zip'] . ', ' . $value['country'];
+                                  echo "<option value='" . esc_attr($value['zip']) . "'>" . esc_html($location) . "</option>";
+                              }
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                        <span class="descrption">
+                          Shipping methods for the services listed below will be hidden for customers from these origins.
+                        </span>
+                      </div>
+
+                      <!-- Filter by Services -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_sevices" id="en_ups_small_filter_by_sevices_label">
+                            Services
+                        </label>
+                      </div>
+
+                      <!-- Services list -->
+                      <div class="en_sr_form_control en_ups_small_sr_services_list">
+                        <select name="en_sr_services_list" id="en_sr_services_list" multiple="multiple" data-attribute="en_service_list_value" data-optional="1" class="chosen_select en_service_list_value" style="width: 100% !important;" title="Services">
+                          <?php
+                            $services = eniture_shipping_rules_get_services_list();
+                            foreach ($services as $key => $value) {
+                              echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                      </div>
+                    </div>
+
+                    <!-- Large cart settings section -->
+                    <div class="en_ups_small_sr_large_cart_settings">
+                      <div class="en_sr_form_control">
+                        <p>
+                          The packaging algorithm identifies the ideal packaging solution via an iterative process. If the Cart contains a large number of items, the time the packaging algorithm requires to identify the ideal packaging solution can exceed the window of time WordPress allows for shipping quotes to be returned. In these cases, the packaging algorithm needs to be bypassed. Use the settings below to specify your preferences for when the packaging algorithm is to be bypassed. Test the results to make sure results (shipping quotes) are returned when a large number of items is in the Cart. The number of boxes you define and the diversity of the items in your product catalog will influence the time the packaging algorithm requires. Therefore, your settings will differ from those of other merchants.
+                        </p>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_sr_max_items">Max items <span style="color: red;">*</span></label>
+                        <input type="text" title="Max items" name="en_sr_max_items" id="en_sr_max_items" data-optional="1" maxlength="10">
+                        <span class="en_sr_err"></span>
+                        <p class="description">When the Cart contains more than this number of items, the packaging algorithm will be bypassed and rates will be calculated exclusively on the basis of weight.</p>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_sr_max_weight_per_package">Max weight per package <span style="color: red;">*</span></label>
+                        <input type="text" title="Max weight per package" name="en_sr_max_weight_per_package" id="en_sr_max_weight_per_package" data-optional="1" maxlength="10">
+                        <span class="en_sr_err"></span>
+                        <p class="description">Specify the maximum weight allowed per package when the packaging algorithm is bypassed. The maximum permitted value is 150 LB.</p>
+                      </div>
+                    </div>
+
+                    <!-- Minimum shipping charge section -->
+                     <div class="en_sr_min_shipping_charge">
+                      <!-- Minimum shipping charge -->
+                      <div class="en_sr_form_control">
+                          <label for="en_sr_minimum_shipping_charge">Minimum Shipping Rate</label>
+                          <input type="text" title="Minimum shipping charge" name="en_sr_minimum_shipping_charge" id="en_sr_minimum_shipping_charge" data-optional="1" maxlength="7">
+
+                          <span class="en_sr_err"></span>
+                          <span class="descrption">
+                            Enter the min. shipping rate to show on checkout.
+                        </span>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_msc_filter_by_sevices" id="en_ups_small_msc_filter_by_sevices_label">
+                            Services
+                        </label>
+                      </div>
+
+                      <!-- Services list -->
+                      <div class="en_sr_form_control en_ups_small_msc_sr_services_list">
+                        <select name="en_msc_sr_services_list" id="en_msc_sr_services_list" multiple="multiple" data-attribute="en_service_list_value" data-optional="1" class="chosen_select en_service_list_value" style="width: 100% !important;" title="Services">
+                          <?php
+                            $services = eniture_shipping_rules_get_services_list();
+                            foreach ($services as $key => $value) {
+                              echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                      </div>
+                     </div>
+
+                    <!-- Override rates section -->
+                    <div class="en_sr_override_rates">
+                      <!-- Service name -->
+                      <div class="en_sr_form_control">
+                          <label for="en_sr_service_name">Service</label>
+                          <select name="en_sr_service_name" id="en_sr_service_name" data-optional="1" title="Service">
+                            <option hidden value="">Select service</option>
+                            <?php 
+                              $services = ['03' => 'Ground', '02' => '2nd Day Air', '59' => '2nd Day Air A.M', '13' => 'Next Day Air Saver', '01' => 'Next Day Air', '14' => 'Next Day Air Early', '12' => '3 Day Select', '11' => 'Standard', '08' => 'Expedited | UPS Worldwide Expedited', '65' => 'Express Saver | UPS Worldwide Saver', '07' => 'Express | UPS Worldwide Express', '54' => 'Express Plus | UPS Worldwide Express Plus', '92' => 'SurePost Less than 1LB', '93' => 'SurePost 1LB or greater', '94' => 'SurePost Bound Printed Matter', '95' => 'SurePost Media Mail', 'GFP' => 'Ground with Freight Pricing', 'usrg' => 'Simple Rate - Ground', 'usr3' => 'Simple Rate - 3-day Select', 'usr2' => 'Simple Rate - 2-day Air', 'usr1' => 'Simple Rate - Next Day Air Saver'];
+                              
+                              foreach ($services as $key => $value) {
+                                  echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
+                              }
+                            ?>
+                          </select>
+                          <span class="en_sr_err"></span>
+                      </div>
+  
+                      <!-- Service rate -->
+                      <div class="en_sr_form_control">
+                          <label for="en_ups_small_sr_service_rate">Service rate</label>
+                          <input type="text" title="Service rate" name="en_ups_small_sr_service_rate" id="en_ups_small_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" placeholder="Enter amount or percentage (e.g. 10, -5, 20%)">
+                          <span class="en_sr_err"></span>
+                      </div>
+                    </div>
+
+                    <!-- Restrict to state rule section -->
+                    <div class="en_sr_restrict_to_state">
+                      <!-- Filter by Country -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_country">
+                           Countries
+                        </label>
+                        <select name="en_ups_small_sr_country" id="en_ups_small_sr_country" title="Countries">
+                          <option value="US">US</option>
+                          <option value="CA">CA</option>
+                        </select>
+                      </div>
+
+                      <!-- Filter by State -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_state" id="en_ups_small_filter_by_state_label">
+                           States/Provinces
+                        </label>
+                      </div>
+                      <!-- US States list -->
+                      <div class="en_sr_form_control en_ups_small_sr_us_states_list">
+                        <select name="en_sr_states_list" id="en_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                          <?php 
+                            global $woocommerce;
+                            $countries_obj = new WC_Countries();
+                            $us_states = $countries_obj->get_states('US');
+
+                            if (isset($us_states) && !empty($us_states)) {
+                              foreach ($us_states as $key => $value) {
+                                  echo "<option class='us_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                              }
+                          }
+                        ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                        <span class="descrption">
+                          Only customers from these states/provinces will be presented with shipping rates for this provider.
+                        </span>
+                      </div>
+
+                      <!-- CA States list -->
+                      <div class="en_sr_form_control en_ups_small_sr_ca_states_list">
+                        <select name="en_sr_states_list" id="en_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                          <?php 
+                            global $woocommerce;
+                            $countries_obj = new WC_Countries();
+                            $ca_states = $countries_obj->get_states('CA');
+
+                            if (isset($ca_states) && !empty($ca_states)) {
+                                foreach ($ca_states as $key => $value) {
+                                    echo "<option class='ca_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                                }
+                            }
+                        ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                        <span class="descrption">
+                          Only customers from these states/provinces will be presented with shipping rates for this provider.
+                        </span>
+                      </div>
+                    </div>
+
+                    <!-- Filters section -->
+                    <div class="en_ups_small_sr_filters_section">
+                      <!-- Filter by Weight -->
+                      <div class="en_sr_form_control">
+                        <div>
+                          <label for="filter_by_weight">
+                            <input type="checkbox" title="Filter by weight" name="filter_by_weight" id="filter_by_weight"> Filter by weight
+                          </label>
+                        </div>
+                        <span class="en_sr_err"></span>
+                      </div>
+                      <div class="group_sr_form_control">
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_weight_from">From</label>
+                          <input type="text" title="From" name="en_sr_weight_from" id="en_sr_weight_from" data-optional="1" maxlength="10">
+                          <span class="en_sr_err"></span>
+                        </div>
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_weight_to">To</label>
+                          <input type="text" title="To" name="en_sr_weight_to" id="en_sr_weight_to" data-optional="1" maxlength="10">
+                          <span class="en_sr_err"></span>
+                        </div>
+                      </div>
+  
+                      <!-- Filter by Price -->
+                      <div class="en_sr_form_control">
+                        <div>
+                          <label for="en_sr_filter_price">
+                            <input type="checkbox" title="Filter by price" name="en_sr_filter_price" id="en_sr_filter_price"> Filter by price
+                          </label>
+                        </div>
+                        <span class="en_sr_err"></span>
+                      </div>
+                      <div class="group_sr_form_control">
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_price_from">From</label>
+                          <input type="text" title="From" name="en_sr_price_from" id="en_sr_price_from" data-optional="1" maxlength="20">
+                          <span class="en_sr_err"></span>
+                        </div>
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_price_to">To</label>
+                          <input type="text" title="To" name="en_sr_price_to" id="en_sr_price_to" data-optional="1" maxlength="20">
+                          <span class="en_sr_err"></span>
+                        </div>
+                      </div>
+                      
+                      <!-- Filter by Quantity -->
+                      <div class="en_sr_form_control">
+                        <div>
+                          <label for="filter_by_quantity">
+                            <input type="checkbox" title="Filter by quantity" name="filter_by_quantity" id="filter_by_quantity"> Filter by quantity
+                          </label>
+                        </div>
+                        <span class="en_sr_err"></span>
+                      </div>
+                      <div class="group_sr_form_control">
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_quantity_from">From</label>
+                          <input type="text" title="From" name="en_sr_quantity_from" id="en_sr_quantity_from" data-optional="1" maxlength="20">
+                          <span class="en_sr_err"></span>
+                        </div>
+                        <div class="en_sr_form_control">
+                          <label for="en_sr_quantity_to">To</label>
+                          <input type="text" title="To" name="en_sr_quantity_to" id="en_sr_quantity_to" data-optional="1" maxlength="20">
+                          <span class="en_sr_err"></span>
+                        </div>
+                      </div>
+  
+                      <!-- Filter by product tag -->
+                      <div class="en_sr_form_control">
+                        <div>
+                          <label for="filter_by_product_tag">
+                            <input type="checkbox" title="Filter by product tag" name="filter_by_product_tag" id="filter_by_product_tag"> Filter by product tag
+                          </label>
+                        </div>
+                        <span class="en_sr_err"></span>
+                      </div>
+  
+                      <div class="en_sr_form_control">
+                        <select id="en_sr_product_tags_list" multiple="multiple" data-attribute="en_product_tag_filter_value"
+                                name="en_product_tag_filter_value"
+                                title="Filter by product tag"
+                                data-optional="1"
+                                class="chosen_select en_product_tag_filter_value"
+                                style="width: 100% !important;"
+                                >
+                            <?php
+                              $en_products_tags = get_tags( array( 'taxonomy' => 'product_tag' ) );
+                              if (isset($en_products_tags) && !empty($en_products_tags)) {
+                                  foreach ($en_products_tags as $key => $tag) {
+                                      echo "<option value='" . esc_attr($tag->term_taxonomy_id) . "'>" . esc_html($tag->name) . "</option>";
+                                  }
+                              }
+                            ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                      </div>
+                    </div>
+
+                    <!-- Override Rates Filters -->
+                    <div class="en_or_sr_filters">
+                        <!-- Filter by Country -->
+                        <section>
+                          <div class="en_sr_form_control">
+                            <div>
+                              <label for="filter_by_country_or">
+                                <input type="checkbox" title="Filter by country" name="filter_by_country_or" id="filter_by_country_or"> Filter by country
+                              </label>
+                            </div>
+                          </div>
+                          <!-- Country list -->
+                          <div class="en_sr_form_control">
+                            <select name="en_ups_small_or_sr_country" id="en_ups_small_or_sr_country" title="Countries">
+                              <option value="">Select One</option>
+                              <option value="US">US</option>
+                              <option value="CA">CA</option>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                          </div>
+                        </section>
+
+                        <!-- Filter by State -->
+                        <section>
+                          <div class="en_sr_form_control">
+                            <div>
+                              <label for="filter_by_state_or">
+                                <input type="checkbox" title="Filter by state" name="filter_by_state_or" id="filter_by_state_or"> Filter by state
+                              </label>
+                            </div>
+                            <span class="en_sr_err"></span>
+                          </div>
+
+                          <!-- US States list -->
+                          <div class="en_sr_form_control en_ups_small_or_sr_us_states_list">
+                            <select name="en_or_sr_states_list" id="en_or_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                              <?php 
+                                global $woocommerce;
+                                $countries_obj = new WC_Countries();
+                                $us_states = $countries_obj->get_states('US');
+
+                                if (isset($us_states) && !empty($us_states)) {
+                                  foreach ($us_states as $key => $value) {
+                                      echo "<option class='or_us_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                                  }
+                              }
+                            ?>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                            <span class="descrption">
+                              Only customers from these states/provinces will be presented with shipping rates for this provider.
+                            </span>
+                          </div>
+
+                          <!-- CA States list -->
+                          <div class="en_sr_form_control en_ups_small_or_sr_ca_states_list">
+                            <select name="en_or_sr_states_list" id="en_or_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                              <?php 
+                                global $woocommerce;
+                                $countries_obj = new WC_Countries();
+                                $ca_states = $countries_obj->get_states('CA');
+
+                                if (isset($ca_states) && !empty($ca_states)) {
+                                    foreach ($ca_states as $key => $value) {
+                                        echo "<option class='or_ca_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                                    }
+                                }
+                            ?>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                            <span class="descrption">
+                              Only customers from these states/provinces will be presented with shipping rates for this provider.
+                            </span>
+                          </div>
+
+                          <!-- Empty states list -->
+                          <div class="en_sr_form_control en_ups_small_or_empty_sr_states_list">
+                            <select name="en_or_empty_sr_states_list" id="en_or_empty_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                          </div>
+                        </section>
+                    </div>
+
+                    <!-- Available checkbox -->
+                    <div class="en_sr_form_control">
+                      <div>
+                        <label for="en_sr_avialable">
+                          <input type="checkbox" title="Available" name="en_sr_avialable" id="en_sr_avialable" checked> Available
+                        </label>
+                      </div>
+                      <span class="en_sr_err"></span>
+                    </div>
+
+                    <!-- Form submit button -->
+                    <div class="form-btns">
+                        <input type="submit" name="en_wd_submit_warehouse" value="Save" class="save_warehouse_form save_shipping_rule_form">
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
Index: /small-package-quotes-ups-edition/tags/4.5.17/small-package-quotes-ups-edition.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/small-package-quotes-ups-edition.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/small-package-quotes-ups-edition.php	(revision 3237693)
@@ -0,0 +1,615 @@
+<?php
+/**
+ * Plugin Name:    Small Package Quotes - UPS Edition
+ * Plugin URI:     https://eniture.com/products/
+ * Description:    Dynamically retrieves your negotiated shipping rates from UPS and displays the results in the WooCommerce shopping cart.
+ * Version:        4.5.17
+ * Author:         Eniture Technology
+ * Author URI:     http://eniture.com/
+ * Text Domain:    small-package-quotes-ups-edition
+ * License:           GPL-2.0-or-later
+ * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
+ * Requires at least: 6.6
+ * Requires PHP:      7.4
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+define('ENITURE_UPS_SPQ_MAIN_DOMAIN', 'https://eniture.com');
+define('ENITURE_UPS_DOMAIN_HITTING_URL', 'https://ws032.eniture.com');
+define('ENITURE_UPS_SPQ_FDO_HITTING_URL', 'https://freightdesk.online/api/updatedWoocomData');
+
+add_action('before_woocommerce_init', function () {
+    if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
+        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
+    }
+});
+
+define('UPS_MAIN_FILE', __FILE__);
+// Define reference
+function eniture_ups_small_plugin($plugins)
+{
+    $plugins['spq'] = (isset($plugins['spq'])) ? array_merge($plugins['spq'], ['ups_small' => 'WC_ups_small']) : ['ups_small' => 'WC_ups_small'];
+    return $plugins;
+}
+
+add_filter('en_plugins', 'eniture_ups_small_plugin');
+if (!function_exists('eniture_woo_plans_notification_PD')) {
+
+    function eniture_woo_plans_notification_PD($product_detail_options)
+    {
+        $eniture_plugins_id = 'eniture_plugin_';
+
+        for ($en = 1; $en <= 25; $en++) {
+            $settings = get_option($eniture_plugins_id . $en);
+            if (isset($settings) && (!empty($settings)) && (is_array($settings))) {
+                $plugin_detail = current($settings);
+                $plugin_name = (isset($plugin_detail['plugin_name'])) ? $plugin_detail['plugin_name'] : "";
+
+                foreach ($plugin_detail as $key => $value) {
+                    if ($key != 'plugin_name') {
+                        $action = $value === 1 ? 'enable_plugins' : 'disable_plugins';
+                        $product_detail_options[$key][$action] = (isset($product_detail_options[$key][$action]) && strlen($product_detail_options[$key][$action]) > 0) ? $product_detail_options[$key][$action] . ", $plugin_name" : "$plugin_name";
+                    }
+                }
+            }
+        }
+
+        return $product_detail_options;
+    }
+
+    add_filter('en_woo_plans_notification_action', 'eniture_woo_plans_notification_PD', 10, 1);
+}
+
+if (!function_exists('eniture_woo_plans_notification_message')) {
+
+    function eniture_woo_plans_notification_message($enable_plugins, $disable_plugins)
+    {
+        $enable_plugins = (strlen($enable_plugins) > 0) ? "$enable_plugins: <b> Enabled</b>. " : "";
+        $disable_plugins = (strlen($disable_plugins) > 0) ? " $disable_plugins: Upgrade to <b>Standard Plan to enable</b>." : "";
+        return $enable_plugins . "<br>" . $disable_plugins;
+    }
+
+    add_filter('en_woo_plans_notification_message_action', 'eniture_woo_plans_notification_message', 10, 2);
+}
+
+//Product detail set plans notification message for nested checkbox
+if (!function_exists('eniture_woo_plans_nested_notification_message')) {
+
+    function eniture_woo_plans_nested_notification_message($enable_plugins, $disable_plugins, $feature)
+    {
+        $enable_plugins = (strlen($enable_plugins) > 0) ? "$enable_plugins: <b> Enabled</b>. " : "";
+        $disable_plugins = (strlen($disable_plugins) > 0 && $feature == 'nested_material') ? " $disable_plugins: Upgrade to <b>Advance Plan to enable</b>." : "";
+        return $enable_plugins . "<br>" . $disable_plugins;
+    }
+
+    add_filter('en_woo_plans_nested_notification_message_action', 'eniture_woo_plans_nested_notification_message', 10, 3);
+}
+
+/**
+ * Load scripts for UPS Small json tree view
+ */
+if (!function_exists('eniture_ups_small_jtv_script')) {
+    function eniture_ups_small_jtv_script()
+    {
+        wp_register_style('ups_small_json_tree_view_style', plugin_dir_url(__FILE__) . 'logs/en-json-tree-view/en-jtv-style.css');
+        wp_register_script('ups_small_json_tree_view_script', plugin_dir_url(__FILE__) . 'logs/en-json-tree-view/en-jtv-script.js', ['jquery'], '1.0.0');
+
+        wp_enqueue_style('ups_small_json_tree_view_style');
+        wp_enqueue_script('ups_small_json_tree_view_script', [
+            'en_tree_view_url' => plugins_url(),
+        ]);
+
+        // Shipping rules script and styles
+        wp_enqueue_script('en_woo_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0.6');
+        wp_localize_script('en_woo_sr_script', 'sr_script', array(
+            'pluginsUrl' => plugins_url(),
+            'nonce' => wp_create_nonce('en_woo_sr_nonce')
+        ));
+        wp_register_style('shipping_rules_section', plugin_dir_url(__FILE__) . '/shipping-rules/assets/css/shipping_rules.css', false, '1.0.3');
+        wp_enqueue_style('shipping_rules_section');
+    }
+
+    add_action('admin_init', 'eniture_ups_small_jtv_script');
+}
+
+if (!function_exists('is_plugin_active')) {
+    require_once(ABSPATH . 'wp-admin/includes/plugin.php');
+}
+
+if (!is_plugin_active('woocommerce/woocommerce.php')) {
+    add_action('admin_notices', 'eniture_ups_small_wc_avaibility_err');
+}
+
+/**
+ * Check woocommerce installlation
+ */
+function eniture_ups_small_wc_avaibility_err()
+{
+    $message = "UPS Small is enabled, but not effective. It requires WooCommerce to work, please <a target='_blank' href='https://wordpress.org/plugins/woocommerce/installation/'>Install</a> WooCommerce Plugin.";
+    echo '<div class="error"> <p>' . esc_html($message) . '</p></div>';
+}
+
+add_action('admin_init', 'eniture_ups_small_check_woo_version');
+
+/**
+ * Check woo-commerce version compatibility
+ */
+function eniture_ups_small_check_woo_version()
+{
+    $woo_version = eniture_ups_small_wc_version_number();
+    $version = '2.6';
+    if (!version_compare($woo_version, $version, ">=")) {
+        add_action('admin_notices', 'eniture_ups_small_wc_version_failure');
+    }
+}
+
+/**
+ * Check woo-commerce version incompatibility
+ */
+function eniture_ups_small_wc_version_failure()
+{
+    ?>
+    <div class="notice notice-error">
+        <p>
+            <?php
+            esc_html_e('UPS Small plugin requires WooCommerce version 2.6 or higher to work. Functionality may not work properly.', 'eniture-ups-small-version-failure');
+            ?>
+        </p>
+    </div>
+    <?php
+}
+
+/**
+ * Return woo-commerce version
+ * @return string
+ */
+function eniture_ups_small_wc_version_number()
+{
+    $plugin_folder = get_plugins('/' . 'woocommerce');
+    $plugin_file = 'woocommerce.php';
+
+    if (isset($plugin_folder[$plugin_file]['Version'])) {
+        return $plugin_folder[$plugin_file]['Version'];
+    } else {
+        return NULL;
+    }
+}
+
+if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) || is_plugin_active_for_network('woocommerce/woocommerce.php')) {
+
+    add_action('admin_enqueue_scripts', 'eniture_ups_small_admin_script');
+
+    /**
+     * Load scripts for UPS Small
+     */
+    function eniture_ups_small_admin_script()
+    {
+
+        wp_register_style('eniture_ups_small_style', plugin_dir_url(__FILE__) . '/css/ups-small-style.css', false, '1.1.8');
+        wp_enqueue_style('eniture_ups_small_style');
+    }
+
+    add_filter('plugin_action_links', 'eniture_ups_small_add_action_plugin', 10, 5);
+
+    /**
+     * UPS Small action links
+     * @staticvar type $plugin
+     * @param $actions
+     * @param $plugin_file
+     * @return settings array
+     */
+    function eniture_ups_small_add_action_plugin($actions, $plugin_file)
+    {
+        static $plugin;
+
+        if (!isset($plugin))
+            $plugin = plugin_basename(__FILE__);
+
+        if ($plugin == $plugin_file) {
+            $settings = array('settings' => '<a href="admin.php?page=wc-settings&tab=ups_small">' . __('Settings', 'small-package-quotes-ups-edition') . '</a>');
+            $site_link = array('support' => '<a href="https://support.eniture.com/" target="_blank">Support</a>');
+            $actions = array_merge($settings, $actions);
+            $actions = array_merge($site_link, $actions);
+        }
+        return $actions;
+    }
+
+    add_action('admin_enqueue_scripts', 'eniture_ups_small_script');
+
+    /**
+     * Load Front-end scripts for ups
+     */
+    function eniture_ups_small_script()
+    {
+        wp_enqueue_script('jquery');
+        wp_enqueue_script('eniture_ups_small_script', plugin_dir_url(__FILE__) . 'js/en-ups-small.js', array(), '1.0.9');
+        wp_localize_script('eniture_ups_small_script', 'eniture_ups_small_admin_script', array(
+            'plugins_url' => plugins_url(),
+            'allow_proceed_checkout_eniture' => trim(get_option("allow_proceed_checkout_eniture")),
+            'prevent_proceed_checkout_eniture' => trim(get_option("prevent_proceed_checkout_eniture")),
+            'ups_small_order_cutoff_time' => get_option("ups_small_orderCutoffTime"),
+            'ups_small_packaging_type' => get_option("ups_small_packaging_type"),
+            'nonce' => wp_create_nonce('eniture_ups_small_nonce')
+        ));
+    }
+
+    /**
+     * Include Plugin Files
+     */
+    require_once('warehouse-dropship/wild-delivery.php');
+    require_once('shipping-rules/shipping-rules-save.php');
+    require_once('warehouse-dropship/get-distance-request.php');
+    require_once('standard-package-addon/standard-package-addon.php');
+    require_once 'update-plan.php';
+    require_once 'fdo/en-fdo.php';
+    require_once 'fdo/en-sbs.php';
+    require_once('ups-small-test-connection.php');
+    require_once 'helper/en_helper_class.php';
+    require_once('db/ups-small-db.php');
+    require_once('ups-small-auto-residential.php');
+    require_once('ups-small-admin-filter.php');
+    require_once('ups-small-shipping-class.php');
+    require_once('template/connection-settings.php');
+    require_once('template/quote-settings.php');
+
+    require_once 'product/en-common-product-detail.php';
+    require_once 'product/en-product-detail.php';
+
+    // Origin terminal address
+    add_action('admin_init', 'ups_small_update_warehouse');
+    add_action('admin_init', 'eniture_create_ups_small_shipping_rules_db');
+    require_once 'template/csv-export.php';
+    require_once('order-details/en-order-export.php');
+    require_once('order-details/en-order-widget.php');
+    require_once('template/products-nested-options.php');
+    require_once('ups-small-carrier-service.php');
+    require_once('ups-small-group-package.php');
+    require_once('ups-small-wc-update-change.php');
+    require_once('ups-small-curl-class.php');
+    require_once('ups_small_version_compact.php');
+
+    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
+
+    /**
+     * UPS Small Activation Hook
+     */
+    register_activation_hook(__FILE__, 'eniture_create_ups_small_wh_db');
+    register_activation_hook(__FILE__, 'eniture_create_ups_small_option');
+    register_activation_hook(__FILE__, 'eniture_old_store_ups_sm_dropship_status');
+    register_activation_hook(__FILE__, 'eniture_ups_small_activate_hit_to_update_plan');
+    register_deactivation_hook(__FILE__, 'eniture_ups_small_deactivate_hit_to_update_plan');
+    register_activation_hook(__FILE__, 'eniture_create_ups_small_shipping_rules_db');
+    register_deactivation_hook(__FILE__, 'eniture_ups_small_deactivate_plugin');
+
+    /**
+     * UPS Small Action And Filters
+     */
+    add_filter('woocommerce_shipping_methods', 'eniture_add_ups_small');
+    add_filter('woocommerce_get_settings_pages', 'eniture_ups_small_shipping_sections');
+    add_action('woocommerce_shipping_init', 'eniture_ups_small_init');
+    add_filter('woocommerce_package_rates', 'eniture_ups_small_hide_shipping');
+    add_filter('woocommerce_shipping_calculator_enable_city', '__return_true');
+    add_action('init', 'eniture_ups_small_no_method_available');
+    add_action('init', 'eniture_ups_small_default_error_message_selection');
+    add_action('init', 'eniture_create_ups_small_wh_db');
+
+    /**
+     * Update Default custom error message selection
+     */
+    function eniture_ups_small_default_error_message_selection()
+    {
+        $custom_error_selection = get_option('wc_pervent_proceed_checkout_eniture');
+        if (empty($custom_error_selection)) {
+            update_option('wc_pervent_proceed_checkout_eniture', 'prevent', true);
+            update_option('prevent_proceed_checkout_eniture', 'There are no shipping methods available for the address provided. Please check the address.', true);
+        }
+    }
+}
+
+/**
+ * ups small plugin update now
+ */
+function eniture_ups_small_update_now($upgrader_object, $options)
+{
+    $en_ups_small_path_name = plugin_basename(UPS_MAIN_FILE);
+    $plugin_info = get_plugins();
+    $plugin_version = (isset($plugin_info[$en_ups_small_path_name]['Version'])) ? $plugin_info[$en_ups_small_path_name]['Version'] : '';
+
+    if (isset($options['action']) && $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
+        foreach($options['plugins'] as $each_plugin) {
+            if ($each_plugin == $en_ups_small_path_name) {
+                if (!function_exists('eniture_ups_small_activate_hit_to_update_plan')) {
+                    require_once(__DIR__ . '/update-plan.php');
+                }
+        
+                if (function_exists('eniture_ups_small_activate_hit_to_update_plan') &&
+                    function_exists('eniture_old_store_ups_sm_dropship_status') &&
+                    function_exists('eniture_create_ups_small_wh_db') &&
+                    function_exists('eniture_create_ups_small_option') && 
+                    function_exists('eniture_create_ups_small_shipping_rules_db')) {
+        
+                    eniture_ups_small_activate_hit_to_update_plan();
+                    eniture_old_store_ups_sm_dropship_status();           
+                    eniture_create_ups_small_wh_db();
+                    eniture_create_ups_small_option();
+                    eniture_create_ups_small_shipping_rules_db();
+                }
+        
+                update_option('en_ups_small_update_now', $plugin_version);
+            }
+        }
+    }
+}
+
+add_action( 'upgrader_process_complete', 'eniture_ups_small_update_now', 10, 2);
+
+
+define("eniture_woo_plugin_ups_small", "ups_small");
+
+add_action('admin_enqueue_scripts', 'eniture_ups_small_frontend_checkout_script');
+
+/**
+ * Load Front-end scripts for ODFL
+ */
+function eniture_ups_small_frontend_checkout_script()
+{
+    wp_enqueue_script('jquery');
+    wp_enqueue_script('eniture_ups_small_frontend_checkout_script', plugin_dir_url(__FILE__) . 'front/js/en-ups-small-checkout.js', array(), '1.0.0');
+    wp_localize_script('eniture_ups_small_frontend_checkout_script', 'frontend_script', array(
+        'pluginsUrl' => plugins_url(),
+    ));
+    wp_register_style('eniture_ups_small_wickedpicker_style', 'https://cdn.jsdelivr.net/npm/wickedpicker@0.4.3/dist/wickedpicker.min.css', false, '2.0.3');
+    wp_enqueue_style('eniture_ups_small_wickedpicker_style');
+    wp_register_script('eniture_ups_small_wickedpicker_style', plugin_dir_url(__FILE__) . '/js/wickedpicker.js', false, '2.0.3');
+    wp_enqueue_script('eniture_ups_small_wickedpicker_style');
+}
+
+if (!function_exists('eniture_getHost')) {
+
+    function eniture_getHost($url)
+    {
+        $parseUrl = wp_parse_url(trim($url));
+        if (isset($parseUrl['host'])) {
+            $host = $parseUrl['host'];
+        } else {
+            $path = explode('/', $parseUrl['path']);
+            $host = $path[0];
+        }
+        
+        return trim($host);
+    }
+
+}
+/**
+ * Get Domain Name
+ */
+if (!function_exists('eniture_ups_small_get_domain')) {
+
+    function eniture_ups_small_get_domain()
+    {
+        global $wp;
+        $url = home_url($wp->request);
+        return eniture_getHost($url);
+    }
+}
+
+/**
+ * Plans Common Hooks
+ */
+add_filter('eniture_ups_small_quotes_plans_suscription_and_features', 'eniture_ups_small_quotes_plans_suscription_and_features', 1);
+
+function eniture_ups_small_quotes_plans_suscription_and_features($feature)
+{
+    $package = get_option('ups_small_package');
+    $features = array
+    (
+        'instore_pickup_local_devlivery' => array('3'),
+        'transit_days' => array('3'),
+        'insurance_fee' => array('2', '3'),
+        'contract_services' => array('2', '3'),
+        'nested_material' => array('3'),
+        'ups_small_cutOffTime_shipDateOffset' => array('2', '3'),
+        'hazardous_material' => array('2', '3')
+    );
+    if (get_option('ups_small_quotes_store_type') == "1") {
+        $features['multi_warehouse'] = array('2', '3');
+        $features['multi_dropship'] = array('', '0', '1', '2', '3');
+        $features['hazardous_material'] = array('2', '3');
+        $features['contract_services'] = array('2', '3');
+        $features['nested_material'] = array('3');
+    } else {
+        $dropship_status = get_option('en_old_user_dropship_status');
+        $warehouse_status = get_option('en_old_user_warehouse_status');
+
+        isset($dropship_status) && ($dropship_status == "0") ? $features['multi_dropship'] = array('', '0', '1', '2', '3') : '';
+        isset($warehouse_status) && ($warehouse_status == "0") ? $features['multi_warehouse'] = array('2', '3') : '';
+    }
+
+    return (isset($features[$feature]) && (in_array($package, $features[$feature]))) ? TRUE : ((isset($features[$feature])) ? $features[$feature] : '');
+}
+
+add_filter('eniture_ups_small_plans_notification_link', 'eniture_ups_small_plans_notification_link', 1);
+
+function eniture_ups_small_plans_notification_link($plans)
+{
+    $plan = current($plans);
+    $plan_to_upgrade = "";
+    switch ($plan) {
+        case 1:
+            $plan_to_upgrade = "<a target='_blank' href='https://eniture.com/woocommerce-ups-small-package-plugin/'>Basic Plan required.</a>";
+            break;
+        case 2:
+            $plan_to_upgrade = "<a target='_blank' href='https://eniture.com/woocommerce-ups-small-package-plugin/' target='_blank'>Standard Plan required.</a>";
+            break;
+        case 3:
+            $plan_to_upgrade = "<a target='_blank' href='https://eniture.com/woocommerce-ups-small-package-plugin/' target='_blank'>Advanced Plan required.</a>";
+            break;
+    }
+
+    return $plan_to_upgrade;
+}
+
+/**
+ *
+ * old customer check dropship / warehouse status on plugin update
+ */
+function eniture_old_store_ups_sm_dropship_status()
+{
+    global $wpdb;
+//  Check total no. of dropships on plugin updation
+    $table_name = $wpdb->prefix . 'warehouse';
+    $num = $wpdb->get_var("select count(*) from ". $table_name ." where location = 'dropship' ");
+
+    if (get_option('en_old_user_dropship_status') == "0" && get_option('ups_small_quotes_store_type') == "0") {
+        $dropship_status = ($num > 1) ? 1 : 0;
+
+        update_option('en_old_user_dropship_status', "$dropship_status");
+    } elseif (get_option('en_old_user_dropship_status') == "" && get_option('ups_small_quotes_store_type') == "0") {
+        $dropship_status = ($num == 1) ? 0 : 1;
+
+        update_option('en_old_user_dropship_status', "$dropship_status");
+    }
+
+    $warehouse_num = $wpdb->get_var("select count(*) from ". $wpdb->prefix." warehouse where location = 'warehouse' ");
+
+    if (get_option('en_old_user_warehouse_status') == "0" && get_option('ups_small_quotes_store_type') == "0") {
+        $warehouse_status = ($warehouse_num > 1) ? 1 : 0;
+
+        update_option('en_old_user_warehouse_status', "$warehouse_status");
+    } elseif (get_option('en_old_user_warehouse_status') == "" && get_option('ups_small_quotes_store_type') == "0") {
+        $warehouse_status = ($warehouse_num == 1) ? 0 : 1;
+
+        update_option('en_old_user_warehouse_status', "$warehouse_status");
+    }
+}
+// fdo va
+add_action('wp_ajax_nopriv_ups_s_fd', 'eniture_ups_s_fd_api');
+add_action('wp_ajax_ups_s_fd', 'eniture_ups_s_fd_api');
+/**
+ * UPS AJAX Request
+ */
+function eniture_ups_s_fd_api()
+{
+    if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'eniture_ups_small_nonce')) {
+        echo wp_json_encode([]);
+        return;
+    }
+
+    $store_name = eniture_ups_small_get_domain();
+    $company_id = isset($_POST['company_id']) ? sanitize_text_field(wp_unslash($_POST['company_id'])) : '';
+    $data = [
+        'plateform'  => 'wp',
+        'store_name' => $store_name,
+        'company_id' => $company_id,
+        'fd_section' => 'tab=ups_small&section=section-4',
+    ];
+    if (is_array($data) && count($data) > 0) {
+        if($_POST['disconnect'] != 'disconnect') {
+            $url =  'https://freightdesk.online/validate-company';
+        }else {
+            $url = 'https://freightdesk.online/disconnect-woo-connection';
+        }
+        $response = wp_remote_post($url, [
+                'method' => 'POST',
+                'timeout' => 60,
+                'redirection' => 5,
+                'blocking' => true,
+                'body' => $data,
+            ]
+        );
+        $response = wp_remote_retrieve_body($response);
+    }
+    if($_POST['disconnect'] == 'disconnect') {
+        $result = json_decode($response);
+        if ($result->status == 'SUCCESS') {
+            update_option('en_fdo_company_id_status', 0);
+        }
+    }
+    echo wp_json_encode(json_decode($response));
+    exit();
+}
+add_action('rest_api_init', 'eniture_rest_api_init_status_ups_s');
+function eniture_rest_api_init_status_ups_s()
+{
+    register_rest_route('fdo-company-id', '/update-status', array(
+        'methods' => 'POST',
+        'callback' => 'eniture_ups_s_fdo_data_status',
+        'permission_callback' => '__return_true'
+    ));
+}
+
+/**
+ * Update FDO coupon data
+ * @param array|WP_REST_Request $request
+ * @return array|void
+ */
+function eniture_ups_s_fdo_data_status(WP_REST_Request $request)
+{
+    $authenticated_user = fdo_update_status_authenticate($request);
+    if (is_wp_error($authenticated_user)) {
+        return $authenticated_user;
+    }
+
+    $status_data = $request->get_body();
+    $status_data_decoded = json_decode($status_data);
+    if (isset($status_data_decoded->connection_status)) {
+        update_option('en_fdo_company_id_status', $status_data_decoded->connection_status);
+        update_option('en_fdo_company_id', $status_data_decoded->fdo_company_id);
+    }
+    return true;
+}
+
+// fdo / va api calls authentication
+if (!function_exists('fdo_update_status_authenticate')) {
+    function fdo_update_status_authenticate($request) {
+        if ( !empty( $_SERVER['HTTP_CONSUMER_KEY'] ) && !empty( $_SERVER['HTTP_CONSUMER_SECRET'] ) ) {
+            $consumer_key    = $_SERVER['HTTP_CONSUMER_KEY'];
+            $consumer_secret = $_SERVER['HTTP_CONSUMER_SECRET'];
+        }else{
+            return new WP_Error('rest_authentication_error', __('Invalid Authorization header format.'), array('status' => 401));
+        }
+    
+        global $wpdb;
+        $consumer_key = wc_api_hash( sanitize_text_field( $consumer_key ) );
+        $user         = $wpdb->get_row(
+            $wpdb->prepare(
+                "
+            SELECT user_id, permissions
+            FROM {$wpdb->prefix}woocommerce_api_keys
+            WHERE consumer_key = %s
+        ",
+                $consumer_key
+            )
+        );
+    
+        if (!$user) {
+            return new WP_Error('invalid_keys', __('Invalid consumer key or secret.'), array('status' => 401));
+        }
+    
+        if (empty($user->permissions) || $user->permissions != 'read_write') {
+            return new WP_Error('rest_forbidden', __('User does not have write permissions.'), array('status' => 403));
+        }
+    
+        return $user;
+    }
+}
+
+/**
+ * Filter to check ground transit status
+ */
+if (!function_exists('eniture_ups_check_ground_transit_restrict_status')) {
+
+    function eniture_ups_check_ground_transit_restrict_status($ground_transit_statuses)
+    {
+        $ground_restrict_value = (false !== get_option('restrict_days_transit_package_ups_small')) ? get_option('restrict_days_transit_package_ups_small') : '';
+        if ('' !== $ground_restrict_value && strlen(trim($ground_restrict_value)) 
+            && apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'transit_days')) {
+            $ground_transit_statuses['ups'] = '1';
+        }
+
+        return $ground_transit_statuses;
+    }
+
+    add_filter('eniture_check_ground_transit_restrict_status', 'eniture_ups_check_ground_transit_restrict_status', 11, 1);
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/instore-pickup-local-delivery/instore-local-delivery.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/instore-pickup-local-delivery/instore-local-delivery.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/instore-pickup-local-delivery/instore-local-delivery.php	(revision 3237693)
@@ -0,0 +1,170 @@
+<?php
+
+/**
+ * Includes Ajax Request class
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists("Eniture_UpsSmallWDQuotes")) {
+
+    class Eniture_UpsSmallWDQuotes
+    {
+
+        public function __construct()
+        {
+            add_filter('en_ups_small_wd_update_query_string', array($this, 'en_ups_small_wd_update_query_string'), 10, 1);
+            add_filter('en_ups_small_wd_origin_array_set', array($this, 'en_ups_small_wd_origin_array_set'), 10, 1);
+            add_filter('en_ups_small_wd_standard_plans', array($this, 'en_ups_small_wd_standard_plans'), 10, 4);
+            add_filter('suppress_local_delivery', array($this, 'suppress_local_delivery'), 10, 4);
+        }
+
+        public function suppress_local_delivery($quotes, $origin_array, $package_plugin, $Instor_pickup_local_delivery)
+        {
+
+            $action = $this->check_package_plan($package_plugin);
+
+            $local_delivery = (isset($Instor_pickup_local_delivery->localDelivery) && ($Instor_pickup_local_delivery->localDelivery->status == 1)) ? FALSE : TRUE;
+            $in_store_pickup = (isset($Instor_pickup_local_delivery->inStorePickup) && ($Instor_pickup_local_delivery->inStorePickup->status == 1)) ? FALSE : TRUE;
+
+            if ($action || ($local_delivery && $in_store_pickup)) {
+                return $quotes;
+            }
+
+            if ($local_delivery) {
+                $origin_array['suppress_local_delivery'] = 0;
+            }
+
+            return ($origin_array['suppress_local_delivery'] != 1 || is_admin()) ? $quotes : array();
+        }
+
+
+        /**
+         * check enable for store pickup and local delivery
+         * @param string type $destination_zip
+         * @param array type $origin_array
+         * @return boolean type
+         */
+        function set_enabled_enable_packages($destination_zip, $origin_array, $post_data)
+        {
+
+
+            $InstorPickupLocalDelivery = array();
+
+            if (isset($origin_array['enable_store_pickup']) && ($origin_array['enable_store_pickup'] == 1)) {
+                $InstorPickupLocalDelivery['inStorePickup']['addressWithInMiles'] = $origin_array['miles_store_pickup'];
+                $InstorPickupLocalDelivery['inStorePickup']['postalCodeMatch'] = (strpos(strtolower($origin_array['match_postal_store_pickup']), strtolower($destination_zip)) !== FALSE) ? 1 : 0;
+            }
+
+            if (isset($origin_array['enable_local_delivery']) && ($origin_array['enable_local_delivery'] == 1)) {
+
+                $InstorPickupLocalDelivery['localDelivery']['addressWithInMiles'] = $origin_array['miles_local_delivery'];
+                $InstorPickupLocalDelivery['localDelivery']['postalCodeMatch'] = (strpos(strtolower($origin_array['match_postal_local_delivery']), strtolower($destination_zip)) !== FALSE) ? 1 : 0;
+            }
+
+            (!empty($InstorPickupLocalDelivery)) ? $post_data['InstorPickupLocalDelivery'] = $InstorPickupLocalDelivery : $post_data;
+
+
+            return $post_data;
+        }
+
+        public function en_ups_small_wd_standard_plans($post_data, $destination_zip, $origin_array, $package_plugin)
+        {
+            $action = $this->check_package_plan($package_plugin);
+
+            if ($action) {
+                return $post_data;
+            }
+
+            return $this->set_enabled_enable_packages($destination_zip, $origin_array, $post_data);
+        }
+
+        /**
+         * updated string for warehouse table
+         * @return string
+         */
+        public function en_ups_small_wd_update_query_string()
+        {
+            // Terminal phone number
+            return " ,phone_instore, enable_store_pickup , fee_local_delivery , suppress_local_delivery , miles_store_pickup , match_postal_store_pickup , checkout_desc_store_pickup , enable_local_delivery , miles_local_delivery , match_postal_local_delivery , checkout_desc_local_delivery , origin_markup ";
+        }
+
+        /**
+         * Origin array
+         * @param array type $origin
+         * @return array type
+         */
+        public function en_ups_small_wd_origin_array_set($origin)
+        {
+            if (empty($origin) || !is_object($origin)) {
+                return $origin;
+            }
+
+            $zip = (isset($origin->zip)) ? $origin->zip : "";
+            $city = (isset($origin->city)) ? $origin->city : "";
+            $state = (isset($origin->state)) ? $origin->state : "";
+            // Origin terminal address
+            $address = (isset($origin->address)) ? $origin->address : "";
+            // Terminal phone number
+            $phone_instore = (isset($origin->phone_instore)) ? $origin->phone_instore : "";
+            $country = (isset($origin->country)) ? $origin->country : "";
+            $location = (isset($origin->location)) ? $origin->location : "";
+            $locationId = (isset($origin->id)) ? $origin->id : "";
+
+            $enable_store_pickup = (isset($origin->enable_store_pickup)) ? $origin->enable_store_pickup : "";
+            $fee_local_delivery = (isset($origin->fee_local_delivery)) ? $origin->fee_local_delivery : "";
+            $suppress_local_delivery = (isset($origin->suppress_local_delivery)) ? $origin->suppress_local_delivery : "";
+            $miles_store_pickup = (isset($origin->miles_store_pickup)) ? $origin->miles_store_pickup : "";
+            $match_postal_store_pickup = (isset($origin->match_postal_store_pickup)) ? $origin->match_postal_store_pickup : "";
+            $checkout_desc_store_pickup = (isset($origin->checkout_desc_store_pickup)) ? $origin->checkout_desc_store_pickup : "";
+            $enable_local_delivery = (isset($origin->enable_local_delivery)) ? $origin->enable_local_delivery : "";
+            $miles_local_delivery = (isset($origin->miles_local_delivery)) ? $origin->miles_local_delivery : "";
+            $match_postal_local_delivery = (isset($origin->match_postal_local_delivery)) ? $origin->match_postal_local_delivery : "";
+            $checkout_desc_local_delivery = (isset($origin->checkout_desc_local_delivery)) ? $origin->checkout_desc_local_delivery : "";
+
+            $origin_markup = (isset($origin->origin_markup)) ? $origin->origin_markup : "";
+
+            return array(
+                'locationId' => $locationId,
+                'zip' => $zip,
+                'city' => $city,
+                'state' => $state,
+                // Origin terminal address
+                'address' => $address,
+                // Terminal phone number
+                'phone_instore' => $phone_instore,
+                'location' => $location,
+                'country' => $country,
+                'enable_store_pickup' => $enable_store_pickup,
+                'fee_local_delivery' => $fee_local_delivery,
+                'suppress_local_delivery' => $suppress_local_delivery,
+                'miles_store_pickup' => $miles_store_pickup,
+                'match_postal_store_pickup' => $match_postal_store_pickup,
+                'checkout_desc_store_pickup' => $checkout_desc_store_pickup,
+                'enable_local_delivery' => $enable_local_delivery,
+                'miles_local_delivery' => $miles_local_delivery,
+                'match_postal_local_delivery' => $match_postal_local_delivery,
+                'checkout_desc_local_delivery' => $checkout_desc_local_delivery,
+                'origin_markup' => $origin_markup,
+
+            );
+        }
+
+        /**
+         * Check package plan
+         */
+        function check_package_plan($package)
+        {
+
+//          In-store pickup and local delivery
+            $instore_pickup_local_devlivery_action = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'instore_pickup_local_devlivery');
+
+            return (!is_array($instore_pickup_local_devlivery_action)) ? FALSE : TRUE;
+        }
+
+    }
+
+    new Eniture_UpsSmallWDQuotes();
+}
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/standard-package-addon.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/standard-package-addon.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/standard-package-addon.php	(revision 3237693)
@@ -0,0 +1,15 @@
+<?php
+
+if (!defined('ABSPATH')) {
+  exit;
+}
+
+/* 
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+
+require_once 'instore-pickup-local-delivery/instore-local-delivery.php';
+require_once 'transit-days/transit-days.php';
Index: /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/transit-days/transit-days.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/transit-days/transit-days.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/standard-package-addon/transit-days/transit-days.php	(revision 3237693)
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * transit days
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists("Eniture_UpsSmallTransitDays")) {
+
+    class Eniture_UpsSmallTransitDays
+    {
+        // Exclude ground service
+        public function ups_enable_disable_ups_ground($result)
+        {
+            $transit_day_type = get_option('restrict_calendar_transit_small_packages_ups'); //get value of check box to see which one is checked
+            $days_to_restrict = get_option('restrict_days_transit_package_ups_small');
+            $action = get_option("ups_small_package");
+            $package = $transit_days = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'transit_days');
+            $package = (isset($package) && ($package == 1 || $package == 2)) ? TRUE : FALSE;
+            $ups_rate = isset($result->q) ? $result->q : [];
+            $ups_rate = empty($ups_rate) && isset($result->ups_rate) ? $result->ups_rate : $ups_rate;
+            if ($package && strlen(trim($days_to_restrict)) > 0 && strlen($transit_day_type) > 0) {
+                foreach ($ups_rate as $key => $service) {
+                    if ((isset($service->Service, $service->Service->Code) && $service->Service->Code == "03")
+                    || (isset($service->RatedShipment, $service->RatedShipment->Service, $service->RatedShipment->Service->Code) && $service->RatedShipment->Service->Code == "03")) {
+                        $estimated_arrival_days = (isset($service->$transit_day_type)) ? $service->$transit_day_type : 0;
+                        if ($estimated_arrival_days > $days_to_restrict) {
+                            $ups_services = (array)$result->ups_services;
+                            $ups_services = array_flip($ups_services);
+                            $index = (isset($ups_services['UPS Ground'])) ? $ups_services['UPS Ground'] : "";
+                            if(isset($result->q->$index)){
+                                unset($result->q->$index);
+                            }else if(isset($result->ups_rate->$index)){
+                                unset($result->ups_rate->$index);
+                            }
+                        }
+                    }
+                }
+            }
+            return $result;
+        }
+    }
+}
+        
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/template/connection-settings.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/template/connection-settings.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/template/connection-settings.php	(revision 3237693)
@@ -0,0 +1,113 @@
+<?php
+/**
+ * UPS Small WooComerce |  Connection Settings Tab Class
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * UPS Small WooComerce |  Connection Settings Tab Class
+ */
+class Eniture_UPS_Small_Connection_Settings
+{
+    /**
+     * Connection Settings Fields
+     * @return Connection Settings Array
+     */
+    public function ups_small_con_setting()
+    {
+        $default_api = empty(get_option('ups_small_username')) ? 'ups_new_api' : 'ups_old_api';
+        
+        echo '<div class="ups_small_connection_section ups_small_wrapper">';
+        $settings = array(
+            'section_title_ups_small' => array(
+                'name' => '',
+                'type' => 'title',
+                'id' => 'ups_small_connection_title',
+            ),
+
+            'ups_api_endpoint' => array(
+                'name' => __('Which API will you connect to? ', 'small-package-quotes-ups-edition'),
+                'type' => 'select',
+                'default' => $default_api,
+                'id' => 'ups_api_endpoint',
+                'options' => array(
+                    'ups_old_api' => __('Legacy API', 'small-package-quotes-ups-edition'),
+                    'ups_new_api' => __('New API', 'small-package-quotes-ups-edition')
+                )
+            ),
+
+            'acc_number_ups_small' => array(
+                'name' => __('Account Number ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_small_account_number'
+            ),
+
+            // New API
+            'ups_client_id' => array(
+                'name' => __('Client ID ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_client_id',
+                'class' => 'ups_new_api_field'
+            ),
+
+            'ups_client_secret' => array(
+                'name' => __('Client Secret ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_client_secret',
+                'class' => 'ups_new_api_field'
+            ),
+            'ups_new_api_username' => array(
+                'name' => __('Username ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_new_api_username',
+                'class' => 'ups_new_api_field'
+            ),
+            'ups_new_api_password' => array(
+                'name' => __('Password ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_new_api_password',
+                'class' => 'ups_new_api_field'
+            ),
+
+            // Old API
+            'username_ups_small' => array(
+                'name' => __('Username ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_small_username',
+                'class' => 'ups_old_api_field'
+            ),
+
+            'password_ups_small' => array(
+                'name' => __('Password ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_small_password',
+                'class' => 'ups_old_api_field'
+            ),
+
+            'auth_key_ups_small' => array(
+                'name' => __('API Access Key ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_small_api_access_key',
+                'class' => 'ups_old_api_field'
+            ),
+
+            'licence_key_ups_small' => array(
+                'name' => __('Eniture API Key ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => __('Obtain a Eniture API Key from <a href="https://eniture.com/woocommerce-ups-small-package-plugin/" target="_blank" >eniture.com </a>', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_licence_key'
+            ),
+
+            'section_end_ups_small' => array(
+                'type' => 'sectionend',
+                'id' => 'ups_small_licence_key'
+            ),
+        );
+        return $settings;
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/template/csv-export.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/template/csv-export.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/template/csv-export.php	(revision 3237693)
@@ -0,0 +1,275 @@
+<?php
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists('EnCsvExport')) {
+
+    class EnCsvExport
+    {
+        public function __construct()
+        {
+            add_filter('woocommerce_product_export_product_column_en_nickname', [$this, 'en_nickname'], 10, 2);
+            add_filter('woocommerce_product_export_product_column_en_city', [$this, 'en_city'], 10, 2);
+            add_filter('woocommerce_product_export_product_column_en_state', [$this, 'en_state'], 10, 2);
+            add_filter('woocommerce_product_export_product_column_en_zip', [$this, 'en_zip'], 10, 2);
+            add_filter('woocommerce_product_export_product_column_en_country', [$this, 'en_country'], 10, 2);
+
+            // Update new columns
+            add_filter('woocommerce_product_export_product_column_en_product_freight_class', [$this, 'en_product_freight_class'], 10, 2);
+            add_filter('woocommerce_product_export_product_column_en_product_freight_class_variation', [$this, 'en_product_freight_class_variation'], 10, 2);
+
+            // Add columns
+            add_filter('woocommerce_product_export_column_names', [$this, 'en_add_export_column'], 10, 2);
+            add_filter('woocommerce_product_export_product_default_columns', [$this, 'en_add_export_column'], 10, 2);
+        }
+
+        /**
+         * Add columns
+         * @param array $columns
+         * @return array
+         */
+        public function en_add_export_column($columns)
+        {
+            $columns['en_nickname'] = 'Meta:_dropship_location_nickname';
+            $columns['en_city'] = 'Meta:_dropship_location_city';
+            $columns['en_state'] = 'Meta:_dropship_location_state';
+            $columns['en_zip'] = 'Meta:_dropship_location_zip_code';
+            $columns['en_country'] = 'Meta:_dropship_location_country';
+
+            // Update new columns
+            $columns['en_product_freight_class'] = 'Meta:_product_freight_class';
+            $columns['en_product_freight_class_variation'] = 'Meta:_product_freight_class_variation';
+            if (isset($columns['meta:_dropship_location'])) {
+                unset($columns['meta:_dropship_location']);
+            }
+            if (isset($columns['meta:_ltl_freight'])) {
+                unset($columns['meta:_ltl_freight']);
+            }
+            if (isset($columns['meta:_ltl_freight_variation'])) {
+                unset($columns['meta:_ltl_freight_variation']);
+            }
+
+            $nested_mat_cols = ['_nestedmaterials', '_nestedpercentage', '_nesteddimension', '_maxnesteditems', '_nestedstakingproperty'];
+            foreach ($nested_mat_cols as $nested_mat_col) {
+                if (isset($columns['meta:' . $nested_mat_col])) {
+                    unset($columns['meta:' . $nested_mat_col]);
+                }
+
+                if (isset($columns['Meta:' . $nested_mat_col])) {
+                    unset($columns['Meta:' . $nested_mat_col]);
+                }
+            }
+
+            return $columns;
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_product_freight_class_variation($value, $product)
+        {
+            return get_post_meta($product->get_id(), '_ltl_freight_variation', true);
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_product_freight_class($value, $product)
+        {
+            return get_post_meta($product->get_id(), '_ltl_freight', true);
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+
+        public function en_nickname($value, $product)
+        {
+            $locations = [];
+            $_dropship_location = get_post_meta($product->get_id(), '_dropship_location', true);
+            $ds_id_arr = maybe_unserialize($_dropship_location);
+            if(isset($ds_id_arr) && !empty($ds_id_arr) && !is_string($ds_id_arr)) {
+                foreach ($ds_id_arr as $key => $ds_id) {
+                    $locations[] = $this->en_get_address($ds_id);
+                }
+            }else{
+                $locations[] = $this->en_get_address($_dropship_location);
+            }
+            $index = '';
+            foreach ($locations as $key => $location) {
+                $index_value = (isset($location['nickname'])) ? $location['nickname'] : '';
+                $index .= strlen($index) > 0 ? ',' . $index_value : $index_value;
+            }
+            return $index;
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_city($value, $product)
+        {
+            $locations = [];
+            $_dropship_location = get_post_meta($product->get_id(), '_dropship_location', true);
+            $ds_id_arr = maybe_unserialize($_dropship_location);
+            if(isset($ds_id_arr) && !empty($ds_id_arr) && !is_string($ds_id_arr)) {
+                foreach ($ds_id_arr as $key => $ds_id) {
+                    $locations[] = $this->en_get_address($ds_id);
+                }
+            }else{
+                $locations[] = $this->en_get_address($_dropship_location);
+            }
+            $index = '';
+            foreach ($locations as $key => $location) {
+                $index_value = (isset($location['city'])) ? $location['city'] : '';
+                $index .= strlen($index) > 0 ? ',' . $index_value : $index_value;
+            }
+            return $index;
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_state($value, $product)
+        {
+            $locations = [];
+            $_dropship_location = get_post_meta($product->get_id(), '_dropship_location', true);
+            $ds_id_arr = maybe_unserialize($_dropship_location);
+            if(isset($ds_id_arr) && !empty($ds_id_arr) && !is_string($ds_id_arr)) {
+                foreach ($ds_id_arr as $key => $ds_id) {
+                    $locations[] = $this->en_get_address($ds_id);
+                }
+            }else{
+                $locations[] = $this->en_get_address($_dropship_location);
+            }
+            $index = '';
+            foreach ($locations as $key => $location) {
+                $index_value = (isset($location['state'])) ? $location['state'] : '';
+                $index .= strlen($index) > 0 ? ',' . $index_value : $index_value;
+            }
+            return $index;
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_zip($value, $product)
+        {
+            $locations = [];
+            $_dropship_location = get_post_meta($product->get_id(), '_dropship_location', true);
+            $ds_id_arr = maybe_unserialize($_dropship_location);
+            if(isset($ds_id_arr) && !empty($ds_id_arr) && !is_string($ds_id_arr)) {
+                foreach ($ds_id_arr as $key => $ds_id) {
+                    $locations[] = $this->en_get_address($ds_id);
+                }
+            }else{
+                $locations[] = $this->en_get_address($_dropship_location);
+            }
+            $index = '';
+            foreach ($locations as $key => $location) {
+                $index_value = (isset($location['zip'])) ? $location['zip'] : '';
+                $index .= strlen($index) > 0 ? ',' . $index_value : $index_value;
+            }
+            return $index;
+        }
+
+        /**
+         * Method to create the data to be exported for one item in the column.
+         *
+         * @param mixed $value (default: '')
+         *
+         * @param WC_Product $product
+         *
+         * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
+         */
+        public function en_country($value, $product)
+        {
+            $locations = [];
+            $_dropship_location = get_post_meta($product->get_id(), '_dropship_location', true);
+            $ds_id_arr = maybe_unserialize($_dropship_location);
+            if(isset($ds_id_arr) && !empty($ds_id_arr) && !is_string($ds_id_arr)) {
+                foreach ($ds_id_arr as $key => $ds_id) {
+                    $locations[] = $this->en_get_address($ds_id);
+                }
+            }else{
+                $locations[] = $this->en_get_address($_dropship_location);
+            }
+            $index = '';
+            foreach ($locations as $key => $location) {
+                $index_value = (isset($location['country'])) ? $location['country'] : '';
+                $index .= strlen($index) > 0 ? ',' . $index_value : $index_value;
+            }
+            return $index;
+        }
+
+        /**
+         * Multiple Drop ship address
+         * @param string $ds_id
+         * @return string
+         * @global type $wpdb
+         */
+        public function en_get_address($ds_id)
+        {
+            global $wpdb;
+            $location = [];
+
+            if (!empty($ds_id) && strlen($ds_id) > 0) {
+                $dropship_data = $wpdb->get_results(
+                    $wpdb->prepare(
+                        "SELECT nickname, city, state, zip, country 
+                        FROM " . $wpdb->prefix . "warehouse WHERE id=%d",
+                        $ds_id
+                    )
+                );
+                if (isset($dropship_data) && !empty($dropship_data) && !is_string($dropship_data)) {
+                    $dropship = reset($dropship_data);
+                    $location ['nickname'] = $dropship->nickname;
+                    $location ['city'] = $dropship->city;
+                    $location ['state'] = $dropship->state;
+                    $location ['zip'] = $dropship->zip;
+                    $location ['country'] = $dropship->country;
+                }
+            }
+            return $location;
+        }
+    }
+
+    new EnCsvExport();
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/template/guide.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/template/guide.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/template/guide.php	(revision 3237693)
@@ -0,0 +1,25 @@
+<?php
+/**
+ * UPS Small WooComerce | Html Div For User Guide Tab
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if ( ! defined( 'ABSPATH' ) ) {
+    exit; 
+}
+
+/**
+ * Html Div For User Guide Tab
+ */
+?>
+<div class="user_guide ups_small_wrapper">
+    <p>
+        The User Guide for this application is maintained on the publisher's website. To view it click 
+        <a href="https://eniture.com/woocommerce-ups-small-package-plugin/#documentation" target="_blank">
+            here
+        </a> 
+        or paste the following link into your browser.
+    </p>
+    https://eniture.com/woocommerce-ups-small-package-plugin/#documentation
+ 
Index: /small-package-quotes-ups-edition/tags/4.5.17/template/products-nested-options.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/template/products-nested-options.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/template/products-nested-options.php	(revision 3237693)
@@ -0,0 +1,224 @@
+<?php
+
+/**
+ *  Box sizes template
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+if (!class_exists("EnUpdateProductNestedOptions")) {
+
+    class EnUpdateProductNestedOptions
+    {
+
+        /**
+         * Constructor.
+         */
+        public function __construct($action)
+        {
+
+            if ($action == 'hooks') {
+                $this->en_add_nested_simple_product_hooks();
+                $this->en_add_variable_nested_product_hooks();
+            }
+        }
+
+        /**
+         * Add simple product fields.
+         */
+        public function en_add_nested_simple_product_hooks()
+        {
+
+            /* Add simple product fields */
+            add_action(
+                'woocommerce_product_options_shipping', array($this, 'en_show_nested_product_fields'), 110
+            );
+            add_action(
+                'woocommerce_process_product_meta', array($this, 'en_save_nested_product_fields'), 20
+            );
+        }
+
+        /**
+         * Add variable product fields.
+         */
+        public function en_add_variable_nested_product_hooks()
+        {
+
+            add_action(
+                'woocommerce_product_after_variable_attributes', array($this, 'en_show_nested_product_fields'), 110, 3
+            );
+
+            add_action(
+                'woocommerce_save_product_variation', array($this, 'en_save_nested_product_fields'), 20
+            );
+        }
+
+        /**
+         * Save the simple product fields.
+         * @param int $post_id
+         */
+        function en_save_nested_product_fields($post_id)
+        {
+
+            if (isset($post_id) && $post_id > 0) {
+
+//               add / update Nested Material
+                $nestedMaterial = isset($_POST['_nestedMaterials' . $post_id]) ? sanitize_text_field(wp_unslash($_POST['_nestedMaterials' . $post_id])) : '';
+                update_post_meta($post_id, '_nestedMaterials', esc_attr($nestedMaterial));
+
+//              add / update Nested Percentage
+                $nestedPercentage = isset($_POST['_nestedPercentage' . $post_id]) && !empty($_POST['_nestedPercentage' . $post_id]) ? sanitize_text_field(wp_unslash($_POST['_nestedPercentage' . $post_id])) : 0;
+
+                update_post_meta($post_id, '_nestedPercentage', esc_attr($nestedPercentage));
+
+//              add / update Nested Dimension
+                $nestedDimension = isset($_POST['_nestedDimension' . $post_id]) ? sanitize_text_field(wp_unslash($_POST['_nestedDimension' . $post_id])) : '';
+                update_post_meta($post_id, '_nestedDimension', esc_attr($nestedDimension));
+
+//              add / update Max. Nested Items
+                $maxNestedItems = isset($_POST['_maxNestedItems' . $post_id]) ? sanitize_text_field(wp_unslash($_POST['_maxNestedItems' . $post_id])) : '';
+                update_post_meta($post_id, '_maxNestedItems', esc_attr($maxNestedItems));
+//              add / update Max. Nested Items
+                $nestedStakingProperty = isset($_POST['_nestedStakingProperty' . $post_id]) ? sanitize_text_field(wp_unslash($_POST['_nestedStakingProperty' . $post_id])) : '';
+                update_post_meta($post_id, '_nestedStakingProperty', esc_attr($nestedStakingProperty));
+            }
+        }
+
+        /**
+         * Show product fields in variation and simple product.
+         * @param array $loop
+         * @param object $variation_data
+         * @param object $variation
+         */
+        function en_show_nested_product_fields($loop, $variation_data = array(), $variation = array())
+        {
+
+            if (!empty($variation) || isset($variation->ID)) {
+                /* Variable products */
+                $this->en_product_custom_nested_fields($variation->ID);
+            } else {
+                /* Simple products */
+                $post_id = get_the_ID();
+                $this->en_product_custom_nested_fields($post_id);
+            }
+        }
+
+        /**
+         *
+         * @param $loop
+         * @param $variation_data
+         * @param $variation
+         * @global $wpdb
+         */
+        function en_product_custom_nested_fields($post_id)
+        {
+
+            $description = "";
+            $disable_nested = "";
+
+            $plan_status = apply_filters('en_app_common_plan_status', []);
+
+            // Nesting plan status
+            if (isset($plan_status['nesting'])) {
+                if (!in_array(0, $plan_status['nesting']['plan_required'])) {
+                    $disable_nested = 'disabled_me';
+                    $description = apply_filters("eniture_ups_small_plans_notification_link", [3]);
+                } elseif (isset($plan_status['nesting']['status'])) {
+                    $description = implode(" <br>", $plan_status['nesting']['status']);
+                }
+            }
+
+            $nestedDimensionSelected = get_post_meta($post_id, '_nestedDimension', true);
+            $nestedStakingPropertySelected = get_post_meta($post_id, '_nestedStakingProperty', true);
+
+//          Nested Material checkbox
+            $field_array = array(
+                'name' => '_nestedMaterials' . $post_id,
+                'id' => '_nestedMaterials' . $post_id,
+                'class' => "_nestedMaterials $disable_nested",
+                'label' => __(
+                    'Nested material', 'small-package-quotes-ups-edition'
+                ),
+                'value' => get_post_meta(
+                    $post_id, '_nestedMaterials', true
+                ),
+                'description' => $description
+            );
+            woocommerce_wp_checkbox($field_array);
+
+//          Nesting percentage input
+            $field_array = array(
+                'name' => '_nestedPercentage' . $post_id,
+                'id' => '_nestedPercentage[' . $post_id . ']',
+                'class' => "_nestedPercentage $disable_nested",
+                'placeholder' => 'Range from 0 to 100',
+                'label' => __(
+                    'Nesting(%)', 'small-package-quotes-ups-edition'
+                ),
+                'desc_tip' => true,
+                'description' => __("How much of the item can be nested into another. Default 0, Range from 0 to 100.", "small-package-quotes-ups-edition"),
+                'value' => get_post_meta(
+                    $post_id, '_nestedPercentage', true
+                ),
+            );
+            woocommerce_wp_text_input($field_array);
+
+//          Nested Dimension dropdown
+            $field_array = array(
+                'name' => '_nestedDimension' . $post_id,
+                'id' => '_nestedDimension',
+                'class' => "_nestedDimension $disable_nested",
+                'label' => __(
+                    'Nested dimension', 'small-package-quotes-ups-edition'
+                ),
+                'desc_tip' => true,
+                'value' => $nestedDimensionSelected,
+                'description' => __("This setting identifies which dimension will be used for the nesting property.", "small-package-quotes-ups-edition"),
+                'options' => array(
+                    'length' => 'Length',
+                    'width' => 'Width',
+                    'height' => 'Height',
+                ),
+            );
+            woocommerce_wp_select($field_array);
+
+//          Maximum nested items input field
+            $field_array = array(
+                'name' => '_maxNestedItems' . $post_id,
+                'id' => '_maxNestedItems[' . $post_id . ']',
+                'class' => "_maxNestedItems $disable_nested",
+                'label' => __(
+                    'Maximum nested items', 'small-package-quotes-ups-edition'
+                ),
+                'desc_tip' => true,
+                'description' => __('It represents the maximum number of items that can be nested into one another.', 'small-package-quotes-ups-edition'),
+                'value' => get_post_meta(
+                    $post_id, '_maxNestedItems', true
+                ),
+            );
+            woocommerce_wp_text_input($field_array);
+
+//          Stacking property dropdown
+            $field_array = array(
+                'name' => '_nestedStakingProperty' . $post_id,
+                'id' => '_nestedStakingProperty',
+                'class' => "_nestedStakingProperty $disable_nested",
+                'label' => __(
+                    'Stacking property', 'small-package-quotes-ups-edition'
+                ),
+                'desc_tip' => true,
+                'value' => $nestedStakingPropertySelected,
+                'description' => __('This setting identifies how the nested stacks should be handled if the total number of items exceeds the maximum.', 'small-package-quotes-ups-edition'),
+                'options' => array(
+                    'Evenly' => 'Evenly',
+                    'Maximized' => 'Maximized',
+                ),
+            );
+            woocommerce_wp_select($field_array);
+        }
+
+    }
+
+    /* Initialize object */
+    new EnUpdateProductNestedOptions('hooks');
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/template/quote-settings.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/template/quote-settings.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/template/quote-settings.php	(revision 3237693)
@@ -0,0 +1,1091 @@
+<?php
+
+/**
+ * UPS Small WooComerce | Class For Quote Settings Tab
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * UPS Small WooComerce | Class For Quote Settings Tab
+ */
+class Eniture_UPS_Small_Quote_Settings
+{
+
+    /**
+     * Quote Setting Fields
+     * @return Quote Setting Fields Array
+     */
+    function ups_small_quote_settings_tab()
+    {
+        $disable_transit = "";
+        $disable_contract_service = "";
+        $transit_package_required = "";
+
+        $disable_hazardous = "";
+        $hazardous_package_required = "";
+        $contract_required_required = "";
+
+        $action_transit = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'transit_days');
+        if (is_array($action_transit)) {
+            $disable_transit = "disabled_me";
+            $transit_package_required = apply_filters('eniture_ups_small_plans_notification_link', $action_transit);
+        }
+
+        $action_hazardous = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'hazardous_material');
+        if (is_array($action_hazardous)) {
+            $disable_hazardous = "disabled_me";
+            $hazardous_package_required = apply_filters('eniture_ups_small_plans_notification_link', $action_hazardous);
+        }
+
+        $action_contract = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'contract_services');
+        if (is_array($action_contract)) {
+            $disable_contract_service = "disabled_me";
+            $contract_required_required = apply_filters('eniture_ups_small_plans_notification_link', $action_contract);
+        }
+
+        //**Plan_Validation: Cut Off Time & Ship Date Offset
+        $disable_ups_small_cutOffTime_shipDateOffset = "";
+        $ups_small_cutOffTime_shipDateOffset_package_required = "";
+        $action_ups_small_cutOffTime_shipDateOffset = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'ups_small_cutOffTime_shipDateOffset');
+        if (is_array($action_ups_small_cutOffTime_shipDateOffset)) {
+            $disable_ups_small_cutOffTime_shipDateOffset = "disabled_me";
+            $ups_small_cutOffTime_shipDateOffset_package_required = apply_filters('eniture_ups_small_plans_notification_link', $action_ups_small_cutOffTime_shipDateOffset);
+        }
+
+        $package_type_options = [
+            'ship_alone' => __('Quote each item as shipping as its own package', 'small-package-quotes-ups-edition'),
+            'ship_combine_and_alone' => __('Combine the weight of all items without dimensions and quote them as one package while quoting each item with dimensions as shipping as its own package', 'small-package-quotes-ups-edition'),
+            'ship_one_package_70' => __('Quote shipping as if all items ship as one package up to 70 LB each', 'small-package-quotes-ups-edition'),
+            'ship_one_package_150' => __('Quote shipping as if all items ship as one package up to 150 LB each', 'small-package-quotes-ups-edition'),
+        ];
+        $package_type_default = 'ship_alone';
+        $ups_small_packaging_type = get_option("ups_small_packaging_type");
+        if(!empty($ups_small_packaging_type) && $ups_small_packaging_type == 'old'){
+            $package_type_default = 'eniture_packaging';
+            $package_type_options['eniture_packaging'] = __('Use the default Eniture packaging algorithm', 'small-package-quotes-ups-edition');
+        }
+
+        $rate_source = get_option('ups_small_rate_source');
+        if (empty($rate_source) || $rate_source == false) {
+            $rate_source = 'negotiated_rates';
+            update_option('ups_small_rate_source', $rate_source);
+        }
+
+        $hazardous_fee_option = get_option('ups_small_hazardous_fee_options');
+        if (empty($hazardous_fee_option) || !$hazardous_fee_option) {
+            $hazardous_fee_option = 'ship_as_own_package';
+            update_option('ups_small_hazardous_fee_options', $hazardous_fee_option);
+        }
+
+        //**End: Cut Off Time & Ship Date Offset
+
+        echo '<div class="ups_small_quote_section ups_small_wrapper">';
+
+        $settings = array(
+            'ups_small_services' => array(
+                'name' => __('Quote Service Options ', 'small-package-quotes-ups-edition'),
+                'type' => 'title',
+                'desc' => '',
+                'id' => 'ups_small_quote_hdng'
+            ),
+            'ups_small_services1' => array(
+                'name' => '',
+                'type' => 'title',
+                'desc' => '<p>The services selected will display in the cart if they are available for the origin and destination addresses, and if the UPS Small Package Quotes API has been enabled for the corresponding shipping zone.</p>',
+                'id' => 'ups_small_quote_hdng1'
+            ),
+            'ups_small_domastic_srvcs' => array(
+                'name' => __('Domestic Services', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'id' => 'ups_small_dom_srvc_hdng',
+                'class' => 'dom_int_srvc_hdng'
+            ),
+            'ups_small_int_srvcs' => array(
+                'name' => __('International Services', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'id' => 'ups_small_int_srvc_hdng',
+                'class' => 'dom_int_srvc_hdng'
+            ),
+            'ups_small_select_all_services' => array(
+                'name' => __('Select All', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'id' => 'wc_settings_select_all_',
+                'class' => 'ups_small_all_services',
+            ),
+            'ups_small_select_all_int_services' => array(
+                'name' => __('Select All', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'id' => 'wc_settings_select_int_all',
+                'class' => 'ups_small_all_int_services',
+            ),
+            'ups_small_ground' => array(
+                'name' => __('UPS Ground', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Ground',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_standard' => array(
+                'name' => __('UPS Standard', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Standard',
+                'class' => 'ups_small_int_quotes_services ups_international_service',
+            ),
+            'ups_small_ground_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_ground_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_standard_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_standard_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_ground_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_ground_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_standard_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_standard_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_2day_air' => array(
+                'name' => __('UPS 2nd Day Air', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_2nd_Day_Air',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_worldwide_expedited' => array(
+                'name' => __('UPS  Expedited | UPS Worldwide Expedited', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Worldwide_Expedited',
+                'class' => 'ups_small_int_quotes_services ups_international_service',
+            ),
+            'ups_small_2day_air_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_2day_air_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_pkg_Worldwide_Expedited_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_pkg_Worldwide_Expedited_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_2day_air_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_2day_air_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_pkg_Worldwide_Expedited_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_pkg_Worldwide_Expedited_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_2day_air_am' => array(
+                'name' => __('UPS 2nd Day Air A.M', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_2nd_Day_Air_AM',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_worldwide_saver' => array(
+                'name' => __('UPS Express Saver | UPS Worldwide Saver', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Saver',
+                'class' => 'ups_small_int_quotes_services ups_international_service',
+            ),
+            'ups_small_2day_air_am_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_2day_air_am_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_worldwide_saver_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_saver_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_2day_air_am_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_2day_air_am_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_worldwide_saver_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_saver_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_next_day_air_saver' => array(
+                'name' => __('UPS Next Day Air Saver', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Next_Day_Air_Saver',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_worldwide_express' => array(
+                'name' => __('UPS Express | UPS Worldwide Express', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Worldwide_Express',
+                'class' => 'ups_small_int_quotes_services ups_international_service',
+            ),
+            'ups_small_next_day_air_saver_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_saver_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_worldwide_express_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_express_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_next_day_air_saver_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_saver_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_worldwide_express_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_express_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_next_day_air' => array(
+                'name' => __('UPS Next Day Air', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Next_Day_Air',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_worldwide_express_plus' => array(
+                'name' => __('UPS Express Plus | UPS Worldwide Express Plus', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Worldwide_Express_Plus',
+                'class' => 'ups_small_int_quotes_services ups_international_service',
+            ),
+            'ups_small_next_day_air_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_worldwide_express_plus_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_express_plus_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_next_day_air_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_worldwide_express_plus_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_worldwide_express_plus_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_next_day_air_early' => array(
+                'name' => __('UPS Next Day Air Early', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_Next_Day_Air_Early_AM',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_next_day_air_early_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_small_next_day_air_early_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_early_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_next_day_air_early_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_small_next_day_air_early_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_next_day_air_early_markup',
+                'class' => 'ups_small_quotes_markup_left_markup',
+            ),
+            'ups_small_next_day_air_early_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_small_3day_select_duplicated' => array(
+                'name' => __('UPS 3 Day Select', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_small_pkg_3_Day_Select',
+                'class' => 'ups_small_quotes_services',
+            ),
+            'ups_small_3day_select_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_small_3day_select_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_3day_select_label',
+                'class' => 'ups_small_quotes_label_left',
+            ),
+            'ups_small_3day_select_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_small_3day_select_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_small_3day_select_markup',
+                'class' => 'ups_small_quotes_markup_right_markup',
+            ),
+            'ups_small_3day_select_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_contract_services' => array(
+                'name' => __('UPS Contract Services', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => $contract_required_required,
+                'id' => 'ups_contract_services'
+            ),
+            'ups_contract_services_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'to_have_access_to_UPS_contract_services' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => '<p>To have access to UPS contract services, they must be enabled on your account.</p>',
+                'id' => 'to_have_access_to_UPS_contract_services'
+            ),
+            'ups_surepost_less_than_1_lb' => array(
+                'name' => __('UPS SurePost Less than 1LB', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_surepost_less_than_1_lb',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_surepost_less_than_1_lb_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_less_than_1_lb_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_less_than_1_lb_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_surepost_less_than_1_lb_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_contract_services_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_contract_services_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_contract_services_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_1_lb_or_greater' => array(
+                'name' => __('UPS SurePost 1LB or greater ', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_surepost_1_lb_or_greater',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_surepost_1_lb_or_greater_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_1_lb_or_greater_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_1_lb_or_greater_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_surepost_1_lb_or_greater_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_1_lb_or_greater_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_1_lb_or_greater_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_surepost_1_lb_or_greater_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_bound_printed_matter' => array(
+                'name' => __('UPS SurePost Bound Printed Matter ', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_surepost_bound_printed_matter',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_surepost_bound_printed_matter_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_bound_printed_matter_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_bound_printed_matter_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_surepost_bound_printed_matter_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_bound_printed_matter_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_bound_printed_matter_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_surepost_bound_printed_matter_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_media_mail' => array(
+                'name' => __('UPS SurePost Media Mail', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_surepost_media_mail',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_surepost_media_mail_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_media_mail_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_media_mail_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_surepost_media_mail_markup_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_surepost_media_mail_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_surepost_media_mail_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_surepost_media_mail_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_ground_with_freight_pricing' => array(
+                'name' => __('UPS Ground with Freight Pricing', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_ground_with_freight_pricing',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_ground_with_freight_pricing_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_ground_with_freight_pricing_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_ground_with_freight_pricing_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_ground_with_freight_pricing_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_ground_with_freight_pricing_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_ground_with_freight_pricing_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_ground_with_freight_pricing_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+
+            // USP simple rate start
+            'ups_simple_rate_through_ground' => array(
+                'name' => __('UPS Simple Rate - Ground', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_simple_rate_through_ground',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_ground_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_ground_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_ground_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_ground_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_ground_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_ground_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_ground_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+             'ups_simple_rate_through_3_day_select' => array(
+                'name' => __('UPS Simple Rate - 3-day Select', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_simple_rate_through_3_day_select',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_3_day_select_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_3_day_select_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_3_day_select_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_3_day_select_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_3_day_select_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_3_day_select_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_3_day_select_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_2nd_day_air' => array(
+                'name' => __('UPS Simple Rate - 2-day Air', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_simple_rate_through_2nd_day_air',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_2nd_day_air_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_2nd_day_air_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_2nd_day_air_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_2nd_day_air_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_2nd_day_air_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_2nd_day_air_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_2nd_day_air_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_next_day_air_saver' => array(
+                'name' => __('UPS Simple Rate - Next Day Air Saver', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => '',
+                'id' => 'ups_simple_rate_through_next_day_air_saver',
+                'class' => 'ups_small_quotes_services ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_next_day_air_saver_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_next_day_air_saver_label' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Label',
+                'desc' => __('Leave blank to display service name.', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_next_day_air_saver_label',
+                'class' => 'ups_small_quotes_label_left ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_next_day_air_saver_label_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+            'ups_simple_rate_through_next_day_air_saver_markup' => array(
+                'name' => '',
+                'type' => 'text',
+                'placeholder' => 'Markup',
+                'desc' => __('Markup (e.g. Currency: 1.00 or Percentage: 5.0%)', 'small-package-quotes-ups-edition'),
+                'id' => 'ups_simple_rate_through_next_day_air_saver_markup',
+                'class' => 'ups_small_quotes_markup_left_markup ' . $disable_contract_service,
+            ),
+            'ups_simple_rate_through_next_day_air_saver_markup_after' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden ups_small_services_hide_me',
+            ),
+          
+            // USP simple rate end
+
+            'price_sort_ups_small' => array(
+                'name' => __("Don't sort shipping methods by price  ", 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => 'By default, the plugin will sort all shipping methods by price in ascending order.',
+                'id' => 'shipping_methods_do_not_sort_by_price'
+            ),
+
+            // Package rating method when Standard Box Sizes isn't in use
+            'ups_small_packaging_method_label' => array(
+                'name' => __('Package rating method when Standard Box Sizes isn\'t in use', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'id' => 'ups_small_packaging_method_label'
+            ),
+            'ups_small_packaging_method' => array(
+                'name' => '',
+                'type' => 'radio',
+                'default' => $package_type_default,
+                'options' => $package_type_options,
+                'id' => 'ups_small_packaging_method',
+            ),
+
+//          show delivery estimates options
+            'service_ups_small_estimates_title' => array(
+                'name' => __('Delivery Estimate Options ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => '',
+                'id' => 'service_ups_small_estimates_title'
+            ),
+            'dont_show_estimates_ups_small' => array(
+                'name' => '',
+                'type' => 'radio',
+                'class' => "",
+                'default' => "dont_show_estimates",
+                'options' => array(
+                    'dont_show_estimates' => __("Don't display delivery estimates.", 'small-package-quotes-ups-edition'),
+                    'delivery_days' => __('Display estimated number of days until delivery.', 'small-package-quotes-ups-edition'),
+                    'delivery_date' => __('Display estimated delivery date.', 'small-package-quotes-ups-edition'),
+                ),
+                'id' => 'ups_small_delivery_estimates',
+            ),
+            'estimated_delivery_days_format' => array(
+                'name' => '',
+                'type' => 'text',
+                'id' => 'estimated_delivery_days_format',
+                'desc' => 'It will be used in place of the default label which is "Intransit days" e.g. Delivery days',
+            ),
+            'estimated_delivery_date_format' => array(
+                'name' => '',
+                'type' => 'text',
+                'id' => 'estimated_delivery_date_format',
+                'desc' => 'The date format should be valid and place it between the % symbols. The string before the % symbol will be used in place of the default label which is "Estimated delivery date". e.g. ETA %m-d-y% will display "ETA 04-02-24" and ETA %M D Y% will display "Apr Tue 2024". The default format for the estimated delivery date is "Expected delivery by dd-mm-yyyy".',
+            ),
+            //**Start: Cut Off Time & Ship Date Offset
+            'ups_small_cutOffTime_shipDateOffset_ups_small' => array(
+                'name' => __('Cut Off Time & Ship Date Offset ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => $ups_small_cutOffTime_shipDateOffset_package_required,
+                'id' => 'ups_small_cutOffTime_shipDateOffset'
+            ),
+            'orderCutoffTime_ups_small' => array(
+                'name' => __('Order Cut Off Time ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'placeholder' => '--:-- --',
+                'desc' => 'Enter the cut off time (e.g. 2.00) for the orders. Orders placed after this time will be quoted as shipping the next business day.',
+                'id' => 'ups_small_orderCutoffTime',
+                'class' => $disable_ups_small_cutOffTime_shipDateOffset,
+            ),
+            'shipmentOffsetDays_ups_small' => array(
+                'name' => __('Fulfilment Offset Days ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => 'The number of days the ship date needs to be moved to allow the processing of the order.',
+                'placeholder' => 'Fulfilment Offset Days, e.g. 2',
+                'id' => 'ups_small_shipmentOffsetDays',
+                'class' => $disable_ups_small_cutOffTime_shipDateOffset,
+            ),
+            'all_shipment_days_ups_small' => array(
+                'name' => __("What days do you ship orders?", 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => 'Select All',
+                'class' => "all_shipment_days_ups_small $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'all_shipment_days_ups_small'
+            ),
+            'monday_shipment_day_ups_small' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Monday',
+                'class' => "ups_small_shipment_day $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'monday_shipment_day_ups_small'
+            ),
+            'tuesday_shipment_day_ups_small' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Tuesday',
+                'class' => "ups_small_shipment_day $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'tuesday_shipment_day_ups_small'
+            ),
+            'wednesday_shipment_day_ups_small' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Wednesday',
+                'class' => "ups_small_shipment_day $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'wednesday_shipment_day_ups_small'
+            ),
+            'thursday_shipment_day_ups_small' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Thursday',
+                'class' => "ups_small_shipment_day $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'thursday_shipment_day_ups_small'
+            ),
+            'friday_shipment_day_ups_small' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Friday',
+                'class' => "ups_small_shipment_day $disable_ups_small_cutOffTime_shipDateOffset",
+                'id' => 'friday_shipment_day_ups_small'
+            ),
+            // Start Transit days            
+            'ups_ground_transit_label' => array(
+                'name' => __('Ground transit time restriction', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => $transit_package_required,
+                'id' => 'ups_ground_transit_label'
+            ),
+            'restrict_days_transit_package_ups_small' => array(
+                'name' => __('Enter the number of transit days to restrict ground service to. Leave blank to disable this feature.', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => $disable_transit,
+                'id' => 'restrict_days_transit_package_ups_small'
+            ),
+            'restrict_radio_btn_transit_ups_small' => array(
+                'name' => '',
+                'type' => 'radio',
+                'class' => $disable_transit,
+                'options' => array(
+                    'TransitTimeInDays' => __('Restrict by the carrier\'s in transit days metric.', 'small-package-quotes-ups-edition'),
+                    'CalenderDaysInTransit' => __('Restrict by the calendar days in transit.', 'small-package-quotes-ups-edition'),
+                ),
+                'id' => 'restrict_calendar_transit_small_packages_ups',
+            ),
+            /*
+             * UPS Residentail Delivery, Handeling Fee And Hazardous Fee
+             */
+            'ups_small_3day_select' => array(
+                'name' => '',
+                'type' => 'title',
+                'class' => 'hidden',
+            ),
+            'residential_delivery_options_label' => array(
+                'name' => __('Residential Delivery', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'id' => 'residential_delivery_options_label'
+            ),
+            'ups_small_residential_delivery' => array(
+                'name' => __('Always quote as residential delivery', 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'id' => 'ups_small_quote_as_residential_delivery'
+            ),
+//              Auto-detect residential addresses notification
+            'avaibility_auto_residential' => array(
+                'name' => '',
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => "Click <a target='_blank' href='https://eniture.com/woocommerce-residential-address-detection/'>here</a> to add the Auto-detect residential addresses module. (<a target='_blank' href='https://eniture.com/woocommerce-residential-address-detection/#documentation'>Learn more</a>)",
+                'id' => 'avaibility_auto_residential'
+            ),
+//              Use my standard box sizes notification
+            'avaibility_box_sizing' => array(
+                'name' => __('Use my standard box sizes', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => "Click <a target='_blank' href='https://eniture.com/woocommerce-standard-box-sizes/'>here</a> to add the Standard Box Sizes module. (<a target='_blank' href='https://eniture.com/woocommerce-standard-box-sizes/#documentation'>Learn more</a>)",
+                'id' => 'avaibility_box_sizing'
+            ),
+            // End Transit days 
+            // start hazardous section
+            'ups_hazardous_material_settings' => array(
+                'name' => __('Hazardous material settings', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'class' => 'hidden',
+                'desc' => $hazardous_package_required,
+                'id' => 'ups_hazardous_material_settings'
+            ),
+            'ups_small_hazardous_materials_shipments' => array(
+                'name' => '',
+                'type' => 'checkbox',
+                'desc' => 'Only quote ground service for hazardous materials shipments',
+                'class' => $disable_hazardous,
+                'id' => 'ups_small_hazardous_materials_shipments'
+            ),
+            'ups_small_ground_hz_fee' => array(
+                'name' => __('Ground Hazardous Material Fee ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => '<span class="desc_text_style">Enter an amount, e.g 20. or Leave blank to disable.</span>',
+                'class' => $disable_hazardous,
+                'id' => 'ups_small_ground_hazardous_fee'
+            ),
+            'ups_small_air_hz_fee' => array(
+                'name' => __('Air Hazardous Material Fee ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => '<span class="desc_text_style">Enter an amount, e.g 20. or Leave blank to disable.</span>',
+                'class' => $disable_hazardous,
+                'id' => 'ups_small_air_hazardous_fee'
+            ),
+            // Package level hazardous fee options
+            'ups_small_hazardous_fee_options' => array(
+                'name' => '',
+                'type' => 'radio',
+                'default' => $hazardous_fee_option,
+                'options' => array(
+                    'ship_as_own_package' => __('Quote each item marked as hazmat as shipping as its own package.', 'small-package-quotes-ups-edition'),
+                    'combine_quantities' => __('Combine quantities of the same item marked as hazmat into a single package before applying the hazmat fee.', 'small-package-quotes-ups-edition'),
+                ),
+                'id' => 'ups_small_hazardous_fee_options'
+            ),
+            // end hazardous section
+            'ups_small_hand_free' => array(
+                'name' => __('Handling Fee / Markup ', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => '<span class="desc_text_style">Amount excluding tax. Enter an amount, e.g 3.75, or a percentage, e.g, 5%. Leave blank to disable.</span>',
+                'id' => 'ups_small_hand_fee_mark_up'
+            ),
+            'ups_small_enable_logs' => array(
+                'name' => __("Enable Logs  ", 'small-package-quotes-ups-edition'),
+                'type' => 'checkbox',
+                'desc' => 'When checked, the Logs page will contain up to 25 of the most recent transactions.',
+                'id' => 'ups_small_enable_logs'
+            ),
+            // rate source section
+            'ups_small_rate_source' => array(
+                'name' => __('Rate source ', 'small-package-quotes-ups-edition'),
+                'type' => 'radio',
+                'default' => $rate_source,
+                'options' => array(
+                    'negotiated_rates' =>  __('Use my negotiated rates.', 'small-package-quotes-ups-edition'),
+                    'list_rates' =>  __('Use retail (list) rates.', 'small-package-quotes-ups-edition'),
+                ),
+                'id' => 'ups_small_rate_source'
+            ),
+            //Ignore items with the following Shipping Class(es) By (K)
+            'en_ignore_items_through_freight_classification' => array(
+                'name' => __('Ignore items with the following Shipping Class(es)', 'small-package-quotes-ups-edition'),
+                'type' => 'text',
+                'desc' => "Enter the <a target='_blank' href = '" . get_admin_url() . "admin.php?page=wc-settings&tab=shipping&section=classes'>Shipping Slug</a> you'd like the plugin to ignore. Use commas to separate multiple Shipping Slug.",
+                'id' => 'en_ignore_items_through_freight_classification'
+            ),
+            'allow_other_plugins_ups_small' => array(
+                'name' => __('Allow other plugins to show quotes ', 'small-package-quotes-ups-edition'),
+                'type' => 'select',
+                'default' => '3',
+                'desc' => '',
+                'id' => 'wc_settings_wwe_allow_other_plugins',
+                'options' => array(
+                    'no' => __('NO', 'small-package-quotes-ups-edition'),
+                    'yes' => __('YES', 'small-package-quotes-ups-edition')
+                )
+            ),
+            'unable_retrieve_shipping_clear_ups_small' => array(
+                'title' => '',
+                'name' => '',
+                'desc' => '',
+                'id' => 'wc_unable_retrieve_shipping_clear_ups_small',
+                'css' => '',
+                'default' => '',
+                'type' => 'title',
+            ),
+            'unable_retrieve_shipping_ups_small' => array(
+                'name' => __('Checkout options if the plugin fails to return a rate ', 'small-package-quotes-ups-edition'),
+                'type' => 'title',
+                'desc' => 'When the plugin is unable to retrieve shipping quotes and no other shipping options are provided by an alternative source:',
+                'id' => 'wc_settings_unable_retrieve_shipping_ups_small'
+            ),
+            'pervent_checkout_proceed_ups_small' => array(
+                'name' => '',
+                'type' => 'radio',
+                'id' => 'pervent_checkout_proceed_wwe_small_packages',
+                'options' => array(
+                    'allow' => '',
+                    'prevent' => '',
+                ),
+                'id' => 'wc_pervent_proceed_checkout_eniture',
+            ),
+            'section_end_quote' => array(
+                'type' => 'sectionend',
+                'id' => 'wc_settings_quote_section_end'
+            )
+        );
+        return $settings;
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/update-plan.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/update-plan.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/update-plan.php	(revision 3237693)
@@ -0,0 +1,269 @@
+<?php
+
+/**
+ * FedEx Small Update Plan
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+add_action('wp_ajax_eniture_ups_small_activate_hit_to_update_plan', 'eniture_ups_small_activate_hit_to_update_plan');
+add_action('wp_ajax_nopriv_eniture_ups_small_activate_hit_to_update_plan', 'eniture_ups_small_activate_hit_to_update_plan');
+
+/**
+ * Activate FedEx SMALL
+ */
+function eniture_ups_small_activate_hit_to_update_plan($network_wide = null)
+{
+    if (!current_user_can('manage_options')) {
+        echo json_encode([]);
+        return;
+    }
+
+    if ( is_multisite() && $network_wide ) {
+
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            $domain = eniture_ups_small_get_domain();
+
+            $index = 'small-package-quotes-ups-edition/small-package-quotes-ups-edition.php';
+            $plugin_info = get_plugins();
+            $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
+            $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
+            $post_data = array(
+                'platform' => 'wordpress',
+                'carrier' => '32',
+                'store_url' => $domain,
+                'webhook_url' => $plugin_dir_url,
+                'plugin_version' => $plugin_version,
+            );
+
+            $license_key = get_option('ups_small_licence_key');
+            strlen($license_key) > 0 ? $post_data['license_key'] = $license_key : '';
+
+            $url = ENITURE_UPS_DOMAIN_HITTING_URL . "/web-hooks/subscription-plans/create-plugin-webhook.php?";
+            $response = wp_remote_get($url, array(
+                    'method' => 'GET',
+                    'timeout' => 60,
+                    'redirection' => 5,
+                    'blocking' => true,
+                    'body' => $post_data,
+                )
+            );
+
+            $output = wp_remote_retrieve_body($response);
+            $response = json_decode($output, TRUE);
+
+            $plan = (isset($response["pakg_group"])) ? $response["pakg_group"] : '';
+            $expire_day = (isset($response["pakg_duration"])) ? $response["pakg_duration"] : '';
+            $expiry_date = (isset($response["expiry_date"])) ? $response["expiry_date"] : '';
+            $plan_type = (isset($response["plan_type"])) ? $response["plan_type"] : '';
+            $packaging_type = isset($response['packaging_type']) ? $response['packaging_type'] : '';
+
+            if ($response["pakg_price"] == "0") {
+                $plan = "0";
+            }
+
+            update_option("ups_small_package", "$plan");
+            update_option("ups_small_package_expire_days", "$expire_day");
+            update_option("ups_small_package_expire_date", "$expiry_date");
+            update_option("ups_small_quotes_store_type", "$plan_type");
+            update_option('ups_small_packaging_type', $packaging_type);
+
+            eniture_check_ups_small_plan_on_product_detail();
+            restore_current_blog();
+        }
+
+    } else {
+        $domain = eniture_ups_small_get_domain();
+
+        $index = 'small-package-quotes-ups-edition/small-package-quotes-ups-edition.php';
+        $plugin_info = get_plugins();
+        $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
+        $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
+        $post_data = array(
+            'platform' => 'wordpress',
+            'carrier' => '32',
+            'store_url' => $domain,
+            'webhook_url' => $plugin_dir_url,
+            'plugin_version' => $plugin_version,
+        );
+
+        $license_key = get_option('ups_small_licence_key');
+        strlen($license_key) > 0 ? $post_data['license_key'] = $license_key : '';
+
+        $url = ENITURE_UPS_DOMAIN_HITTING_URL . "/web-hooks/subscription-plans/create-plugin-webhook.php?";
+        $response = wp_remote_get($url, array(
+                'method' => 'GET',
+                'timeout' => 60,
+                'redirection' => 5,
+                'blocking' => true,
+                'body' => $post_data,
+            )
+        );
+
+        $output = wp_remote_retrieve_body($response);
+        $response = json_decode($output, TRUE);
+
+        $plan = (isset($response["pakg_group"])) ? $response["pakg_group"] : '';
+        $expire_day = (isset($response["pakg_duration"])) ? $response["pakg_duration"] : '';
+        $expiry_date = (isset($response["expiry_date"])) ? $response["expiry_date"] : '';
+        $plan_type = (isset($response["plan_type"])) ? $response["plan_type"] : '';
+        $packaging_type = isset($response['packaging_type']) ? $response['packaging_type'] : '';
+
+        if ($response["pakg_price"] == "0") {
+            $plan = "0";
+        }
+
+        update_option("ups_small_package", "$plan");
+        update_option("ups_small_package_expire_days", "$expire_day");
+        update_option("ups_small_package_expire_date", "$expiry_date");
+        update_option("ups_small_quotes_store_type", "$plan_type");
+        update_option('ups_small_packaging_type', $packaging_type);
+
+        eniture_check_ups_small_plan_on_product_detail();
+    }
+
+}
+
+function eniture_check_ups_small_plan_on_product_detail()
+{
+
+    $hazardous_feature_PD = 1;
+    $insurance_feature_PD = 0;
+    $nested_material_PD = 0;
+    $dropship_feature_PD = 1;
+
+    //  Nested material
+    $nested_mateials = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'nested_material');
+    if (!is_array($nested_mateials)) {
+        $nested_material_PD = 1;
+    }
+
+    //  Hazardous Material
+    if (get_option('ups_small_quotes_store_type') == "1") {
+        $hazardous_material = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'hazardous_material');
+        if (!is_array($hazardous_material)) {
+            $hazardous_feature_PD = 1;
+        } else {
+            $hazardous_feature_PD = 0;
+        }
+    }
+
+    //  Insurance Fee
+    $action_insurance = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'insurance_fee');
+    if (!is_array($action_insurance)) {
+        $insurance_feature_PD = 1;
+    }
+
+    //  Dropship
+    if (get_option('ups_small_quotes_store_type') == "1") {
+        $action_dropship = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'multi_dropship');
+        if (!is_array($action_dropship)) {
+            $dropship_feature_PD = 1;
+        } else {
+            $dropship_feature_PD = 0;
+        }
+    }
+    if (get_option('en_old_user_hazmat_status') == "1" && get_option('ups_small_quotes_store_type') == "0") {
+        $hazardous_feature_PD = 0;
+    }
+    update_option('eniture_plugin_5', array('ups_small_package' => array('plugin_name' => 'Small Package Quotes - UPS Edition', 'multi_dropship' => $dropship_feature_PD, 'insurance_fee' => $insurance_feature_PD, 'hazardous_material' => $hazardous_feature_PD, 'nested_material' => $nested_material_PD)));
+}
+
+/**
+ * Deactivate FedEx SMALL
+ */
+function eniture_ups_small_deactivate_hit_to_update_plan($network_wide = null)
+{
+    if ( is_multisite() && $network_wide ) {
+
+        foreach (get_sites(['fields'=>'ids']) as $blog_id) {
+            switch_to_blog($blog_id);
+            delete_option('eniture_plugin_5');
+            delete_option('ups_small_package');
+            delete_option('ups_small_package_expire_days');
+            delete_option('ups_small_package_expire_date');
+            delete_option('ups_small_quotes_store_type');
+            restore_current_blog();
+        }
+
+    } else {
+        delete_option('eniture_plugin_5');
+        delete_option('ups_small_package');
+        delete_option('ups_small_package_expire_days');
+        delete_option('ups_small_package_expire_date');
+        delete_option('ups_small_quotes_store_type');
+    }
+}
+
+/**
+ * Get FedEx Small Plan
+ * @return string
+ */
+function eniture_ups_small_plan_name()
+{
+    $plan = get_option('ups_small_package');
+    $expire_days = get_option('ups_small_package_expire_days');
+    $expiry_date = get_option('ups_small_package_expire_date');
+    $plan_name = "";
+
+    switch ($plan) {
+        case 3:
+            $plan_name = "Advanced Plan";
+            break;
+        case 2:
+            $plan_name = "Standard Plan";
+            break;
+        case 1:
+            $plan_name = "Basic Plan";
+            break;
+        case 0:
+            $plan_name = "Trial Plan";
+            break;
+    }
+    $package_array = array(
+        'plan_number' => $plan,
+        'plan_name' => $plan_name,
+        'expire_days' => $expire_days,
+        'expiry_date' => $expiry_date
+    );
+    return $package_array;
+}
+
+/**
+ * Show FedEx Small Plan Notice
+ * @return string
+ */
+function eniture_ups_small_plan_notice()
+{
+
+    if (isset($_GET['tab']) && ($_GET['tab'] == "ups_small")) {
+        $store_type = get_option('ups_small_quotes_store_type');
+        $plan_number = get_option("ups_small_package");
+
+        $plan_package = eniture_ups_small_plan_name();
+        if ($store_type == "1" || $store_type == "0" && ($plan_number == "0" || $plan_number == "1" || $plan_number == "2" || $plan_number == "3")) {
+
+            if (isset($plan_package) && !empty($plan_package)) {
+
+                if (isset($plan_package['plan_number']) && $plan_package['plan_number'] == '0') {
+                    echo '<div class="notice notice-success is-dismissible ups_small_plan_notice">
+                    <p> You are currently on the ' . esc_attr( $plan_package['plan_name'] ) . '. Your plan will be expire on ' .  esc_attr( $plan_package['expiry_date'] ) . ' <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan.</p>
+                    </div>';
+                } else if (isset($plan_package['plan_number']) && ($plan_package['plan_number'] == '1' || $plan_package['plan_number'] == '2' || $plan_package['plan_number'] == '3')) {
+
+                    echo '<div class="notice notice-success is-dismissible ups_small_plan_notice">
+                    <p> You are currently on the ' . esc_attr( $plan_package['plan_name'] ) . '. The plan renews on ' . esc_attr( $plan_package['expiry_date'] ) . ' <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan.</p>
+                    </div>';
+                } else {
+                    echo '<div class="notice notice-warning is-dismissible ups_small_plan_notice">
+                    <p>Your currently plan subscription is inactive. <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan to check the subscription status. If the subscription status remains inactive, log into eniture.com and update your license.</p>
+                    </div>';
+                }
+            }
+        }
+    }
+}
+
+add_action('admin_notices', 'eniture_ups_small_plan_notice');
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-admin-filter.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-admin-filter.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-admin-filter.php	(revision 3237693)
@@ -0,0 +1,248 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Admin Settings 
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Introduce UPS Small method
+ * @param $methods
+ * @return string
+ */
+function eniture_add_ups_small($methods) {
+    $methods['ups_small'] = 'WC_ups_small';
+    return $methods;
+}
+
+/**
+ * UPS Small method settings
+ * @param $settings
+ * @return array
+ */
+function eniture_ups_small_shipping_sections($settings) {
+    include( 'ups-small-tab-class.php' );
+    return $settings;
+}
+
+/**
+ * UPS Small Hide Other Shipping Methods 
+ * @param $available_methods
+ * @return avalaible methods
+ */
+function eniture_ups_small_hide_shipping($available_methods) {
+    if (get_option('wc_settings_wwe_allow_other_plugins') == 'no'
+        && count($available_methods) > 0) {
+        $plugins_array = array();
+        $eniture_plugins = get_option('EN_Plugins');
+        if ($eniture_plugins) {
+            $plugins_array = json_decode($eniture_plugins, true);
+        }
+
+        // flag to check if rates available of current plugin
+        $rates_available = false;
+        foreach ($available_methods as $value) {
+            if ($value->method_id == 'ups_small') {
+                $rates_available = true;
+                break;
+            }
+        }
+
+        // add methods which not exist in array
+        $plugins_array[] = 'ltl_shipping_method';
+        $plugins_array[] = 'daylight';
+        $plugins_array[] = 'tql';
+        $plugins_array[] = 'unishepper_small';
+        $plugins_array[] = 'usps';
+
+        if ($rates_available) {
+            foreach ($available_methods as $index => $method) {
+                if (!in_array($method->method_id, $plugins_array)) {
+                    unset($available_methods[$index]);
+                }
+            }
+        }
+    }
+    return $available_methods;
+}
+
+
+/**
+ * Shipping Message On Cart If No Method Available 
+ */
+if (!function_exists("eniture_ups_small_no_method_available")) {
+
+    function eniture_ups_small_no_method_available() {
+        $allow_checkout = ( isset($_POST['allow_proceed_checkout_eniture']) ) ? sanitize_text_field(wp_unslash( $_POST['allow_proceed_checkout_eniture'] )) : get_option('allow_proceed_checkout_eniture');
+        $prevent_checkout = ( isset($_POST['prevent_proceed_checkout_eniture']) ) ? sanitize_text_field(wp_unslash( $_POST['prevent_proceed_checkout_eniture'] )) : get_option('prevent_proceed_checkout_eniture');
+
+        if (get_option('allow_proceed_checkout_eniture') !== false) {
+            update_option('allow_proceed_checkout_eniture', $allow_checkout);
+            update_option('prevent_proceed_checkout_eniture', $prevent_checkout);
+        } else {
+            $deprecated = null;
+            $autoload = 'no';
+            add_option('allow_proceed_checkout_eniture', $allow_checkout, '', $autoload);
+            add_option('prevent_proceed_checkout_eniture', $prevent_checkout, '', $autoload);
+        }
+    }
+}
+
+
+/**
+ * Filter For CSV Import
+ */
+if (!function_exists('en_import_dropship_location_csv')) {
+
+    /**
+     * Import drop ship location CSV
+     * @param $data
+     * @param $this
+     * @return array
+     */
+    function en_import_dropship_location_csv($data, $parseData)
+    {
+        $_product_freight_class = $_product_freight_class_variation = '';
+        $_dropship_location = $locations = [];
+        foreach ($data['meta_data'] as $key => $metaData) {
+            $location = explode(',', trim($metaData['value']));
+            switch ($metaData['key']) {
+                // Update new columns
+                case '_product_freight_class':
+                    $_product_freight_class = trim($metaData['value']);
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_product_freight_class_variation':
+                    $_product_freight_class_variation = trim($metaData['value']);
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location_nickname':
+                    $locations[0] = $location;
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location_zip_code':
+                    $locations[1] = $location;
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location_city':
+                    $locations[2] = $location;
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location_state':
+                    $locations[3] = $location;
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location_country':
+                    $locations[4] = $location;
+                    unset($data['meta_data'][$key]);
+                    break;
+                case '_dropship_location':
+                    $_dropship_location = $location;
+            }
+        }
+
+        // Update new columns
+        if (strlen($_product_freight_class) > 0) {
+            $data['meta_data'][] = [
+                'key' => '_ltl_freight',
+                'value' => $_product_freight_class,
+            ];
+        }
+
+        // Update new columns
+        if (strlen($_product_freight_class_variation) > 0) {
+            $data['meta_data'][] = [
+                'key' => '_ltl_freight_variation',
+                'value' => $_product_freight_class_variation,
+            ];
+        }
+
+        if (!empty($locations) || !empty($_dropship_location)) {
+            if (isset($locations[0]) && is_array($locations[0])) {
+                foreach ($locations[0] as $key => $location_arr) {
+                    $metaValue = [];
+                    if (isset($locations[0][$key], $locations[1][$key], $locations[2][$key], $locations[3][$key])) {
+                        $metaValue[0] = $locations[0][$key];
+                        $metaValue[1] = $locations[1][$key];
+                        $metaValue[2] = $locations[2][$key];
+                        $metaValue[3] = $locations[3][$key];
+                        $metaValue[4] = $locations[4][$key];
+                        $dsId[] = en_serialize_dropship($metaValue);
+                    }
+                }
+            } else {
+                $dsId[] = en_serialize_dropship($_dropship_location);
+            }
+
+            $sereializedLocations = maybe_serialize($dsId);
+            $data['meta_data'][] = [
+                'key' => '_dropship_location',
+                'value' => $sereializedLocations,
+            ];
+        }
+        return $data;
+    }
+
+    add_filter('woocommerce_product_importer_parsed_data', 'en_import_dropship_location_csv', '99', '2');
+}
+
+/**
+ * Serialize drop ship
+ * @param $metaValue
+ * @return string
+ * @global $wpdb
+ */
+
+if (!function_exists('en_serialize_dropship')) {
+    function en_serialize_dropship($metaValue)
+    {
+        global $wpdb;
+        $dropship = (array)reset($wpdb->get_results(
+            $wpdb->prepare(
+                "SELECT id
+                    FROM " . $wpdb->prefix . "warehouse
+                    WHERE nickname = %s AND zip = %s AND city = %s AND state = %s AND country = %s",
+                $metaValue[0], $metaValue[1], $metaValue[2], $metaValue[3], $metaValue[4]
+            )
+        ));
+
+        $dropship = array_map('intval', $dropship);
+
+        if (empty($dropship['id'])) {
+            $data = en_csv_import_dropship_data($metaValue);
+            $wpdb->insert(
+                $wpdb->prefix . 'warehouse', $data
+            );
+
+            $dsId = $wpdb->insert_id;
+        } else {
+            $dsId = $dropship['id'];
+        }
+
+        return $dsId;
+    }
+}
+
+/**
+ * Filtered Data Array
+ * @param $metaValue
+ * @return array
+ */
+if (!function_exists('en_csv_import_dropship_data')) {
+    function en_csv_import_dropship_data($metaValue)
+    {
+        return array(
+            'city' => $metaValue[2],
+            'state' => $metaValue[3],
+            'zip' => $metaValue[1],
+            'country' => $metaValue[4],
+            'location' => 'dropship',
+            'nickname' => (isset($metaValue[0])) ? $metaValue[0] : "",
+        );
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-auto-residential.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-auto-residential.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-auto-residential.php	(revision 3237693)
@@ -0,0 +1,27 @@
+<?php
+
+if (!defined("ABSPATH")) {
+    exit();
+}
+
+if (!class_exists("Eniture_Ups_Small_Auto_Residential_Detection")) {
+
+    class Eniture_Ups_Small_Auto_Residential_Detection {
+
+        public $label_sfx_arr;
+
+        public function __construct() {
+            $this->label_sfx_arr = array();
+        }
+
+        public function filter_label_sufex_array_ups_small($result) {
+            (isset($result->residentialStatus) && ($result->residentialStatus == "r")) ? array_push($this->label_sfx_arr, "R") : "";
+            (isset($result->liftGateStatus) && ($result->liftGateStatus == "l")) ? array_push($this->label_sfx_arr, "L") : "";
+            return array_unique($this->label_sfx_arr);
+        }
+
+    }
+
+    new Eniture_Ups_Small_Auto_Residential_Detection();
+}
+
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-carrier-service.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-carrier-service.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-carrier-service.php	(revision 3237693)
@@ -0,0 +1,1282 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Getting Quotes
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * UPS Small WooComerce | Get Quotes For UPS Small
+ */
+class Eniture_UPS_Get_Shipping_Quotes extends Eniture_EnUpsSmallFdo
+{
+
+    /**
+     * Global Variable
+     * @var int
+     */
+    public $ups_sm_errors = array();
+
+    /**
+     * Global Variable
+     * @var int
+     */
+    public $no_services_select = array();
+    public $hazardous_status;
+    public $en_wd_origin_array;
+    public $product_detail = [];
+    public $forcefully_residential_delivery = FALSE;
+
+    /**
+     * Array For Getting Quotes
+     * @param $packages
+     * @param $content
+     * @return Array For Getting Web Quotes
+     */
+    function ups_small_shipping_array($packages, $content, $package_plugin = "")
+    {
+        $itemTypeVal = "";
+        // FDO
+        $en_fdo_meta_data = $post_data = array();
+        $shipping_package_obj = new Eniture_UPS_Small_Shipping_Get_Package();
+        $destinationAddressUpsSmall = $this->destinationAddressUpsSmall();
+
+        $freightClass_ltl_gross_small = array();
+        foreach ($content['contents'] as $item_id => $values) {
+
+            $_product = $values['data'];
+            $freight_class = $shipping_package_obj->ups_small_check_freight_class($_product);
+
+            // Flat shipping
+            $product_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+            $en_fs_existence = apply_filters('en_fs_existence', false);
+            $fs = get_post_meta($product_id, '_enable_fs', true);
+            if (!$_product->is_virtual()) {
+                if ($freight_class == 'ltl_freight' && !($en_fs_existence && $fs == 'yes')) {
+                    $freightClass_ltl_gross_small[] = $freight_class;
+                }
+            }
+        }
+
+        $exceedWeight = get_option('wc_settings_wwe_return_LTL_quotes');
+
+        if (isset($content['itemType'])) {
+            $itemTypeVal = $content['itemType'];
+        }
+
+        if (count($freightClass_ltl_gross_small) > 0) {
+            $find_ltl_class = 'ltl';
+            if ((!isset($itemTypeVal) || $itemTypeVal != 'ltl')) {
+                return $find_ltl_class;
+            }
+        }
+
+        $ups_simple_rate_active = false;
+        $action_contract = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'contract_services');
+        $ups_simple_service = $this->ups_simple_service_options();
+        if (!is_array($action_contract) && !empty($ups_simple_service)) {
+            $ups_simple_rate_active = true;
+        }
+
+        $Pweight = 0;
+        $findLtl = 0;
+        $hazardousMaterials = array();
+        //threshold
+        $weight_threshold = get_option('en_weight_threshold_lfq');
+        $weight_threshold = isset($weight_threshold) && $weight_threshold > 0 ? $weight_threshold : 150;
+        //      check plan for nested material
+        $nested_plan = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'nested_material');
+        $en_shipments = (isset($content['en_shipments'])) ? $content['en_shipments'] : [];
+        foreach ($packages as $package) {
+            $ship_item_alone = $shipmentWeekDays = $storeDateTime = $modifyShipmentDateTime = $shipmentOffsetDays = $orderCutoffTime = $products = $product_name = $stakingProperty = $productName = $productQty = $productPrice = $productWeight = $productLength = $productWidth = $productHeight = $nestingPercentage = $nestedDimension = $nestedItems = $hazardousItems = [];
+            $hazardousItemsCount = 0;
+            $this->en_wd_origin_array = (isset($package['origin'])) ? $package['origin'] : array();
+            $package_zip = (isset($package['origin']['zip'])) ? $package['origin']['zip'] : '';
+            if (!strlen($package_zip) > 0) {
+                continue;
+            }
+
+            $product_markup_shipment_arr = [];
+            if ($package['origin']['ptype'] != 'ltl' && !($exceedWeight == 'yes' && $Pweight > $weight_threshold) &&
+                (empty($en_shipments) || (!empty($en_shipments) && isset($en_shipments[$package_zip]))) &&
+                (!isset($package['is_shipment']) || (isset($package['is_shipment']) && $package['is_shipment'] != 'ltl'))) {
+                if (isset($package['items'])) {
+                    $productIdCount = 0;
+                    foreach ($package['items'] as $item) {
+                        $Pweight = $item['productWeight'];
+                        $productName[$productIdCount] = $item['productName'];
+                        $productWeight[$productIdCount] = $item['productWeight'];
+                        $productLength[$productIdCount] = $item['productLength'];
+                        $productWidth[$productIdCount] = $item['productWidth'];
+                        $productHeight[$productIdCount] = $item['productHeight'];
+                        $productQty[$productIdCount] = $item['productQty'];
+                        $productPrice[$productIdCount] = $item['productPrice'];
+                        $nestingPercentage[$productIdCount] = $item['nestedPercentage'];
+                        $nestedDimension[$productIdCount] = $item['nestedDimension'];
+                        $nestedItems[$productIdCount] = $item['nestedItems'];
+                        $stakingProperty[$productIdCount] = $item['stakingProperty'];
+                        isset($item['nestedMaterial']) && !empty($item['nestedMaterial']) &&
+                        $item['nestedMaterial'] == 'yes' && !is_array($nested_plan) ? $doNesting = 1 : "";
+                        $ship_item_alone[$productIdCount] = $item['ship_item_alone'] || $item['hazardousMaterial'];
+
+                        if(!empty($item['markup'])){
+                            $product_markup_shipment_arr[$productIdCount] = $item['markup'];
+                        }
+
+                        $product_name[] = $item['product_name'];
+                        $products[] = $item['products'];
+
+                        // hazardous item check
+                        $hazardousItems[] = isset($item['hazardousMaterial']) ? $item['hazardousMaterial'] : 0;
+                        if (isset($item['hazardousMaterial']) && $item['hazardousMaterial'] == 1) {
+                            $hazardous_fee_option = get_option('ups_small_hazardous_fee_options');
+                            if ($hazardous_fee_option == 'combine_quantities') {
+                                $hazardousItemsCount += 1;
+                            } else {
+                                $hazardousItemsCount += $item['productQty'];
+                            }
+                        }
+
+                        $productIdCount++;
+                    }
+                }
+
+                // **Start:      Cut Off Time & Ship Date Offset
+                $ups_small_delivery_estimates = get_option('ups_small_delivery_estimates');
+                // shipment days of a week
+                $shipmentWeekDays = $this->ups_small_shipment_week_days();
+                if ($ups_small_delivery_estimates == 'delivery_days' || $ups_small_delivery_estimates == 'delivery_date') {
+
+                    $orderCutoffTime = get_option('ups_small_orderCutoffTime');
+                    $shipmentOffsetDays = get_option('ups_small_shipmentOffsetDays');
+                    $modifyShipmentDateTime = ($orderCutoffTime != '' || $shipmentOffsetDays != '' || (is_array($shipmentWeekDays) && count($shipmentWeekDays) > 0)) ? 1 : 0;
+                    $storeDateTime = gmdate('Y-m-d H:i:s', current_time('timestamp'));
+                }
+
+                $domain = eniture_ups_small_get_domain();
+
+                $index = 'small-package-quotes-ups-edition/small-package-quotes-ups-edition.php';
+                $plugin_info = get_plugins();
+                $plugin_version = $plugin_info[$index]['Version'];
+
+                $residential_detecion_flag = get_option("en_woo_addons_auto_residential_detecion_flag");
+
+                $package_type = get_option('ups_small_packaging_method');
+                $per_package_weight = '';
+                if('ship_one_package_70' == $package_type){
+                    $package_type = 'ship_as_one';
+                    $per_package_weight = '70';
+                }elseif('ship_one_package_150' == $package_type){
+                    $package_type = 'ship_as_one';
+                    $per_package_weight = '150';
+                }
+
+                // FDO
+                $en_fdo_meta_data = $this->en_cart_package($package);
+
+                // Version numbers
+                $plugin_versions = $this->en_version_numbers();
+
+                $s_post_data = array(
+                    // Version numbers
+                    'plugin_version' => $plugin_versions["en_current_plugin_version"],
+                    'wordpress_version' => get_bloginfo('version'),
+                    'woocommerce_version' => $plugin_versions["woocommerce_plugin_version"],
+                    'plateform' => 'WordPress',
+                    'carrierName' => 'upsSmall',
+                    'ups_small_pkg_account_number' => get_option('ups_small_account_number'),
+                    'ups_small_pkg_plugin_licence_key' => get_option('ups_small_licence_key'),
+                    'ups_small_pkg_domain_name' => isset($_SERVER['SERVER_NAME']) ? sanitize_text_field(wp_unslash($_SERVER['SERVER_NAME'])) : '',
+                    'ups_small_pkg_domain_name' => $domain,
+                    'ups_small_pkg_reciver_city' => $destinationAddressUpsSmall['city'],
+                    'ups_small_pkg_receiver_state' => $destinationAddressUpsSmall['state'],
+                    'ups_small_pkg_receiver_zip_code' => $destinationAddressUpsSmall['zip'],
+                    'ups_small_pkg_receiver_countryCode' => $destinationAddressUpsSmall['country'],
+                    'ups_small_pkg_senderCity' => $package['origin']['city'],
+                    'ups_small_pkg_senderState' => $package['origin']['state'],
+                    'ups_small_pkg_senderZip' => $package['origin']['zip'],
+                    'ups_small_pkg_senderCountryCode' => $package['origin']['country'],
+                    'ups_small_pkg_resid_delivery' => (get_option('ups_small_quote_as_residential_delivery') == 'yes') ? 'yes' : 'no',
+                    'ups_small_pkg_product_width' => $productWidth,
+                    'ups_small_pkg_product_height' => $productHeight,
+                    'ups_small_pkg_product_length' => $productLength,
+                    'ups_small_pkg_product_price' => $productPrice,
+                    'ups_small_pkg_product_weight' => $productWeight,
+                    'ups_small_pkg_product_quantity' => $productQty,
+                    'ups_small_pkg_post_title' => $productName,
+                    'suspend_residential' => get_option('suspend_automatic_detection_of_residential_addresses'),
+                    'residential_detecion_flag' => $residential_detecion_flag,
+                    'ups_small_pkg_3_Day_Select' => (get_option('ups_small_pkg_3_Day_Select') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Ground' => (get_option('ups_small_pkg_Ground') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_2nd_Day_Air' => (get_option('ups_small_pkg_2nd_Day_Air') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_2nd_Day_Air_AM' => (get_option('ups_small_pkg_2nd_Day_Air_AM') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Next_Day_Air' => (get_option('ups_small_pkg_Next_Day_Air') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Next_Day_Air_Saver' => (get_option('ups_small_pkg_Next_Day_Air_Saver') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Next_Day_Air_Early_AM' => (get_option('ups_small_pkg_Next_Day_Air_Early_AM') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Standard' => (get_option('ups_small_pkg_Standard') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Worldwide_Express' => (get_option('ups_small_pkg_Worldwide_Express') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Worldwide_Express_Plus' => (get_option('ups_small_pkg_Worldwide_Express_Plus') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Worldwide_Expedited' => (get_option('ups_small_pkg_Worldwide_Expedited') == 'yes') ? 'yes' : "",
+                    'ups_small_pkg_Saver' => (get_option('ups_small_pkg_Saver') == 'yes') ? 'yes' : "",
+                    'ups_tnt' => array(
+                        'access_key' => 'FD3AF37E2608EF8A',
+                        'user_id' => 'genesismannequin',
+                        'password' => 'Genman345@',
+                        'weihgt' => $productWeight,
+                        'weihgt_code' => "LBS",
+                        'pickup_date' => gmdate("Ymd"),
+                        'total_packages_in_shipment' => '1',
+                        'currency_code' => 'USD', // USD / CAD
+                        'monetary_value' => '10',
+                        'maximum_list_size' => '1',
+                        'saturday_delivery_info_request_indicator' => 1
+                    ),
+                    'ups_small_surepost_less_than_1LB' => get_option('ups_surepost_less_than_1_lb'),
+                    'ups_small_surepost_1LB_or_greater' => get_option('ups_surepost_1_lb_or_greater'),
+                    'ups_small_surepost_bpm' => get_option('ups_surepost_bound_printed_matter'),
+                    'ups_small_surepost_media_mail' => get_option('ups_surepost_media_mail'),
+                    "ups_small_pkg_Ground_Freight_Pricing" => get_option('ups_ground_with_freight_pricing'),
+                    // Nested indexes
+                    'doNesting' => $doNesting,
+                    'nesting_percentage' => $nestingPercentage,
+                    'nesting_dimension' => $nestedDimension,
+                    'nested_max_limit' => $nestedItems,
+                    'nested_stack_property' => $stakingProperty,
+                    'sender_origin' => $package['origin']['location'] . ": " . $package['origin']['city'] . ", " . $package['origin']['state'] . " " . $package['origin']['zip'],
+                    'product_name' => $product_name,
+                    'products' => $products,
+                    'modifyShipmentDateTime' => $modifyShipmentDateTime,
+                    'OrderCutoffTime' => $orderCutoffTime,
+                    'shipmentOffsetDays' => $shipmentOffsetDays,
+                    'storeDateTime' => $storeDateTime,
+                    'shipmentWeekDays' => $shipmentWeekDays,
+                    // FDO
+                    'en_fdo_meta_data' => $en_fdo_meta_data,
+                    // Shippable item
+                    'ship_item_alone' => $ship_item_alone,
+                    'origin_markup' => (isset($package['origin']['origin_markup'])) ? $package['origin']['origin_markup'] : 0,
+                    'product_level_markup_arr' => $product_markup_shipment_arr,
+                    'packagesType' => $package_type,
+                    'perPackageWeight' => $per_package_weight,
+                    // Sbs optimization mode
+                    'sbsMode' => get_option('box_sizing_optimization_mode'),
+                    'hazardousItems' => $hazardousItems,
+                    'hazardousItemsCount' => $hazardousItemsCount,
+                );
+
+                // get large cart settings shipping rules
+                $large_cart_settings = (new Eniture_UpsSmallShippingRulesAjaxReq())->get_large_cart_settings();
+                $s_post_data = array_merge($s_post_data, $large_cart_settings);
+
+                if((false === get_option('ups_api_endpoint')) || ('ups_old_api' == get_option('ups_api_endpoint'))){
+                    $s_post_data['ups_small_pkg_username'] = get_option('ups_small_username');
+                    $s_post_data['ups_small_pkg_password'] = get_option('ups_small_password');
+                    $s_post_data['ups_small_pkg_authentication_key'] = get_option('ups_small_api_access_key');
+                }else{
+                    $s_post_data['ApiVersion'] = '2.0';
+                    $s_post_data['clientId'] = get_option('ups_client_id');
+                    $s_post_data['clientSecret'] = get_option('ups_client_secret');
+                    $s_post_data['ups_small_pkg_username'] = get_option('ups_new_api_username');
+                    $s_post_data['ups_small_pkg_password'] = get_option('ups_new_api_password');
+                }
+
+                // USP simple rate
+                if ($ups_simple_rate_active) {
+                    $s_post_data['upsSimpleRateActive'] = 1;
+                    $ups_simple_services = [];
+                    get_option('ups_simple_rate_through_ground') == 'yes' ? $ups_simple_services['usrg'] = 'ups_simple_rate_through_ground' : '';
+                    get_option('ups_simple_rate_through_2nd_day_air') == 'yes' ? $ups_simple_services['usr2'] = 'ups_simple_rate_through_2nd_day_air' : '';
+                    get_option('ups_simple_rate_through_next_day_air_saver') == 'yes' ? $ups_simple_services['usr1'] = 'ups_simple_rate_through_next_day_air_saver' : '';
+                    get_option('ups_simple_rate_through_3_day_select') == 'yes' ? $ups_simple_services['usr3'] = 'ups_simple_rate_through_3_day_select' : '';
+                    !empty($ups_simple_services) ? $s_post_data['upsSimpleRateSelectedServices'] = $ups_simple_services : '';
+                }
+
+                $post_data[$package['origin']['zip']] = apply_filters("en_woo_addons_carrier_service_quotes_request", $s_post_data, eniture_woo_plugin_ups_small);
+
+                // Hazardous Material
+                $hazardous_material = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'hazardous_material');
+
+                if (!is_array($hazardous_material)) {
+                    (isset($package['hazardous_material'])) ? $post_data[$package_zip]['hazardous_status'] = TRUE : "";
+                    (isset($package['hazardous_material'])) ? $post_data[$package_zip]['hazardous_status'] = 'yes' : "";
+                    // FDO
+                    $post_data[$package_zip]['en_fdo_meta_data'] = array_merge($post_data[$package_zip]['en_fdo_meta_data'], $this->en_package_hazardous($package, $en_fdo_meta_data));
+                }
+
+                //Except Ground Transit Restriction
+                if (!is_array(apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'transit_days'))) {
+                    (isset($package['exempt_ground_transit_restriction'])) ? $post_data[$package_zip]['exempt_ground_transit_restriction'] = 'yes' : '';
+                }
+
+                // Insurance Fee
+                $action_insurance = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'insurance_fee');
+                if (!is_array($action_insurance) && isset($package['is_shipment_insure']) && $package['is_shipment_insure']) {
+                    $post_data[$package['origin']['zip']]['includeDeclaredValue'] = 1;
+                    $post_data[$package['origin']['zip']]['declaredValueCurrencyCode'] = 'USD';
+                }
+
+                // In-store pickup and local delivery
+                $instore_pickup_local_devlivery_action = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'instore_pickup_local_devlivery');
+
+                if (!is_array($instore_pickup_local_devlivery_action)) {
+                    $origin_zip = (isset($package['origin']['zip'])) ? $package['origin']['zip'] : '';
+                    $post_data[$origin_zip] = apply_filters('en_ups_small_wd_standard_plans', $post_data[$package['origin']['zip']], $post_data[$package['origin']['zip']]['ups_small_pkg_receiver_zip_code'], $this->en_wd_origin_array, $package_plugin);
+                }
+            }
+
+            // Compatability with OLD SBS Addon
+            $zip_code = (isset($package['origin']['zip'])) ? $package['origin']['zip'] : 0;
+
+            $post_data = apply_filters(
+                'enit_box_sizes_post_array_filter', $post_data, $package, $zip_code
+            );
+
+            if (isset($post_data[$zip_code]['vertical_rotation'], $post_data[$zip_code]['length']) &&
+                count($post_data[$zip_code]['length']) == count($post_data[$zip_code]['vertical_rotation']) &&
+                !empty($post_data[$zip_code]['vertical_rotation'])) {
+                $post_data[$zip_code]['vertical_rotation'] = array_combine(array_keys($post_data[$zip_code]['length']), $post_data[$zip_code]['vertical_rotation']);
+            }
+            if (isset($post_data[$zip_code]['shipBinAlone'], $post_data[$zip_code]['length']) &&
+                count($post_data[$zip_code]['length']) == count($post_data[$zip_code]['shipBinAlone']) &&
+                !empty($post_data[$zip_code]['shipBinAlone'])) {
+                $post_data[$zip_code]['shipBinAlone'] = array_combine(array_keys($post_data[$zip_code]['length']), $post_data[$zip_code]['shipBinAlone']);
+            }
+        }
+
+        do_action("eniture_debug_mood", "Quotes Request (ups small)", $post_data);
+        do_action("eniture_debug_mood", "Plugin Features (ups small)", get_option('eniture_plugin_5'));
+
+        return $post_data;
+    }
+
+    /**
+     * Return version numbers
+     * @return int
+     */
+    function en_version_numbers()
+    {
+        if (!function_exists('get_plugins'))
+            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
+
+        $plugin_folder = get_plugins('/' . 'woocommerce');
+        $plugin_file = 'woocommerce.php';
+        $wc_plugin = (isset($plugin_folder[$plugin_file]['Version'])) ? $plugin_folder[$plugin_file]['Version'] : "";
+        $get_plugin_data = get_plugin_data(UPS_MAIN_FILE);
+        $plugin_version = (isset($get_plugin_data['Version'])) ? $get_plugin_data['Version'] : '';
+
+        $versions = array(
+            "woocommerce_plugin_version" => $wc_plugin,
+            "en_current_plugin_version" => $plugin_version
+        );
+
+        return $versions;
+    }
+
+    /**
+     * @return shipment days of a week
+     */
+    public function ups_small_shipment_week_days()
+    {
+        $shipment_days_of_week = array();
+
+        if (get_option('all_shipment_days_ups_small') == 'yes') {
+            return $shipment_days_of_week;
+        }
+        if (get_option('monday_shipment_day_ups_small') == 'yes') {
+            $shipment_days_of_week[] = 1;
+        }
+        if (get_option('tuesday_shipment_day_ups_small') == 'yes') {
+            $shipment_days_of_week[] = 2;
+        }
+        if (get_option('wednesday_shipment_day_ups_small') == 'yes') {
+            $shipment_days_of_week[] = 3;
+        }
+        if (get_option('thursday_shipment_day_ups_small') == 'yes') {
+            $shipment_days_of_week[] = 4;
+        }
+        if (get_option('friday_shipment_day_ups_small') == 'yes') {
+            $shipment_days_of_week[] = 5;
+        }
+
+        return $shipment_days_of_week;
+    }
+
+    /**
+     * receiver user
+     * @return array type
+     */
+    function destinationAddressUpsSmall()
+    {
+        $en_order_accessories = apply_filters('en_order_accessories', []);
+        if (isset($en_order_accessories) && !empty($en_order_accessories)) {
+            return $en_order_accessories;
+        }
+        $ups_small_woo_obj = new Eniture_UPS_Small_Woo_Update_Changes();
+        $freight_zipcode = (strlen(WC()->customer->get_shipping_postcode()) > 0) ? WC()->customer->get_shipping_postcode() : $ups_small_woo_obj->ups_small_postcode();
+        $freight_state = (strlen(WC()->customer->get_shipping_state()) > 0) ? WC()->customer->get_shipping_state() : $ups_small_woo_obj->ups_small_getState();
+        $freight_country = (strlen(WC()->customer->get_shipping_country()) > 0) ? WC()->customer->get_shipping_country() : $ups_small_woo_obj->ups_small_getCountry();
+        $freight_city = (strlen(WC()->customer->get_shipping_city()) > 0) ? WC()->customer->get_shipping_city() : $ups_small_woo_obj->ups_small_getCity();
+        return array(
+            'city' => $freight_city,
+            'state' => $freight_state,
+            'zip' => $freight_zipcode,
+            'country' => $freight_country
+        );
+    }
+
+    /**
+     * URL Rewriting
+     * @param $domain
+     * @return Refined Domain URL
+     */
+    function ups_small_parse_url($domain)
+    {
+        $domain = trim($domain);
+        $parsed = wp_parse_url($domain);
+
+        if (empty($parsed['scheme'])) {
+            $domain = 'http://' . ltrim($domain, '/');
+        }
+
+        $parse = wp_parse_url($domain);
+        $refinded_domain_name = $parse['host'];
+        $domain_array = explode('.', $refinded_domain_name);
+
+        if (in_array('www', $domain_array)) {
+            $key = array_search('www', $domain_array);
+            unset($domain_array[$key]);
+            if(phpversion() < 8) {
+                $refinded_domain_name = implode($domain_array, '.'); 
+            }else {
+                $refinded_domain_name = implode('.', $domain_array);
+            }
+        }
+
+        return $refinded_domain_name;
+    }
+
+    /**
+     * Get Nearest Address If Multiple Warehouses
+     * @param $warehous_list
+     * @param $receiverZipCode
+     * @return Warehouse Address
+     */
+    function ups_small_multi_warehouse($warehous_list)
+    {
+        if (count($warehous_list) == 1) {
+            $warehous_list = reset($warehous_list);
+            return $this->ups_small_origin_array($warehous_list);
+        }
+
+        $ups_Small_distance_request = new Eniture_Get_ups_small_distance();
+        $accessLevel = "MultiDistance";
+
+        $response_json = $ups_Small_distance_request->ups_small_address($warehous_list, $accessLevel, $this->destinationAddressUpsSmall());
+        $response_json = json_decode($response_json, TRUE);
+
+        // Eniture debug mood
+        do_action("eniture_debug_mood", "Multi Warehouse Distance Response (UPS Small)", $response_json);
+
+        return $response_json['origin_with_min_dist'];
+    }
+
+    /**
+     * Create Origin Array
+     * @param $origin
+     * @return Warehouse Address Array
+     */
+    function ups_small_origin_array($origin)
+    {
+        // In-store pickup and local delivery
+        if (has_filter("en_ups_small_wd_origin_array_set")) {
+            return apply_filters("en_ups_small_wd_origin_array_set", $origin);
+        }
+
+        $zip = $origin->zip;
+        $city = $origin->city;
+        $state = $origin->state;
+        $country = ($origin->country == "CN") ? "CA" : $origin->country;
+        $location = $origin->location;
+        $locationId = $origin->id;
+        return array('locationId' => $locationId, 'zip' => $zip, 'city' => $city, 'state' => $state, 'location' => $location, 'country' => $country);
+    }
+
+    /**
+     * Get UPS Small Web Quotes
+     * @param $request_data
+     * @return Quotes Json
+     */
+    function ups_small_get_quotes($request_data)
+    {
+        // Check response from session
+        $currentData = md5(wp_json_encode($request_data));
+        $requestFromSession = WC()->session->get('previousRequestData');
+        $requestFromSession = ((is_array($requestFromSession)) && (!empty($requestFromSession))) ? $requestFromSession : array();
+
+        if (isset($requestFromSession[$currentData]) && (!empty($requestFromSession[$currentData]))) {
+            $requestFromSession = json_decode($requestFromSession[$currentData]);
+            // Eniture debug mood
+            do_action("eniture_debug_mood", "Build Query session (ups small)", http_build_query($request_data));
+            do_action("eniture_debug_mood", "Quotes Response session (ups small)", $requestFromSession);
+            return $requestFromSession;
+        }
+
+        if (is_array($request_data) && count($request_data) > 0 && !empty($request_data['ups_small_pkg_senderZip'])) {
+            $ups_small_curl_obj = new Eniture_UPS_Small_Curl_Request();
+            $output = $ups_small_curl_obj->ups_small_get_curl_response(ENITURE_UPS_DOMAIN_HITTING_URL . '/s/ups/ups_quotes.php', $request_data);
+
+            // requestKeySBS
+            if (isset($request_data['requestKeySBS']) && strlen($request_data['requestKeySBS']) > 0) {
+                $request_data['requestKey'] = $request_data['requestKeySBS'];
+            } else {
+                $request_data['requestKey'] = (isset($request_data['requestKey'])) ? $request_data['requestKey'] : md5(microtime() . wp_rand());
+            }
+
+            // Set response in session
+            $response = json_decode($output, TRUE);
+
+            if (isset($response['ups_rate']) && !empty($response['ups_rate'])) {
+                if (isset($response['autoResidentialSubscriptionExpired']) &&
+                    ($response['autoResidentialSubscriptionExpired'] == 1)) {
+                    $flag_api_response = "no";
+                    $request_data['residential_detecion_flag'] = $flag_api_response;
+                    $currentData = md5(wp_json_encode($request_data));
+                }
+
+                $requestFromSession[$currentData] = $output;
+                WC()->session->set('previousRequestData', $requestFromSession);
+            }
+
+            // Eniture debug mood
+            do_action("eniture_debug_mood", "Quotes Response (ups small)", json_decode($output));
+
+            return json_decode($output);
+        }
+    }
+
+    /**
+     * Get Calculate service level markup
+     * @param $total_charge
+     * @param $international_markup
+     */
+    function ups_small_calculate_service_level_markup($total_charge, $international_markup)
+    {
+        $international_markup = !$total_charge > 0 ? 0 : $international_markup;
+        $grandTotal = 0;
+        if (floatval($international_markup)) {
+            $pos = strpos($international_markup, '%');
+            if ($pos > 0) {
+                $rest = substr($international_markup, $pos);
+                $exp = explode($rest, $international_markup);
+                $get = $exp[0];
+                $percnt = $get / 100 * $total_charge;
+                $grandTotal += $total_charge + $percnt;
+            } else {
+                $grandTotal += $total_charge + $international_markup;
+            }
+        } else {
+            $grandTotal += $total_charge;
+        }
+        return $grandTotal;
+    }
+
+    /**
+     * Return the array
+     * @param object $result
+     * @return object
+     */
+    public function en_bin_packaging_detail($result)
+    {
+        return isset($result->binPackaging->response) ? $result->binPackaging->response : [];
+    }
+
+    /**
+     * Get Shipping Array For Multiple Shipment
+     * @param $quotes
+     * @return Shipping Rates Array
+     */
+    function en_ups_small_quotes($result, $product_detail, $quote_settings)
+    {
+        $en_box_fee = $en_count_rates = 0;
+        $active_services = $this->service_options_array();
+        $simple_services = $this->ups_simple_service_options();
+
+        $en_rates = [];
+        $en_sorting_rates = [];
+
+        $no_quotes = true;
+        $ups_quotes = (isset($result->q) && !empty($result->q)) ? $result->q : [];
+        $ups_quotes = (empty($ups_quotes) && isset($result->ups_rate) && !empty($result->ups_rate)) ? $result->ups_rate : $ups_quotes;
+        if (isset($result->ups_rate) && !empty($result->ups_rate)) {
+            foreach ($result->ups_rate as $val) {
+                (isset($val->RatedShipment)) ? $no_quotes = false : '';
+            }
+        }
+
+        if (isset($result->q) && !empty($result->q)) {
+            foreach ($result->q as $val) {
+                (isset($val->Service)) ? $no_quotes = false : '';
+            }
+        }
+
+        if (!empty($ups_quotes) && (!empty($active_services) || !empty($simple_services))) {
+            $en_always_accessorial = [];
+            $multiple_accessorials[] = ['S'];
+
+            $this->forcefully_residential_delivery ? $multiple_accessorials[] = ['R'] : '';
+            $ups_small_hazardous_materials_shipments = get_option('ups_small_hazardous_materials_shipments');
+            (get_option('ups_small_quote_as_residential_delivery') == 'yes') ? $en_always_accessorial[] = 'R' : '';
+            $hazardous_material = isset($product_detail['hazardous_status']) && $product_detail['hazardous_status'] == 'yes' ? TRUE : FALSE;
+            $en_auto_residential_status = !in_array('R', $en_always_accessorial) && isset($result->residentialStatus) && $result->residentialStatus == 'r' ? 'r' : '';
+
+            $handling_fee = get_option('ups_small_hand_fee_mark_up');
+            ($hazardous_material) ? $en_always_accessorial[] = 'H' : '';
+            $meta_data['accessorials'] = wp_json_encode($en_always_accessorial);
+            $meta_data['sender_origin'] = (isset($product_detail['sender_origin'])) ? $product_detail['sender_origin'] : '';
+            $meta_data['product_name'] = (isset($product_detail['product_name'])) ? $product_detail['product_name'] : '';
+            $meta_data['plugin_name'] = "upsSmall";
+            $meta_data['quote_settings'] = $quote_settings;
+
+            // FDO
+            $en_fdo_meta_data = (isset($product_detail['en_fdo_meta_data'])) ? $product_detail['en_fdo_meta_data'] : '';
+            // FDO
+            $en_auto_residential_status == 'r' ? $en_fdo_meta_data['accessorials']['residential'] = true : '';
+
+            $package_bins = (isset($product_detail['package_bins'])) ? $product_detail['package_bins'] : [];
+            $en_box_fee_arr = (isset($product_detail['en_box_fee']) && !empty($product_detail['en_box_fee'])) ? $product_detail['en_box_fee'] : [];
+            $en_multi_box_qty = (isset($product_detail['en_multi_box_qty']) && !empty($product_detail['en_multi_box_qty'])) ? $product_detail['en_multi_box_qty'] : [];
+            $products = (isset($product_detail['products'])) ? $product_detail['products'] : [];
+            $hazardousItems = (isset($product_detail['hazardousItems'])) ? $product_detail['hazardousItems'] : [];
+            $hazardousItemsForNonSbs = (isset($product_detail['hazardousItemsCount'])) ? $product_detail['hazardousItemsCount'] : [];
+
+            if (isset($en_box_fee_arr) && is_array($en_box_fee_arr) && !empty($en_box_fee_arr)) {
+                foreach ($en_box_fee_arr as $en_box_fee_key => $en_box_fee_value) {
+                    $en_multi_box_quantity = (isset($en_multi_box_qty[$en_box_fee_key])) ? $en_multi_box_qty[$en_box_fee_key] : 0;
+                    $en_box_fee += $en_box_fee_value * $en_multi_box_quantity;
+                }
+            }
+
+            $bin_packaging_filtered = $this->en_bin_packaging_detail($result);
+            $bin_packaging_filtered = !empty($bin_packaging_filtered) ? json_decode(wp_json_encode($bin_packaging_filtered), TRUE) : [];
+
+            // Bin Packaging Box Fee|Product Title Start
+            $en_box_total_price = 0;
+            $en_harzardous_pckg_count = 0;
+            if (isset($bin_packaging_filtered['bins_packed']) && !empty($bin_packaging_filtered['bins_packed'])) {
+                foreach ($bin_packaging_filtered['bins_packed'] as $bins_packed_key => $bins_packed_value) {
+                    $bin_data = (isset($bins_packed_value['bin_data'])) ? $bins_packed_value['bin_data'] : [];
+                    $bin_items = (isset($bins_packed_value['items'])) ? $bins_packed_value['items'] : [];
+                    $bin_id = (isset($bin_data['id'])) ? $bin_data['id'] : '';
+                    $bin_type = (isset($bin_data['type'])) ? $bin_data['type'] : '';
+                    $bins_detail = (isset($package_bins[$bin_id])) ? $package_bins[$bin_id] : [];
+                    $en_box_price = (isset($bins_detail['box_price'])) ? $bins_detail['box_price'] : 0;
+                    $en_box_total_price += $en_box_price;
+
+                    $prev_bin_item_id = $prev_bin_id = '';
+                    foreach ($bin_items as $bin_items_key => $bin_items_value) {
+                        $bin_item_id = (isset($bin_items_value['id'])) ? $bin_items_value['id'] : '';
+                        $get_product_name = (isset($products[$bin_item_id])) ? $products[$bin_item_id] : '';
+                        if ($bin_type == 'item') {
+                            $bin_packaging_filtered['bins_packed'][$bins_packed_key]['bin_data']['product_name'] = $get_product_name;
+                        }
+
+                        if (isset($bin_packaging_filtered['bins_packed'][$bins_packed_key]['items'][$bin_items_key])) {
+                            $bin_packaging_filtered['bins_packed'][$bins_packed_key]['items'][$bin_items_key]['product_name'] = $get_product_name;
+                        }
+
+                        // Hazardous package check
+                        $is_hazmat_item = isset($hazardousItems[$bin_item_id]) && ($bin_item_id != $prev_bin_item_id) && ($bin_id != $prev_bin_id) ? $hazardousItems[$bin_item_id] : false;
+                        if ($is_hazmat_item) {
+                            $en_harzardous_pckg_count++;
+                        }
+
+                        $prev_bin_item_id = $bin_item_id;
+                        $prev_bin_id = $bin_id;
+                    }
+                }
+            } else {
+                $en_harzardous_pckg_count = $hazardousItemsForNonSbs;
+            }
+
+            if ($en_harzardous_pckg_count == 0) {
+                $en_harzardous_pckg_count = 1;
+            }
+
+            $en_box_total_price += $en_box_fee;
+            $meta_data['bin_packaging'] = wp_json_encode($bin_packaging_filtered);
+            // FDO
+            $en_fdo_meta_data['bin_packaging'] = $bin_packaging_filtered;
+            $en_fdo_meta_data['bins'] = $package_bins;
+
+            $InstorPickupLocalDelivery = (isset($result->InstorPickupLocalDelivery)) ? $result->InstorPickupLocalDelivery : [];
+            $InstorPickupLocalDelivery = (empty($InstorPickupLocalDelivery) && isset($ups_quotes->InstorPickupLocalDelivery)) ? $ups_quotes->InstorPickupLocalDelivery : $InstorPickupLocalDelivery;
+            $rate_source = get_option('ups_small_rate_source');
+            $new_api_enaled = get_option('ups_api_endpoint') == 'ups_new_api';
+
+            foreach ($ups_quotes as $service_key => $val) {
+                if (isset($simple_services[$service_key])) {
+                    $ups_simple_price = (isset($val->rate)) ? $val->rate : 0;
+                    if (!$ups_simple_price > 0) {
+                        continue;
+                    }
+
+                    // Only quote ground service for hazardous materials shipments
+                    if ($service_key != 'usrg' && $hazardous_material && $ups_small_hazardous_materials_shipments == "yes") {
+                        continue;
+                    }
+
+                    // product level markup
+                    if(is_array($product_detail['product_level_markup_arr']) && count($product_detail['product_level_markup_arr']) > 0){
+                        $ups_simple_price = $this->add_product_level_markup($ups_simple_price, $product_detail['product_level_markup_arr']);
+                    }
+                    
+                    // origin level markup
+                    if(!empty($product_detail['origin_markup'])){
+                        $ups_simple_price = $this->ups_small_calculate_service_level_markup($ups_simple_price, $product_detail['origin_markup']);
+                    }
+
+                    // Adding service level markup
+                    if (isset($simple_services[$service_key]['markup']) && !empty($simple_services[$service_key]['markup']) && isset($ups_simple_price) && !empty($ups_simple_price)) {
+                        $service_markup = $simple_services[$service_key]['markup'];
+                        $ups_simple_price = $this->ups_small_calculate_service_level_markup($ups_simple_price, $service_markup);
+                    }
+
+                    $service_title = $this->ups_carrier_service_name_by_code($service_key);
+                    $en_simple_service = array(
+                        'id' => $service_key,
+                        'cost' => $ups_simple_price,
+                        'rate' => $ups_simple_price,
+                        'transit_time' => '',
+                        'delivery_days' => '',
+                        'title' => $service_title,
+                        'label' => $service_title,
+                        'label_as' => $service_title,
+                        'service_name' => $service_key,
+                        'meta_data' => $meta_data,
+                        'origin_markup' => $product_detail['origin_markup'],
+                        'product_level_markup_arr' => $product_detail['product_level_markup_arr'],
+                        'surcharges' => $this->en_get_accessorials_prices($surcharges, $en_always_accessorial, $en_auto_residential_status, $grand_total),
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+
+                    // Cost of the rates
+                    $en_simple_type = 'S';
+                    $en_rates[$en_simple_type][$en_count_rates] = $en_simple_service;
+                    $en_sorting_rates
+                    [$en_simple_type]
+                    [$en_count_rates]['cost'] = // Used for sorting of rates
+                    $en_rates
+                    [$en_simple_type]
+                    [$en_count_rates]['cost'] = $ups_simple_price;
+
+                    $en_rates[$en_simple_type][$en_count_rates]['label_sufex'] = ['S'];
+
+                    // FDO
+                    $en_fdo_meta_data['rate'] = $en_rates[$en_simple_type][$en_count_rates];
+                    if (isset($en_fdo_meta_data['rate']['meta_data'])) {
+                        unset($en_fdo_meta_data['rate']['meta_data']);
+                    }
+
+                    $en_fdo_meta_data['quote_settings'] = $quote_settings;
+                    $en_rates[$en_simple_type][$en_count_rates]['meta_data']['en_fdo_meta_data'] = $en_fdo_meta_data;
+                    $en_rates[$en_simple_type][$en_count_rates]['meta_data']['en_fdo_meta_data']['accessorials'] = [];
+                    $en_count_rates++;
+                    continue;
+                }
+
+                // UPS Ground with Freight Pricing
+                if ($service_key == 'GFP') {
+                    $val = $this->format_GFP_service_response($service_key, $val);
+                }
+
+                if(isset($val->Service)){
+                    $rate_arr = $val;
+                }else if(isset($val->RatedShipment)){
+                    $rate_arr = $val->RatedShipment;
+                }else{
+                    $rate_arr = [];
+                }
+
+                if ((isset($rate_arr->Service->Code) && isset($active_services[$rate_arr->Service->Code]) && !empty($active_services[$rate_arr->Service->Code])) || ($no_quotes && !empty($rate_arr))) {
+
+                    // List (retail) rates
+                    if (empty($rate_source) || $rate_source == false || $rate_source == 'list_rates') {
+                        $MonetaryValue = (isset($rate_arr->TotalCharges->MonetaryValue) ? $rate_arr->TotalCharges->MonetaryValue : 0);
+                    } else {
+                        $MonetaryValue = 0;
+
+                        // Negotiated rates
+                        if ($new_api_enaled && isset($rate_arr->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
+                            $MonetaryValue = $rate_arr->NegotiatedRateCharges->TotalCharge->MonetaryValue;
+                        } elseif (isset($rate_arr->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
+                            $MonetaryValue = $rate_arr->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
+                        }
+
+                        if ($MonetaryValue == 0) {
+                            $MonetaryValue = isset($rate_arr->TotalCharges->MonetaryValue) ? $rate_arr->TotalCharges->MonetaryValue : 0;
+                        }
+                    }
+
+                    // Add hazardous fee
+                    $MonetaryValue = $this->addHazardousFee($rate_arr->Service->Code, $MonetaryValue, $hazardous_material, $en_harzardous_pckg_count);
+
+                    // product level markup
+                    if(is_array($product_detail['product_level_markup_arr']) && count($product_detail['product_level_markup_arr']) > 0){
+                        $MonetaryValue = $this->add_product_level_markup($MonetaryValue, $product_detail['product_level_markup_arr']);
+                    }
+                    
+                    // origin level markup
+                    if(!empty($product_detail['origin_markup'])){
+                        $MonetaryValue = $this->ups_small_calculate_service_level_markup($MonetaryValue, $product_detail['origin_markup']);
+                    }
+
+                    // Adding service level markup
+                    if (isset($active_services[$rate_arr->Service->Code]['markup']) && !empty($active_services[$rate_arr->Service->Code]['markup']) && isset($MonetaryValue) && !empty($MonetaryValue)) {
+                        $service_markup = $active_services[$rate_arr->Service->Code]['markup'];
+                        $MonetaryValue = $this->ups_small_calculate_service_level_markup($MonetaryValue, $service_markup);
+                    }
+
+                    $cost = $MonetaryValue;
+                    $service_title = $this->ups_carrier_service_name_by_code($rate_arr->Service->Code);
+
+                    // Adding markup / handling fee
+                    if ($handling_fee != "") {
+                        $grand_total = $this->calculate_handeling_fee($handling_fee, $cost);
+                    } else {
+                        $grand_total = $cost;
+                    }
+
+                    $surcharges = [];
+                    $transit_time = (isset($val->deliveryDate)) ? $val->deliveryDate : '';
+                    $delivery_days = (isset($val->totalTransitTimeInDays)) ? $val->totalTransitTimeInDays : '';
+                    $delivery_time = (isset($val->deliveryTime)) ? $val->deliveryTime : '';
+                    $service_type = 'ups_small';
+                    $service_name = (isset($rate_arr->Service->Code)) ? $rate_arr->Service->Code : '';
+
+                    if (($hazardous_material) && ($service_name != 03) && $service_name != 'GFP') {
+                        if ($ups_small_hazardous_materials_shipments == "yes") {
+                            continue;
+                        }
+                    }
+
+                    // Add box fee
+                    $en_service_cost = $grand_total > 0 ? $grand_total + (float)$en_box_total_price : 0;
+
+                    $en_service = array(
+                        'id' => $service_type . "_" . $service_name,
+                        'service_type' => $service_type . "_" . $service_name,
+                        'cost' => $en_service_cost,
+                        'rate' => $en_service_cost,
+                        'transit_time' => $transit_time,
+                        'delivery_days' => $delivery_days,
+                        'delivery_time' => $delivery_time,
+                        'title' => $service_title,
+                        'label' => $service_title,
+                        'label_as' => $service_title,
+                        'service_name' => $service_name,
+                        'meta_data' => $meta_data,
+                        'origin_markup' => $product_detail['origin_markup'],
+                        'product_level_markup_arr' => $product_detail['product_level_markup_arr'],
+                        'surcharges' => $this->en_get_accessorials_prices($surcharges, $en_always_accessorial, $en_auto_residential_status, $grand_total),
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture',
+                        'override_rate' => isset($val->overrideRate) && $val->overrideRate
+                    );
+
+                    foreach ($multiple_accessorials as $multiple_accessorials_key => $accessorial) {
+                        $en_fliped_accessorial = array_flip($accessorial);
+
+                        // When auto-rad detected
+                        (!$this->forcefully_residential_delivery && $en_auto_residential_status == 'r') ? $accessorial[] = 'R' : '';
+
+                        $en_extra_charges = array_diff_key((isset($en_service['surcharges']) ? $en_service['surcharges'] : []), $en_fliped_accessorial);
+
+                        $en_accessorial_type = implode('', $accessorial);
+                        $en_rates[$en_accessorial_type][$en_count_rates] = $en_service;
+
+                        // Service name changed GROUND HOME DELIVERY to FEDEX GROUND
+                        if ((isset($en_service['service_type'], $en_service['title'], $en_service['label']) &&
+                                $service_type == 'GROUND_HOME_DELIVERY') &&
+                            $this->forcefully_residential_delivery &&
+                            !in_array('R', $accessorial)) {
+                            $en_rates[$en_accessorial_type][$en_count_rates]['service_type'] = 'FEDEX_GROUND_home_ground_pricing';
+                            $en_rates[$en_accessorial_type][$en_count_rates]['title'] = 'FedEx Ground';
+                            $en_rates[$en_accessorial_type][$en_count_rates]['label'] = 'FedEx Ground';
+                        }
+
+                        // Cost of the rates
+                        $en_sorting_rates
+                        [$en_accessorial_type]
+                        [$en_count_rates]['cost'] = // Used for sorting of rates
+                        $en_rates
+                        [$en_accessorial_type]
+                        [$en_count_rates]['cost'] = (isset($en_service['cost']) ? $en_service['cost'] : 0) - array_sum($en_extra_charges);
+
+                        $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['label_sufex'] = wp_json_encode($accessorial);
+                        $en_rates[$en_accessorial_type][$en_count_rates]['label_sufex'] = $accessorial;
+                        $alphabets = 'abcdefghijklmnopqrstuvwxyz';
+                        $rand_string = substr(str_shuffle(str_repeat($alphabets, wp_rand(1, 10))), 1, 10);
+                        if (isset($en_rates[$en_accessorial_type][$en_count_rates]['service_name'])) {
+                            $en_rates[$en_accessorial_type][$en_count_rates]['id'] = $en_rates[$en_accessorial_type][$en_count_rates]['service_name'];
+                        } else if (isset($en_rates[$en_accessorial_type][$en_count_rates]['id'])) {
+                            $en_rates[$en_accessorial_type][$en_count_rates]['id'] = $en_rates[$en_accessorial_type][$en_count_rates]['id'];
+                        } else {
+                            $en_rates[$en_accessorial_type][$en_count_rates]['id'] = $rand_string;
+                        }
+
+                        // FDO
+                        $en_fdo_meta_data['rate'] = $en_rates[$en_accessorial_type][$en_count_rates];
+                        if (isset($en_fdo_meta_data['rate']['meta_data'])) {
+                            unset($en_fdo_meta_data['rate']['meta_data']);
+                        }
+
+                        $en_fdo_meta_data['quote_settings'] = $quote_settings;
+                        $en_rates[$en_accessorial_type][$en_count_rates]['meta_data']['en_fdo_meta_data'] = $en_fdo_meta_data;
+                        $en_count_rates++;
+                    }
+                }
+            }
+        }
+
+        $en_rates['en_sorting_rates'] = $en_sorting_rates;
+        $en_rates['InstorPickupLocalDelivery'] = $InstorPickupLocalDelivery;
+
+        return $en_rates;
+    }
+
+    /**
+     * Get accessorials prices from api response
+     * @param array $accessorials
+     * @return array
+     */
+    public function en_get_accessorials_prices($accessorials, $en_always_accessorial, $en_auto_residential_status, $total_price)
+    {
+        $surcharges = [];
+        $fuel_surcharges = 0;
+        $mapp_surcharges = [
+            'RESIDENTIAL_DELIVERY' => 'R',
+        ];
+
+        if (isset($accessorials->SurchargeType) && $accessorials->SurchargeType == 'FUEL') {
+            $fuel_surcharges = $accessorials->Amount->Amount;
+        }
+
+        foreach ($accessorials as $key => $accessorial) {
+            $key = (isset($accessorial->SurchargeType)) ? $accessorial->SurchargeType : '';
+            ($key == 'FUEL') ? $fuel_surcharges = $accessorial->Amount->Amount : '';
+
+            if (isset($mapp_surcharges[$key])) {
+                $accessorial = (isset($accessorial->Amount->Amount)) ? $accessorial->Amount->Amount : 0;
+                in_array($mapp_surcharges[$key], $en_always_accessorial) && !$this->forcefully_residential_delivery ?
+                    $accessorial = 0 : '';
+                $en_auto_residential_status == 'r' && $mapp_surcharges[$key] == 'R' && !$this->forcefully_residential_delivery ?
+                    $accessorial = 0 : '';
+                $surcharges[$mapp_surcharges[$key]] = $accessorial;
+            }
+        }
+
+        if (isset($surcharges['R']) && $surcharges['R'] > 0) {
+            $residential_surcharges = $surcharges['R'];
+            $fuel_percentage = ($fuel_surcharges * 100) / ($total_price - $fuel_surcharges);
+            $surcharges['R'] = $residential_surcharges + ($residential_surcharges * $fuel_percentage / 100);
+        }
+
+        return $surcharges;
+    }
+
+    /**
+     * Calculate Handling Fee For Each Shipment
+     * @param $handeling_fee
+     * @param $total
+     * @return Grand Total After Calculating Handling Fee
+     */
+    function calculate_handeling_fee($handeling_fee, $total)
+    {
+        $handeling_fee = !$total > 0 ? 0 : $handeling_fee;
+        $grandTotal = 0;
+        if (floatval($handeling_fee)) {
+            $pos = strpos($handeling_fee, '%');
+            if ($pos > 0) {
+                $rest = substr($handeling_fee, $pos);
+                $exp = explode($rest, $handeling_fee);
+                $get = $exp[0];
+                $percnt = $get / 100 * $total;
+                $grandTotal += $total + $percnt;
+            } else {
+                $grandTotal += $total + $handeling_fee;
+            }
+        } else {
+            $grandTotal += $total;
+        }
+        return $grandTotal;
+    }
+
+    /**
+     * UPS Selected Services From Admin Configuration
+     * @return All Selected Services Array
+     */
+    function service_options_array()
+    {
+        $active_services = array();
+
+        if (get_option('ups_small_pkg_Next_Day_Air_Early_AM') == 'yes') {
+            $active_services["14"] = ['name' => 'ups_small_pkg_Next_Day_Air_Early_AM', 'markup' => get_option('ups_small_next_day_air_early_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Standard') == 'yes') {
+            $active_services["11"] = ['name' => 'ups_small_pkg_Standard', 'markup' => get_option('ups_small_standard_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Next_Day_Air') == 'yes') {
+            $active_services["01"] = ['name' => 'ups_small_pkg_Next_Day_Air', 'markup' => get_option('ups_small_next_day_air_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Worldwide_Expedited') == 'yes') {
+            $active_services["08"] = ['name' => 'ups_small_pkg_Worldwide_Expedited', 'markup' => get_option('ups_small_pkg_Worldwide_Expedited_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Next_Day_Air_Saver') == 'yes') {
+            $active_services["13"] = ['name' => 'ups_small_pkg_Next_Day_Air_Saver', 'markup' => get_option('ups_small_next_day_air_saver_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Saver') == 'yes') {
+            $active_services["65"] = ['name' => 'ups_small_pkg_Saver', 'markup' => get_option('ups_small_worldwide_saver_markup')];
+        }
+
+        if (get_option('ups_small_pkg_2nd_Day_Air_AM') == 'yes') {
+            $active_services["59"] = ['name' => 'ups_small_pkg_2nd_Day_Air_AM', 'markup' => get_option('ups_small_2day_air_am_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Worldwide_Express') == 'yes') {
+            $active_services["07"] = ['name' => 'ups_small_pkg_Worldwide_Express', 'markup' => get_option('ups_small_worldwide_express_markup')];
+        }
+
+        if (get_option('ups_small_pkg_2nd_Day_Air') == 'yes') {
+            $active_services["02"] = ['name' => 'ups_small_pkg_2nd_Day_Air', 'markup' => get_option('ups_small_2day_air_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Worldwide_Express_Plus') == 'yes') {
+            $active_services["54"] = ['name' => 'ups_small_pkg_Worldwide_Express_Plus', 'markup' => get_option('ups_small_worldwide_express_plus_markup')];
+        }
+
+        if (get_option('ups_small_pkg_3_Day_Select') == 'yes') {
+            $active_services["12"] = ['name' => 'ups_small_pkg_3_Day_Select', 'markup' => get_option('ups_small_3day_select_markup')];
+        }
+
+        if (get_option('ups_small_pkg_Ground') == 'yes') {
+            $active_services["03"] = ['name' => 'ups_small_pkg_Ground', 'markup' => get_option('ups_small_ground_markup')];
+        }
+        if (get_option('ups_surepost_less_than_1_lb') == 'yes') {
+            $active_services["92"] = ['name' => 'ups_surepost_less_than_1_lb', 'markup' => get_option('ups_contract_services_markup')];
+        }
+        if (get_option('ups_surepost_1_lb_or_greater') == 'yes') {
+            $active_services["93"] = ['name' => 'ups_surepost_1_lb_or_greater', 'markup' => get_option('ups_surepost_1_lb_or_greater_markup')];
+        }
+        if (get_option('ups_surepost_bound_printed_matter') == 'yes') {
+            $active_services["94"] = ['name' => 'ups_surepost_bound_printed_matter', 'markup' => get_option('ups_surepost_bound_printed_matter_markup')];
+        }
+        if (get_option('ups_surepost_media_mail') == 'yes') {
+            $active_services["95"] = ['name' => 'ups_surepost_media_mail', 'markup' => get_option('ups_surepost_media_mail_markup')];
+        }
+        if (get_option('ups_ground_with_freight_pricing') == 'yes') {
+            $active_services["GFP"] = ['name' => 'ups_ground_with_freight_pricing', 'markup' => get_option('ups_ground_with_freight_pricing_markup')];
+        }
+
+        return $active_services;
+    }
+
+    /**
+     * UPS simple Services From Admin Configuration
+     * @return All Selected Services Array
+     */
+    function ups_simple_service_options()
+    {
+        $active_services = [];
+
+        // USP simple rate
+        if (get_option('ups_simple_rate_through_ground') == 'yes') {
+            $active_services["usrg"] = ['name' => 'ups_simple_rate_through_ground', 'markup' => get_option('ups_simple_rate_through_ground_markup')];
+        }
+        if (get_option('ups_simple_rate_through_2nd_day_air') == 'yes') {
+            $active_services["usr2"] = ['name' => 'ups_simple_rate_through_2nd_day_air', 'markup' => get_option('ups_simple_rate_through_2nd_day_air_markup')];
+        }
+        if (get_option('ups_simple_rate_through_next_day_air_saver') == 'yes') {
+            $active_services["usr1"] = ['name' => 'ups_simple_rate_through_next_day_air_saver', 'markup' => get_option('ups_simple_rate_through_next_day_air_saver_markup')];
+        }
+        if (get_option('ups_simple_rate_through_3_day_select') == 'yes') {
+            $active_services["usr3"] = ['name' => 'ups_simple_rate_through_3_day_select', 'markup' => get_option('ups_simple_rate_through_3_day_select_markup')];
+        }
+
+        return $active_services;
+    }
+
+    /**
+     * Get Names Of UPS Selected Services
+     * @param $code
+     * @return Services Names
+     */
+    function ups_carrier_service_name_by_code($code)
+    {
+        $service_name = '';
+        switch ($code) {
+            case '14':
+                $service_name = !empty(get_option('ups_small_next_day_air_early_label')) ? get_option('ups_small_next_day_air_early_label') : 'UPS Next Day Air Early';
+                break;
+            case '01':
+                $service_name = !empty(get_option('ups_small_next_day_air_label')) ? get_option('ups_small_next_day_air_label') : 'UPS Next Day Air';
+                break;
+            case '13':
+                $service_name = !empty(get_option('ups_small_next_day_air_saver_label')) ? get_option('ups_small_next_day_air_saver_label') : 'UPS Next Day Air Saver';
+                break;
+            case '59':
+                $service_name = !empty(get_option('ups_small_2day_air_am_label')) ? get_option('ups_small_2day_air_am_label') : 'UPS 2nd Day Air A.M.';
+                break;
+            case '02':
+                $service_name = !empty(get_option('ups_small_2day_air_label')) ? get_option('ups_small_2day_air_label') : 'UPS 2nd Day Air';
+                break;
+            case '12':
+                $service_name = !empty(get_option('ups_small_3day_select_label')) ? get_option('ups_small_3day_select_label') : 'UPS 3 Day Select';
+                break;
+            case '03':
+                $service_name = !empty(get_option('ups_small_ground_label')) ? get_option('ups_small_ground_label') : 'UPS Ground';
+                break;
+            case '11':
+                $service_name = !empty(get_option('ups_small_standard_label')) ? get_option('ups_small_standard_label') : 'UPS Standard';
+                break;
+            case '08':
+                $service_name = !empty(get_option('ups_small_pkg_Worldwide_Expedited_label')) ? get_option('ups_small_pkg_Worldwide_Expedited_label') : 'UPS  Expedited | UPS Worldwide Expedited';
+                break;
+            case '65':
+                $service_name = !empty(get_option('ups_small_worldwide_saver_label')) ? get_option('ups_small_worldwide_saver_label') : 'UPS Express Saver | UPS Worldwide Saver';
+                break;
+            case '07':
+                $service_name = !empty(get_option('ups_small_worldwide_express_label')) ? get_option('ups_small_worldwide_express_label') : 'UPS Express | UPS Worldwide Express';
+                break;
+            case '54':
+                $service_name = !empty(get_option('ups_small_worldwide_express_plus_label')) ? get_option('ups_small_worldwide_express_plus_label') : 'UPS Express Plus | UPS Worldwide Express Plus';
+                break;
+            case '92':
+                $service_name = !empty(get_option('ups_surepost_less_than_1_lb_label')) ? get_option('ups_surepost_less_than_1_lb_label') : 'UPS SurePost Less than 1LB';
+                break;
+            case '93':
+                $service_name = !empty(get_option('ups_surepost_1_lb_or_greater_label')) ? get_option('ups_surepost_1_lb_or_greater_label') : 'UPS SurePost 1LB or greater';
+                break;
+            case '94':
+                $service_name = !empty(get_option('ups_surepost_bound_printed_matter_label')) ? get_option('ups_surepost_bound_printed_matter_label') : 'UPS SurePost BPM';
+                break;
+            case '95':
+                $service_name = !empty(get_option('ups_surepost_media_mail_label')) ? get_option('ups_surepost_media_mail_label') : 'UPS SurePost Media Mail';
+                break;
+            case 'GFP':
+                $service_name = !empty(get_option('ups_ground_with_freight_pricing_label')) ? get_option('ups_ground_with_freight_pricing_label') : 'UPS Ground with Freight Pricing';
+                break;
+
+            // USP simple rate
+            case 'usrg':
+                $service_name = !empty(get_option('ups_simple_rate_through_ground_label')) ? get_option('ups_simple_rate_through_ground_label') : 'UPS Simple Rate - Ground';
+                break;
+            case 'usr3':
+                $service_name = !empty(get_option('ups_simple_rate_through_3_day_select_label')) ? get_option('ups_simple_rate_through_3_day_select_label') : 'UPS Simple Rate - 3-day Select';
+                break;
+            case 'usr2':
+                $service_name = !empty(get_option('ups_simple_rate_through_2nd_day_air_label')) ? get_option('ups_simple_rate_through_2nd_day_air_label') : 'UPS Simple Rate - 2-day Air';
+                break;
+            case 'usr1':
+                $service_name = !empty(get_option('ups_simple_rate_through_next_day_air_saver_label')) ? get_option('ups_simple_rate_through_next_day_air_saver_label') : 'UPS Simple Rate - Next Day Air Saver';
+                break;
+        }
+
+        return $service_name;
+    }
+
+    /**
+     * Get adding hazardous fee Calculated Total Price
+     * @param $code
+     * @param $price
+     * @param $hazardous
+     * @return Total Price
+     */
+    function addHazardousFee($code, $price, $hazardous, $harzardous_items_count)
+    {
+        $short_cods = array('air' => array("14", "01", "13", "59", "12", "02", "08", "65", "07", "54", '1DA', '1DM', '1DP', "92", "93", "94", "95", "GFP"));
+        $only_ground_hazardous = get_option('ups_small_quote_exclude_air_service');
+        $air_hazardous = get_option('ups_small_air_hazardous_fee');
+        $price = floatval($price);
+        $hazardousFee = get_option('ups_small_ground_hazardous_fee');
+
+        $sure_post = ['92', '93', '94', '95', 'GFP'];
+        if (in_array($code, $sure_post)) {
+            $hazardousFee = 0;
+            $air_hazardous = 0;
+        }
+
+        if ($hazardous && $price != 0) {
+            $this->hazardous_status = 1;
+
+            if (!in_array($code, $short_cods['air']) && $hazardousFee != '' && $hazardousFee != 0) {
+                /* Ground Hazardous */
+                $price = $price + $hazardousFee * $harzardous_items_count;
+            }
+
+            if ($only_ground_hazardous != 'yes' && in_array($code, $short_cods['air']) && floatval($air_hazardous) != 0) {
+                /* Air Hazardous */
+                $price = $price + $air_hazardous * $harzardous_items_count;
+            } else if ($only_ground_hazardous == 'yes' && in_array($code, $short_cods['air'])) {
+                $price = 0;
+            }
+        }
+
+        return $price;
+    }
+
+    /**
+     * Add product level markup to the code
+     */
+    function add_product_level_markup($cost, $product_level_markup_arr){
+            
+        foreach($product_level_markup_arr as $pro_id => $markup){
+            $cost = $this->ups_small_calculate_service_level_markup($cost, $markup);
+        }
+
+        return $cost;
+    }
+
+    function format_GFP_service_response($service_code, $service)
+    {
+        // handle service error
+        $error = isset($service->soapenvBody->soapenvFault->faultcode) || (isset($service->severity) && $service->severity == 'ERROR');
+        if ($error) return $service;
+        
+        // Legacy API response
+        $formatted_service = $service;
+        $currency = isset($formatted_service->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateCurrencyCode) ? $formatted_service->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateCurrencyCode : '';
+        $monetary_value = isset($formatted_service->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue) ? $formatted_service->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue : 0;
+
+        // New API response
+        $currency = isset($formatted_service->RateResponse->RatedShipment->TotalCharges->CurrencyCode) ? $formatted_service->RateResponse->RatedShipment->TotalCharges->CurrencyCode : $currency;
+        $monetary_value = isset($formatted_service->RateResponse->RatedShipment->TotalCharges->MonetaryValue) ? $formatted_service->RateResponse->RatedShipment->TotalCharges->MonetaryValue : $monetary_value;
+
+        $formatted_service = (object)[
+            'RatedShipment' => (object)[
+                'Service' => (object)[
+                    'Code' => $service_code
+                ],
+                'TotalCharges' => (object)[
+                    'CurrencyCode' => $currency,
+                    'MonetaryValue' => $monetary_value
+                ]
+            ]
+        ];
+
+        return $formatted_service;
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-curl-class.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-curl-class.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-curl-class.php	(revision 3237693)
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Curl Response Class
+ * @package     Woocommerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Eniture UPS Small WooComerce | Curl Response Class
+ */
+class Eniture_UPS_Small_Curl_Request
+{
+
+    /**
+     * Get Curl Response
+     * @param $url
+     * @param $postData
+     * @return string | array
+     */
+    function ups_small_get_curl_response($url, $postData)
+    {
+        if (!empty($url) && !empty($postData)) {
+            $field_string = http_build_query($postData);
+            do_action("eniture_debug_mood", "Build Query (ups small)", $field_string);
+
+
+            $response = wp_remote_post($url, array(
+                    'method' => 'POST',
+                    'timeout' => 60,
+                    'redirection' => 5,
+                    'blocking' => true,
+                    'body' => $field_string,
+                )
+            );
+
+            $output = wp_remote_retrieve_body($response);
+
+            return $output;
+        }
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-group-package.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-group-package.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-group-package.php	(revision 3237693)
@@ -0,0 +1,1146 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Get Shipping Package Class
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * UPS Small WooComerce |  Get Shipping Package Class
+ */
+class Eniture_UPS_Small_Shipping_Get_Package
+{
+
+    public $hasLTLShipment = 0;
+    public $errors = [];
+    public $order_details;
+
+    // Micro Warehouse
+    public $products = [];
+    public $dropship_location_array = [];
+    public $warehouse_products = [];
+    public $destination_Address_ups_small;
+    public $origin = [];
+    public $shipping_rule_object;
+    // Images for FDO
+    public $en_fdo_image_urls = [];
+    private $is_dest_country_matched = false;
+    private $is_country_filter_applied = false;
+    private $is_restrict_service_rule_applied = false;
+
+    public function __construct()
+    {
+        $this->is_dest_country_matched = false;
+        $this->is_country_filter_applied = false;
+        $this->is_restrict_service_rule_applied = false;
+    }
+
+    /**
+     * Grouping For Shipments
+     * @param $package
+     * @param $ups_small_res_inst
+     * @param $freight_zipcode
+     * @return Shipment Grouped Array
+     */
+    function group_ups_small_shipment($package, $ups_small_res_inst, $freight_zipcode)
+    {
+        if (empty($freight_zipcode)) {
+            return [];
+        }
+
+        if (isset($package['sPackage']) && !empty($package['sPackage'])) {
+            return $package['sPackage'];
+        }
+
+        $wc_settings_wwe_ignore_items = get_option("en_ignore_items_through_freight_classification");
+        $en_get_current_classes = strlen($wc_settings_wwe_ignore_items) > 0 ? trim(strtolower($wc_settings_wwe_ignore_items)) : '';
+        $en_get_current_classes_arr = strlen($en_get_current_classes) > 0 ? array_map('trim', explode(',', $en_get_current_classes)) : [];
+
+        $pStatus = (isset($package['itemType']) && !empty($package['itemType'])) ? $package['itemType'] : "";
+        $ups_small_woo_obj = new Eniture_UPS_Small_Woo_Update_Changes();
+        $sm_zipcode = $ups_small_woo_obj->ups_small_postcode();
+        $ups_small_package = [];
+
+        // Micro Warehouse
+        $UPS_Get_Shipping_Quotes = new Eniture_UPS_Get_Shipping_Quotes();
+        $this->destination_Address_ups_small = $UPS_Get_Shipping_Quotes->destinationAddressUpsSmall();
+        // threshold
+        $weight_threshold = get_option('en_weight_threshold_lfq');
+        $weight_threshold = isset($weight_threshold) && $weight_threshold > 0 ? $weight_threshold : 150;
+
+        $flat_rate_shipping_addon = apply_filters('en_add_flat_rate_shipping_addon', false);
+
+        $shipment_weight_arr = [];
+
+        if (isset($package['contents'])) {
+            $pack = $package['contents'];
+            foreach ($pack as $item_id => $values) {
+                $_product = $values['data'];
+
+                // Images for FDO
+                $this->en_fdo_image_urls($values, $_product);
+
+                // Flat rate pricing
+                $product_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+                $en_flat_rate_price = $this->en_get_flat_rate_price($values, $_product);
+                if ($flat_rate_shipping_addon && isset($en_flat_rate_price) && strlen($en_flat_rate_price) > 0) {
+                    continue;
+                }
+
+               $shipping_class = $this->ups_small_check_freight_class($_product);
+              // free shipping
+                if ($shipping_class == 'free-shipping-et') {
+                   continue;
+                }
+                // Flat shipping
+                $en_fs_existence = apply_filters('en_fs_existence', false);
+                $fs = get_post_meta($product_id, '_enable_fs', true);
+                if ($en_fs_existence && $fs == 'yes') {
+                    continue;
+                }
+
+                // Get product shipping class
+                $en_ship_class = !empty($shipping_class) ? strtolower($shipping_class) : '';
+                if (in_array($en_ship_class, $en_get_current_classes_arr)) {
+                    continue;
+                }
+
+                // Shippable handling units
+                $values = apply_filters('en_shippable_handling_units_request', $values, $values, $_product);
+                $shippable = [];
+                if (isset($values['shippable']) && !empty($values['shippable'])) {
+                    $shippable = $values['shippable'];
+                }
+
+                $nestedPercentage = 0;
+                $nestedDimension = "";
+                $nestedItems = "";
+                $StakingProperty = "";
+
+                $locationId = 0;
+                $small_err = 0;
+                $exceedWeight = get_option('en_plugins_return_LTL_quotes');
+
+                $dimension_unit = get_option('woocommerce_dimension_unit');
+                // convert product dimensions in feet, centimeter, miles, kilometer into Inches
+                if ($dimension_unit == 'ft' || $dimension_unit == 'cm' || $dimension_unit == 'mi' || $dimension_unit == 'km') {
+
+                    $dimensions = $this->dimensions_conversion($_product);
+                    $height = $dimensions['height'];
+                    $width = $dimensions['width'];
+                    $length = $dimensions['length'];
+                } else {
+                    $p_height = str_replace( array( "'",'"' ),'',$_product->get_height());
+					$p_width = str_replace( array( "'",'"' ),'',$_product->get_width());
+					$p_length = str_replace( array( "'",'"' ),'',$_product->get_length());
+                    $p_height = is_numeric($p_height) ? $p_height : 0;
+                    $p_width = is_numeric($p_width) ? $p_width : 0;
+                    $p_length = is_numeric($p_length) ? $p_length : 0;
+					$height = wc_get_dimension($p_height, 'in');
+					$width = wc_get_dimension($p_width, 'in');
+					$length = wc_get_dimension($p_length, 'in');
+                }
+
+                /**
+                 * These are the custom hooks of stovil.com (Hunter) to get dynamic dimensions and weight.
+                */
+                $height = apply_filters('en_filter_product_height', $height, $item_id);
+                $width = apply_filters('en_filter_product_width', $width, $item_id);
+                $length = apply_filters('en_filter_product_length', $length, $item_id);
+
+                $height = (strlen($height) > 0) ? $height : "0";
+                $width = (strlen($width) > 0) ? $width : "0";
+                $length = (strlen($length) > 0) ? $length : "0";
+
+                $product_weight = apply_filters('en_filter_product_weight', wc_get_weight($_product->get_weight(), 'lbs'), $item_id);
+
+                $dimensions = $length * $width * $height;
+                $weight = ((float)$product_weight * (float)$values['quantity']);
+                // Mutiple packages
+                $en_multiple_package = $this->en_multiple_package($values, $_product);
+
+                $freight_enable_class = $this->ups_small_check_freight_class($_product);
+                $locations_list = $this->ups_small_origin_address($values, $_product);
+                $origin_address = $ups_small_res_inst->ups_small_multi_warehouse($locations_list, $freight_zipcode);
+                // preferred origin
+                if (is_plugin_active('preferred-origin/preferred-origin.php')) {
+                    $origin_address = apply_filters('en_selection_of_locations', $origin_address['zip'], 'ups_small');
+                    if (empty($origin_address) || empty($origin_address['zip'])) {
+                        continue;
+                    }
+                }
+
+                $product_level_markup = $this->ups_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity']);
+
+                $locationId = (isset($origin_address['locationId'])) ? $origin_address['locationId'] : '';
+                $locationZip = (isset($origin_address['zip'])) ? $origin_address['zip'] : '';
+                $locationId = $locationZip;
+
+                $shipment_weight_arr[$locationId] = (isset($shipment_weight_arr[$locationId])) ? $shipment_weight_arr[$locationId] + $weight : $weight;
+                $ptype = $this->ups_small_check_product_type($freight_enable_class, $exceedWeight, $product_weight, $en_multiple_package, $shipment_weight_arr[$locationId]);
+                // Micro Warehouse
+                (isset($values['variation_id']) && $values['variation_id'] > 0) ? $post_id = $values['variation_id'] : $post_id = $_product->get_id();
+                $this->products[] = $post_id;
+
+                if (in_array($en_ship_class, $en_get_current_classes_arr) && ($ptype == 'ltl' || $ptype != 'ltl')) {
+                    $ptype = 'ignored_items';
+                }
+
+                if (isset($ups_small_package[$locationId]['is_ignored_items']) && $ups_small_package[$locationId]['is_ignored_items'] == 'ignored_items') {
+                    $ups_small_package[$locationId]['is_ignored_items'] = 'ignored_items';
+                } else {
+                    $ups_small_package[$locationId]['is_ignored_items'] = $ptype;
+                }
+
+                if (isset($ups_small_package[$locationId]['is_shipment']) && $ups_small_package[$locationId]['is_shipment'] == 'ltl') {
+                    $ups_small_package[$locationId]['is_shipment'] = 'ltl';
+                } else {
+                    $ups_small_package[$locationId]['is_shipment'] = $ptype;
+                }
+
+                if (!empty($origin_address) && ($product_weight <= $weight_threshold || $en_multiple_package == 'yes') && !in_array($en_ship_class, $en_get_current_classes_arr)) {
+
+                    // Nested Material
+                    $nested_material = $this->en_nested_material($values, $_product);
+                    if ($nested_material == "yes") {
+                        $post_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+                        $nestedPercentage = get_post_meta($post_id, '_nestedPercentage', true);
+                        $nestedDimension = get_post_meta($post_id, '_nestedDimension', true);
+                        $nestedItems = get_post_meta($post_id, '_maxNestedItems', true);
+                        $StakingProperty = get_post_meta($post_id, '_nestedStakingProperty', true);
+                    }
+
+                    $ups_small_package[$locationId]['origin'] = $origin_address;
+                    $ups_small_package[$locationId]['origin']['ptype'] = $ptype;
+
+                    $hazardous_material = $this->en_hazardous_material($values, $_product);
+                    $hm_plan = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'hazardous_material');
+                    $hm_status = (!is_array($hm_plan) && $hazardous_material == 'yes') ? TRUE : FALSE;
+
+                    // Shippable handling units
+                    $ship_item_alone = '0';
+                    extract($shippable);
+
+                    $product_title = str_replace(array("'", '"'), '', $_product->get_title());
+                    $parent_id = $_product->get_id();
+                    if (isset($values['variation_id']) && $values['variation_id'] > 0) {
+                        $variation = wc_get_product($values['variation_id']);
+                        $parent_id = $variation->get_parent_id();
+                        $product_title = $variation->get_name();
+                    }
+
+                    $product_title = is_string($product_title) && !empty($product_title) ? str_replace(array("'", '"'), '', $product_title) : '';
+
+                    $en_items = [
+                        'productId' => $parent_id,
+                        'productName' => $product_title,
+                        'productQty' => $values['quantity'],
+                        'product_name' => $values['quantity'] . " x " . $product_title,
+                        'products' => $product_title,
+                        'productPrice' => $_product->get_price(),
+                        'productWeight' => $product_weight,
+                        'productLength' => $length,
+                        'productWidth' => $width,
+                        'productHeight' => $height,
+                        'ptype' => $ptype,
+                        'nestedMaterial' => $nested_material,
+                        'nestedPercentage' => $nestedPercentage,
+                        'nestedDimension' => $nestedDimension,
+                        'nestedItems' => $nestedItems,
+                        'stakingProperty' => $StakingProperty,
+                        // FDO
+                        'hazardousMaterial' => $hm_status,
+                        'productType' => ($_product->get_type() == 'variation') ? 'variant' : 'simple',
+                        'productSku' => $_product->get_sku(),
+                        'actualProductPrice' => $_product->get_price(),
+                        'attributes' => $_product->get_attributes(),
+                        'variantId' => ($_product->get_type() == 'variation') ? $_product->get_id() : '',
+                        'hazmat' => $hazardous_material,
+
+                        // Shippable handling units
+                        'ship_item_alone' => $ship_item_alone,
+
+                        'markup' => $product_level_markup
+                    ];
+
+                    // Hook for flexibility adding to package
+                    $en_items = apply_filters('en_group_package', $en_items, $values, $_product);
+
+                    // Micro Warehouse
+                    $items[$post_id] = $en_items;
+
+                    if (!$_product->is_virtual()) {
+                        $_product = $values['data'];
+                        $ups_small_package[$locationId]['items'][] = $en_items;
+                    }
+
+                    // Hazardous Material
+                    if ($hazardous_material == "yes" && !isset($ups_small_package[$locationId]['hazardous_material'])) {
+                        $ups_small_package[$locationId]['hazardous_material'] = TRUE;
+                    }
+
+                    // Except Ground Transit
+                    $exempt_ground_transit_restriction = $this->exempt_ground_transit_restriction($values, $_product);
+                    if($exempt_ground_transit_restriction == 'yes' && !isset($ups_small_package[$locationId]['exempt_ground_transit_restriction'])){
+                        $ups_small_package[$locationId]['exempt_ground_transit_restriction'] = 1;
+                    }
+
+                    $insurance = $this->en_insurance_checked($values, $_product);
+                    if($insurance == 'yes' && !isset($ups_small_package[$locationId]['is_shipment_insure'])){
+                        $ups_small_package[$locationId]['is_shipment_insure'] = 1;
+                    }
+
+                    // Product tags
+                    $product_tags = get_the_terms($product_id, 'product_tag');
+                    $product_tags = empty($product_tags) ? get_the_terms($parent_id, 'product_tag') : $product_tags;
+                    if (!empty($product_tags)) {
+                        $product_tag_names = array_map(function($tag) { return $tag->term_id; }, $product_tags);
+
+                        if (isset($ups_small_package[$locationId]['product_tags'])) {
+                            $ups_small_package[$locationId]['product_tags'] = array_merge($ups_small_package[$locationId]['product_tags'], $product_tag_names);
+                        } else {
+                            $ups_small_package[$locationId]['product_tags'] = $product_tag_names;
+                        }
+                    } else {
+                        $ups_small_package[$locationId]['product_tags'] = [];
+                    }
+
+                    // Product quantity
+                    if (isset($ups_small_package[$locationId]['product_quantities'])) {
+                        $ups_small_package[$locationId]['product_quantities'] += floatval($values['quantity']);
+                    } else {
+                        $ups_small_package[$locationId]['product_quantities'] = floatval($values['quantity']);
+                    }
+
+                    // Product price
+                    if (isset($ups_small_package[$locationId]['product_prices'])) {
+                        $ups_small_package[$locationId]['product_prices'] += (floatval($_product->get_price()) * floatval($values['quantity']));
+                    } else {
+                        $ups_small_package[$locationId]['product_prices'] = (floatval($_product->get_price()) * floatval($values['quantity']));
+                    }
+                }
+
+                // Micro Warehouse
+                $items_shipment[$post_id] = $ptype == 'ltl' ? true : false;
+
+                if ($pStatus == '' && $ptype == 'ltl') {
+                    return $ups_small_package = [];
+                }
+
+                if ($dimensions == 0 && $product_weight == 0) {
+                    $ups_small_package[$locationId]['no_parameter'] = 'NOPARAM';
+                }
+
+                if ($locationId > 0) {
+                    $ups_small_package[$locationId]['shipment_weight'] = isset($ups_small_package[$locationId]['shipment_weight']) ? $ups_small_package[$locationId]['shipment_weight'] + $weight : $weight;
+                }
+                if ((isset($ups_small_package[$locationId]['is_ignored_items']) &&
+                        $ups_small_package[$locationId]['is_ignored_items'] == 'ignored_items') && !isset($ups_small_package[$locationId]['items'])) {
+                    unset($ups_small_package[$locationId]);
+                }
+            }
+
+            do_action("eniture_debug_mood", "Ups Small Quotes Request", $ups_small_package);
+
+            $smallPluginExist = 0;
+            $calledMethod = [];
+            $eniturePluigns = json_decode(get_option('EN_Plugins'));
+            if (!empty($eniturePluigns)) {
+                foreach ($eniturePluigns as $enIndex => $enPlugin) {
+
+                    $freightSmallClassName = 'WC_' . $enPlugin;
+
+                    if (!in_array($freightSmallClassName, $calledMethod)) {
+
+                        if (class_exists($freightSmallClassName)) {
+                            $smallPluginExist = 1;
+                        }
+
+                        $calledMethod[] = $freightSmallClassName;
+                    }
+                }
+            }
+
+            // Micro Warehouse
+            $eniureLicenceKey = get_option('ups_small_licence_key');
+            $ups_small_package = apply_filters('en_micro_warehouse', $ups_small_package, $this->products, $this->dropship_location_array, $this->destination_Address_ups_small, $this->origin, 1, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'ups_small');
+            return $ups_small_package;
+        }
+        return [];
+    }
+
+    /**
+     *  Get the product multiple package checkbox value.
+     */
+    public function en_multiple_package($product_object, $product_detail)
+    {
+        $post_id = (isset($product_object['variation_id']) && $product_object['variation_id'] > 0) ? $product_object['variation_id'] : $product_detail->get_id();
+        return get_post_meta($post_id, '_en_multiple_packages', true);
+    }
+
+    /**
+     * Set images urls | Images for FDO
+     * @param array type $en_fdo_image_urls
+     * @return array type
+     */
+    public function en_fdo_image_urls_merge($en_fdo_image_urls)
+    {
+        return array_merge($this->en_fdo_image_urls, $en_fdo_image_urls);
+    }
+
+    /**
+     * Get images urls | Images for FDO
+     * @param array type $values
+     * @param array type $_product
+     * @return array type
+     */
+    public function en_fdo_image_urls($values, $_product)
+    {
+        $product_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+        $gallery_image_ids = $_product->get_gallery_image_ids();
+        foreach ($gallery_image_ids as $key => $image_id) {
+            $gallery_image_ids[$key] = $image_id > 0 ? wp_get_attachment_url($image_id) : '';
+        }
+
+        $image_id = $_product->get_image_id();
+        $this->en_fdo_image_urls[$product_id] = [
+            'product_id' => $product_id,
+            'image_id' => $image_id > 0 ? wp_get_attachment_url($image_id) : '',
+            'gallery_image_ids' => $gallery_image_ids
+        ];
+
+        add_filter('en_fdo_image_urls_merge', [$this, 'en_fdo_image_urls_merge'], 10, 1);
+    }
+
+    /**
+     * Nested Material
+     * @param array type $values
+     * @param array type $_product
+     * @return string type
+     */
+    function en_nested_material($values, $_product)
+    {
+        $post_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+        return get_post_meta($post_id, '_nestedMaterials', true);
+    }
+
+    /**
+     * Get Enabled Shipping Class Of Product
+     * @param $_product
+     * @return string Shipping Class
+     */
+    function ups_small_check_freight_class($_product)
+    {
+        if ($_product->get_type() == 'variation') {
+            $ship_class_id = $_product->get_shipping_class_id();
+
+            if ($ship_class_id == 0) {
+                $parent_data = $_product->get_parent_data();
+                $get_parent_term = get_term_by('id', $parent_data['shipping_class_id'], 'product_shipping_class');
+                $freight_enable_class = (isset($get_parent_term->slug)) ? $get_parent_term->slug : "";
+            } else {
+                $freight_enable_class = $_product->get_shipping_class();
+            }
+        } else {
+            $freight_enable_class = $_product->get_shipping_class();
+        }
+
+        return $freight_enable_class;
+    }
+
+    /**
+     * Check Product Type
+     * @param $freight_enable_class
+     * @param $exceedWeight
+     * @param $weight
+     * @return string
+     */
+    function ups_small_check_product_type($freight_enable_class, $exceedWeight, $weight, $en_multiple_package, $shipment_weight_sum)
+    {
+        $weight_threshold = get_option('en_weight_threshold_lfq');
+        $only_show_ltl_rates = get_option('en_only_show_ltl_rates_when_weight_exceeds');
+
+        $weight_threshold = isset($weight_threshold) && $weight_threshold > 0 ? $weight_threshold : 150;
+        if ($freight_enable_class == 'ltl_freight' || $freight_enable_class == 'ltl-freight') {
+            $ptype = 'ltl';
+        } else if ($exceedWeight == 'yes'
+        && ( ($weight > $weight_threshold && $en_multiple_package != 'yes') || (!empty($only_show_ltl_rates) && $only_show_ltl_rates == 'yes' && $shipment_weight_sum > $weight_threshold) )) {
+            $ptype = 'ltl';
+        } else {
+            $ptype = 'small';
+        }
+
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "Quotes Product Type (UPS Small)", $ptype);
+
+        return $ptype;
+    }
+
+    /**
+     * Hazardous Material in Product Detail page
+     * @param array $values
+     * @param array|object $_product
+     * @return string
+     */
+    function en_hazardous_material($values, $_product)
+    {
+        $post_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+        return get_post_meta($post_id, '_hazardousmaterials', true);
+    }
+
+    /**
+     *
+     * @param array $values
+     * @param array|object $_product
+     * @return string
+     */
+    function en_insurance_checked($values, $_product)
+    {
+        $post_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+        return get_post_meta($post_id, '_en_insurance_fee', true);
+    }
+
+    /**
+     * Get Origin Address
+     * @param $values
+     * @param $_product
+     * @return Origin Address List
+     * @global $wpdb
+     */
+    function ups_small_origin_address($values, $_product)
+    {
+        global $wpdb;
+        $locations_list = [];
+        (isset($values['variation_id']) && $values['variation_id'] > 0) ? $post_id = $values['variation_id'] : $post_id = $_product->get_id();
+        $enable_dropship = get_post_meta($post_id, '_enable_dropship', true);
+        if ($enable_dropship == 'yes') {
+            $get_loc = get_post_meta($post_id, '_dropship_location', true);
+            if ($get_loc == '') {
+                // Micro Warehouse
+                $this->warehouse_products[] = $post_id;
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Quotes Dropship Location (UPS Small)", array('error' => 'UPS Small dropship location not found!'));
+
+                return array('error' => 'UPS Small dropship location not found!');
+            }
+
+            // Multi Dropship
+            $multi_dropship = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'multi_dropship');
+
+            if (is_array($multi_dropship)) {
+                $locations_list = $wpdb->get_results(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE location = 'dropship' LIMIT 1"
+                );
+            } else {
+                $get_loc = ($get_loc !== '') ? maybe_unserialize($get_loc) : $get_loc;
+                $get_loc = is_array($get_loc) ? implode(" ', '", $get_loc) : $get_loc;
+                $locations_list = $wpdb->get_results(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE id IN ('" . $get_loc . "')"
+                );
+            }
+
+            if (empty($locations_list)) {
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Quotes Dropship Location (UPS Small)", array('error' => 'UPS Small dropship location not found!'));
+            }
+
+            // Micro Warehouse
+            $this->multiple_dropship_of_prod($locations_list, $post_id);
+            $eniture_debug_name = "Dropships";
+        }
+        if (empty($locations_list)) {
+            $multi_warehouse = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'multi_warehouse');
+            if (is_array($multi_warehouse)) {
+                $locations_list = $wpdb->get_results(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE location = 'warehouse' LIMIT 1"
+                );
+            } else {
+                $locations_list = $wpdb->get_results(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE location = 'warehouse'"
+                );
+            }
+
+            // Micro Warehouse
+            $this->warehouse_products[] = $post_id;
+            $eniture_debug_name = "Warehouses";
+        }
+
+        do_action("eniture_debug_mood", "Quotes $eniture_debug_name (ups small)", $locations_list);
+        return $locations_list;
+    }
+
+    // Micro Warehouse
+    public function multiple_dropship_of_prod($locations_list, $post_id)
+    {
+        $post_id = (string)$post_id;
+
+        foreach ($locations_list as $key => $value) {
+            $dropship_data = $this->address_array($value);
+
+            $this->origin["D" . $dropship_data['zip']] = $dropship_data;
+            if (!isset($this->dropship_location_array["D" . $dropship_data['zip']]) || !in_array($post_id, $this->dropship_location_array["D" . $dropship_data['zip']])) {
+                $this->dropship_location_array["D" . $dropship_data['zip']][] = $post_id;
+            }
+        }
+
+    }
+
+    // Micro Warehouse
+    public function address_array($value)
+    {
+        $dropship_data = [];
+
+        $dropship_data['locationId'] = (isset($value->id)) ? $value->id : "";
+        $dropship_data['zip'] = (isset($value->zip)) ? $value->zip : "";
+        $dropship_data['city'] = (isset($value->city)) ? $value->city : "";
+        $dropship_data['state'] = (isset($value->state)) ? $value->state : "";
+        // Origin terminal address
+        $dropship_data['address'] = (isset($value->address)) ? $value->address : "";
+        // Terminal phone number
+        $dropship_data['phone_instore'] = (isset($value->phone_instore)) ? $value->phone_instore : "";
+        $dropship_data['location'] = (isset($value->location)) ? $value->location : "";
+        $dropship_data['country'] = (isset($value->country)) ? $value->country : "";
+        $dropship_data['enable_store_pickup'] = (isset($value->enable_store_pickup)) ? $value->enable_store_pickup : "";
+        $dropship_data['fee_local_delivery'] = (isset($value->fee_local_delivery)) ? $value->fee_local_delivery : "";
+        $dropship_data['suppress_local_delivery'] = (isset($value->suppress_local_delivery)) ? $value->suppress_local_delivery : "";
+        $dropship_data['miles_store_pickup'] = (isset($value->miles_store_pickup)) ? $value->miles_store_pickup : "";
+        $dropship_data['match_postal_store_pickup'] = (isset($value->match_postal_store_pickup)) ? $value->match_postal_store_pickup : "";
+        $dropship_data['checkout_desc_store_pickup'] = (isset($value->checkout_desc_store_pickup)) ? $value->checkout_desc_store_pickup : "";
+        $dropship_data['enable_local_delivery'] = (isset($value->enable_local_delivery)) ? $value->enable_local_delivery : "";
+        $dropship_data['miles_local_delivery'] = (isset($value->miles_local_delivery)) ? $value->miles_local_delivery : "";
+        $dropship_data['match_postal_local_delivery'] = (isset($value->match_postal_local_delivery)) ? $value->match_postal_local_delivery : "";
+        $dropship_data['checkout_desc_local_delivery'] = (isset($value->checkout_desc_local_delivery)) ? $value->checkout_desc_local_delivery : "";
+
+        $dropship_data['sender_origin'] = $dropship_data['location'] . ": " . $dropship_data['city'] . ", " . $dropship_data['state'] . " " . $dropship_data['zip'];
+
+        return $dropship_data;
+    }
+
+    /**
+     * @param type object
+     * @return type array
+     */
+    function dimensions_conversion($_product)
+    {
+
+        $dimension_unit = get_option('woocommerce_dimension_unit');
+        $dimensions = [];
+        $height = is_numeric($_product->get_height()) ? $_product->get_height() : 0;
+        $width = is_numeric($_product->get_width()) ? $_product->get_width() : 0;
+        $length = is_numeric($_product->get_length()) ? $_product->get_length() : 0;
+        switch ($dimension_unit) {
+
+            case 'ft':
+                $dimensions['height'] = round($height * 12, 2);
+                $dimensions['width'] = round($width * 12, 2);
+                $dimensions['length'] = round($length * 12, 2);
+                break;
+
+            case 'cm':
+                $dimensions['height'] = round($height * 0.3937007874, 2);
+                $dimensions['width'] = round($width * 0.3937007874, 2);
+                $dimensions['length'] = round($length * 0.3937007874, 2);
+                break;
+
+            case 'mi':
+                $dimensions['height'] = round($height * 63360, 2);
+                $dimensions['width'] = round($width * 63360, 2);
+                $dimensions['length'] = round($length * 63360, 2);
+                break;
+
+            case 'km':
+                $dimensions['height'] = round($height * 39370.1, 2);
+                $dimensions['width'] = round($width * 39370.1, 2);
+                $dimensions['length'] = round($length * 39370.1, 2);
+                break;
+        }
+
+        return $dimensions;
+    }
+
+    /**
+    * Returns product level markup
+    */
+    function ups_small_get_product_level_markup($_product, $variation_id, $product_id, $quantity)
+    {
+        $product_level_markup = 0;
+
+            if ($_product->get_type() == 'variation') {
+                $product_level_markup = get_post_meta($variation_id, '_en_product_markup_variation', true);
+                if(empty($product_level_markup) || $product_level_markup == 'get_parent'){
+                    $product_level_markup = get_post_meta($_product->get_id(), '_en_product_markup', true);
+                }
+            } else {
+                $product_level_markup = get_post_meta($_product->get_id(), '_en_product_markup', true);
+            }
+
+            if (empty($product_level_markup)) {
+                $product_level_markup = get_post_meta($product_id, '_en_product_markup', true);
+            }
+
+            if (!empty($product_level_markup) && strpos($product_level_markup, '%') === false
+            && is_numeric($product_level_markup) && is_numeric($quantity))
+            {
+                $product_level_markup *= $quantity;
+            } else if(!empty($product_level_markup) && strpos($product_level_markup, '%') > 0 && is_numeric($quantity)){
+                $position = strpos($product_level_markup, '%');
+                $first_str = substr($product_level_markup, $position);
+                $arr = explode($first_str, $product_level_markup);
+                $percentage_value = $arr[0];
+                $product_price = $_product->get_price();
+
+                if (!empty($product_price)) {
+                    $product_level_markup = $percentage_value / 100 * ($product_price * $quantity);
+                } else {
+                    $product_level_markup = 0;
+                }
+            }
+
+            return $product_level_markup;
+    }
+
+    /**
+     * Check except transit time restriction
+     * @param array $values
+     * @param array|object $_product
+     * @return string
+     */
+    function exempt_ground_transit_restriction($values, $_product)
+    {
+        $post_id = (isset($values['variation_id']) && $values['variation_id'] > 0) ? $values['variation_id'] : $_product->get_id();
+        return get_post_meta($post_id, '_en_exempt_ground_transit_restriction', true);
+    }
+
+    /**
+     * Returns flat rate price and quantity
+     */
+    function en_get_flat_rate_price($values, $_product)
+    {
+        if ($_product->get_type() == 'variation') {
+            $flat_rate_price = get_post_meta($values['variation_id'], 'en_flat_rate_price', true);
+            if (strlen($flat_rate_price) < 1) {
+                $flat_rate_price = get_post_meta($values['product_id'], 'en_flat_rate_price', true);
+            }
+        } else {
+            $flat_rate_price = get_post_meta($_product->get_id(), 'en_flat_rate_price', true);
+        }
+
+        return $flat_rate_price;
+    }
+
+    function apply_shipping_rules($ups_small_package, $apply_on_rates = false, $rates = [])
+    {
+        if (empty($ups_small_package)) return $apply_on_rates ? $rates : false;
+
+        global $wpdb;
+        $rules = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"), ARRAY_A);
+
+        if (empty($rules)) return $apply_on_rates ? $rates : false;
+
+        $is_rule_applied = false;
+        $rule_types = ['override_rates' => 'Override Rates', 'hide_methods' => 'Hide Methods', 'restrict_to_state' => 'Restrict To State', 'hide_methods_by_origin' => 'Hide Methods By Origin', 'minimum_shipping_charge' => 'Minimum Shipping Charge'];
+
+        foreach ($rules as $rule) {
+            if (!$rule['is_active']) continue;
+
+            $settings = isset($rule['settings']) ? json_decode($rule['settings'], true) : [];
+            if (empty($settings)) continue;
+
+            $rule_type = isset($rule['type']) ? $rule['type'] : '';
+            $rule_name = isset($rule['name']) ? $rule['name'] : '';
+
+            if ($rule_type == $rule_types['override_rates'] && $apply_on_rates) {
+                $rates = $this->apply_override_rates_rule($ups_small_package, $settings, $rates, $rule_name);
+            } else if ($rule_type == $rule_types['hide_methods']) {
+                $is_rule_applied = $this->apply_rule($settings, $ups_small_package);
+                if ($is_rule_applied) break;
+            } else if ($rule_type == $rule_types['restrict_to_state'] && $apply_on_rates) {
+                $rates = $this->apply_restrict_to_state_rule($ups_small_package, $settings, $rates);
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Restrict To State Rule Updated Rates: {$rule_name}", wp_json_encode($rates));
+            } else if ($rule_type == $rule_types['hide_methods_by_origin'] && $apply_on_rates) {
+                $rates = $this->apply_hide_methods_by_origin_rule($settings, $rates);
+            } else if ($rule_type == $rule_types['minimum_shipping_charge'] && $apply_on_rates) {
+                $rates = $this->apply_minimum_shipping_charge_rule($ups_small_package, $settings, $rates, $rule_name);
+            }
+        }
+
+        return $apply_on_rates ? $rates : $is_rule_applied;
+    }
+
+    function apply_rule($settings, $ups_small_package)
+    {
+        $is_rule_applied = false;
+
+        if ($settings['apply_to'] == 'cart') {
+            $formatted_values = $this->get_formatted_values($ups_small_package);
+            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+        } else {
+            foreach ($ups_small_package as $key => $pkg) {
+                $is_rule_applied = false;
+                $shipments = [];
+                $shipments[$key] = $pkg;
+
+                $formatted_values = $this->get_formatted_values($shipments);
+                $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+
+                if ($is_rule_applied) break;
+            }
+        }
+
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "UPS Small Hide Methods Rule Applied", $is_rule_applied ? 'Yes' : 'No');
+
+        return $is_rule_applied;
+    }
+
+    function get_formatted_values($shipments)
+    {
+        $formatted_values = ['weight' => 0, 'price' => 0, 'quantity' => 0, 'tags' => []];
+
+        foreach ($shipments as $pkg) {
+            $formatted_values['weight'] += floatval($pkg['shipment_weight']);
+            $formatted_values['price'] += floatval($pkg['product_prices']);
+            $formatted_values['quantity'] += floatval($pkg['product_quantities']);
+            $formatted_values['tags'] = array_merge($formatted_values['tags'], $pkg['product_tags']);
+        }
+
+        return $formatted_values;
+    }
+
+    function apply_rule_filters($settings, $formatted_values, $restict_service = false, $override_rates = false)
+    {
+        $is_filter_applied = false;
+        $filters = ['weight', 'price', 'quantity'];
+        // Add restrict service filters in case of restrict to state rule
+        $filters = ($restict_service || $override_rates) ? array_merge(['country'], $filters) : $filters;
+
+        // Check if any of the filter is checked
+        $filters_checks = ['filter_by_weight', 'filter_by_price', 'filter_by_quantity', 'filter_by_product_tag', 'filter_by_country', 'filter_by_state', 'filter_by_country_or', 'filter_by_state_or'];
+        $any_filter_checked = false;
+        foreach ($filters_checks as $check) {
+            if (isset($settings[$check]) && filter_var($settings[$check], FILTER_VALIDATE_BOOLEAN)) {
+                $any_filter_checked = true;
+                break;
+            }
+        }
+
+        // If there is no filter check, then all rules will meet so rule will be treated as applied
+        if (!$any_filter_checked) {
+            return true;
+        }
+
+        $destination_address = (new Eniture_UPS_Get_Shipping_Quotes())->destinationAddressUpsSmall();
+
+        foreach ($filters as $filter) {
+            $override_rate_filter = isset($settings['filter_by_' . $filter . '_or']) ? filter_var($settings['filter_by_' . $filter . '_or'], FILTER_VALIDATE_BOOLEAN) : false;
+
+            if (filter_var($settings['filter_by_' . $filter], FILTER_VALIDATE_BOOLEAN) || $override_rate_filter) {
+                if ($filter == 'country') {
+                    $destination_country = isset($destination_address['country']) ? $destination_address['country'] : '';
+                    $filter_by_country = $override_rate_filter ? 'filter_by_country_value_or' : 'filter_by_country_value';
+                    $this->is_dest_country_matched = $this->is_country_matched($settings[$filter_by_country], $destination_country);
+                    $is_filter_applied = $this->is_dest_country_matched;
+                    $this->is_country_filter_applied = true;
+
+                    $filter_by_state = $override_rate_filter ? 'filter_by_state_or' : 'filter_by_state';
+                    $filter_by_state_value = $override_rate_filter ? 'filter_by_state_value_or' : 'filter_by_state_value';
+
+                    if ($is_filter_applied && filter_var($settings[$filter_by_state], FILTER_VALIDATE_BOOLEAN)) {
+                        $destination_state = isset($destination_address['state']) ? $destination_address['state'] : '';
+                        $states = isset($settings[$filter_by_state_value]) ? $settings[$filter_by_state_value] : [];
+                        $is_filter_applied = $this->is_dest_country_matched = in_array($destination_state, $states);
+                    }
+                } else {
+                    $is_filter_applied = $formatted_values[$filter] >= $settings['filter_by_' . $filter . '_from'];
+                    if ($is_filter_applied && !empty($settings['filter_by_' . $filter . '_to'])) {
+                        $is_filter_applied = $formatted_values[$filter] < $settings['filter_by_' . $filter . '_to'];
+                    }
+                }
+            }
+
+            if ($is_filter_applied) break;
+        }
+
+        if (filter_var($settings['filter_by_product_tag'], FILTER_VALIDATE_BOOLEAN) && !$is_filter_applied) {
+            $product_tags = $settings['filter_by_product_tag_value'];
+            $tags_check = array_filter($product_tags, function ($tag) use ($formatted_values) {
+                return in_array($tag, $formatted_values['tags']);
+            });
+            $is_filter_applied = count($tags_check) > 0;
+        }
+
+        return $is_filter_applied;
+    }
+
+    function apply_override_rates_rule($ups_small_package, $settings, $rates, $rule_name)
+    {
+        $updated_rates = $rates;
+
+        foreach ($ups_small_package as $org_zip => $pkg) {
+            $is_rule_applied = false;
+            $this->is_country_filter_applied = false;
+            $this->is_dest_country_matched = false;
+            $shipments = [];
+            $org_zip = isset($pkg['zip']) ? $pkg['zip'] : $org_zip;
+            $shipments[$org_zip] = $pkg;
+
+            $formatted_values = $this->get_formatted_values($shipments);
+            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values, false, true);
+
+            if ($is_rule_applied) {
+                $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, $org_zip, false);
+            };
+        }
+
+        // Eniture debug mode
+        $data = ['rule_name' => $rule_name, 'settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Override Rates Rule Applied: {$rule_name}", $data);
+
+        return $updated_rates;
+    }
+
+    function apply_restrict_to_state_rule($ups_small_package, $settings, $rates)
+    {
+        $this->is_country_filter_applied = false;
+        $this->is_dest_country_matched = false;
+
+        $formatted_values = $this->get_formatted_values($ups_small_package);
+        $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values, true);
+        $this->is_restrict_service_rule_applied = $is_rule_applied;
+
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "UPS Small Restrict To State Rule Applied", $is_rule_applied ? 'Yes' : 'No');
+
+        return ($is_rule_applied || ($this->is_country_filter_applied && !$this->is_dest_country_matched)) ? $this->get_updated_rates($rates, $settings, true, '', false) : $rates;
+    }
+
+    function get_updated_rates($rates, $settings, $restict_service = false, $org_zip = '', $min_shipping_charge = false)
+    {
+        if ($restict_service) {
+            if ($this->is_country_filter_applied && !$this->is_dest_country_matched) {
+                $rates_keys = ['q', 'ups_rate', 'GFP', 'q_92', 'q_93', 'q_94', 'q_95', 'usrg', 'usr2', 'usr1', 'usr3'];
+
+                foreach ($rates as $key => $value) {
+                    foreach ($rates_keys as $rates_key) {
+                        if ($key == $rates_key && isset($rates->$rates_key)) unset($rates->$rates_key);
+                    }
+                }
+            }
+        } else {
+            $this->shipping_rule_object = new Eniture_UpsSmallShippingRulesAjaxReq();
+
+            foreach ($rates as $key => $result) {
+                if ($key != $org_zip && !empty($org_zip)) continue;
+
+                $ups_quotes = (isset($result->q) && !empty($result->q)) ? $result->q : [];
+                $ups_quotes = (empty($ups_quotes) && isset($result->ups_rate) && !empty($result->ups_rate)) ? $result->ups_rate : $ups_quotes;
+                $rates_key = isset($result->q) ? 'q' : '';
+                $rates_key = isset($result->ups_rate) ? 'ups_rate' : $rates_key;
+                $simple_rate_services = ['usrg', 'usr2', 'usr1', 'usr3'];
+
+                if (empty($ups_quotes)) continue;
+
+                foreach ($ups_quotes as $service_key => $val) {
+                    $rate_arr = $this->get_rate_arr($val);
+                    $service_code = isset($settings['service']) ? $settings['service'] : '';
+
+                    // minimum shipping charge settings
+                    $msc_service_exists = false;
+                    if ($min_shipping_charge) {
+                        $services_codes = isset($settings['minimum_shipping_charge_services']) ? $settings['minimum_shipping_charge_services'] : [];
+                        $msc_service_exists = in_array($rate_arr->Service->Code, $services_codes) || in_array($service_key, $services_codes);
+                    }
+
+                    // Replace service rate with new rate defined in the shipping rule
+                    if (isset($rate_arr->Service->Code) && ($rate_arr->Service->Code == $service_code || $msc_service_exists) && $rates_key != '') {
+                        if ($service_key == 'GFP') {
+                            // Legacy API response
+                            if (isset($val->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue)) {
+                                $net_rate = $val->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue;
+                                $rates[$key]->$rates_key->$service_key->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                            }
+
+                            // New API response
+                            if (isset($val->RateResponse->RatedShipment->TotalCharges->MonetaryValue)) {
+                                $net_rate = $val->RateResponse->RatedShipment->TotalCharges->MonetaryValue;
+                                $rates[$key]->$rates_key->$service_key->RateResponse->RatedShipment->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                            }
+
+                            $rates[$key]->$rates_key->$service_key->overrideRate = true;
+                        } else {
+                            if (isset($rate_arr->TotalCharges->MonetaryValue)) {
+                                if (isset($rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+
+                                if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+                            }
+
+                            if (isset($rate_arr->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
+                                if (isset($rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+
+                                if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+                            }
+
+                            if (isset($rate_arr->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
+                                if (isset($rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+
+                                if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                                }
+                            }
+
+                            $rates[$key]->$rates_key->$service_key->overrideRate = true;
+                        }
+                    }
+
+                    // UPS simple rate services
+                    if (in_array($service_key, $simple_rate_services) && ($service_key == $service_code || $msc_service_exists) && $rates_key != '' && isset($val->rate)) {
+                        if ($rates[$key]->$rates_key->$service_key->rate) {
+                            $net_rate = $rates[$key]->$rates_key->$service_key->rate;
+                            $rates[$key]->$rates_key->$service_key->rate = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
+                            $rates[$key]->$rates_key->$service_key->overrideRate = true;
+                        }
+                    }
+                }
+            }
+        }
+
+        return $rates;
+    }
+
+    function is_country_matched($selected_country, $destination_country)
+    {
+        $is_matched = false;
+        $selected_country = strtolower($selected_country);
+        $destination_country = strtolower($destination_country);
+
+        if ($selected_country == $destination_country || ($destination_country == 'usa' && $selected_country == 'us') || ($destination_country == 'can' && $selected_country == 'ca')) {
+            $is_matched = true;
+        }
+
+        return $is_matched;
+    }
+
+    function apply_hide_methods_by_origin_rule($settings, $rates)
+    {
+        $updated_rates = $rates;
+        $origins_to_filter = isset($settings['filter_by_origin_value']) ? $settings['filter_by_origin_value'] : [];
+        $services_to_hide = isset($settings['filter_by_service_value']) ? $settings['filter_by_service_value'] : [];
+
+        // No origins to filter or no services to hide
+        if (empty($origins_to_filter) || empty($services_to_hide)) return $updated_rates;
+
+        $simple_rate_services = ['usrg', 'usr1', 'usr2', 'usr3'];
+
+        foreach ($updated_rates as $org_zip => $rate) {
+            if (!in_array($org_zip, $origins_to_filter)) continue;
+
+            $ups_quotes = (isset($rate->q) && !empty($rate->q)) ? $rate->q : [];
+            $ups_quotes = (empty($ups_quotes) && isset($rate->ups_rate) && !empty($rate->ups_rate)) ? $rate->ups_rate : $ups_quotes;
+            $rates_key = isset($rate->q) ? 'q' : '';
+            $rates_key = isset($rate->ups_rate) ? 'ups_rate' : $rates_key;
+
+            if (empty($ups_quotes) || empty($rates_key)) continue;
+
+            foreach ($ups_quotes as $service_key => $val) {
+                $rate_arr = $this->get_rate_arr($val);
+
+                if ((isset($rate_arr->Service->Code) && in_array($rate_arr->Service->Code, $services_to_hide)) || (in_array($service_key, $services_to_hide))) {
+                    unset($updated_rates[$org_zip]->$rates_key->$service_key);
+                }
+
+                // UPS simple rate services
+                if (in_array($service_key, $simple_rate_services) && in_array($service_key, $services_to_hide) && isset($val->rate)) {
+                    unset($updated_rates[$org_zip]->$rates_key->$service_key);
+                }
+            }
+        }
+
+        // Eniture debug mode
+        $data = ['settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Hide Methods By Origin Rule Applied", $data);
+
+        return $updated_rates;
+    }
+
+    function get_rate_arr($val)
+    {
+        $rate_arr = [];
+
+        if (isset($val->Service)) {
+            $rate_arr = $val;
+        } else if(isset($val->RatedShipment)) {
+            $rate_arr = $val->RatedShipment;
+        } else if (isset($val->soapenvBody->rateRateResponse->rateRatedShipment) || isset($val->RateResponse->RatedShipment)) {
+            $rate_arr = isset($val->soapenvBody->rateRateResponse->rateRatedShipment) ? $val->soapenvBody->rateRateResponse->rateRatedShipment : (isset($val->RateResponse->RatedShipment) ? $val->RateResponse->RatedShipment : []);
+
+            if (isset($rate_arr->Service->Code)) {
+                $rate_arr->Service->Code = 'GFP';
+            } else {
+                $rate_arr->Service = (object)['Code' => 'GFP'];
+            }
+        } else if ($val->rate) {
+            $rate_arr = $val;
+        }
+
+        return $rate_arr;
+    }
+
+    function apply_minimum_shipping_charge_rule($ups_small_package, $settings, $rates, $rule_name)
+    {
+        $is_rule_applied = false;
+        $updated_rates = $rates;
+
+        if ($settings['apply_to'] == 'cart') {
+            $formatted_values = $this->get_formatted_values($ups_small_package);
+            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+
+            if ($is_rule_applied) {
+                $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, '', true);
+            }
+        } else {
+            foreach ($ups_small_package as $org_zip => $pkg) {
+                $is_rule_applied = false;
+                $shipments = [];
+                $org_zip = isset($pkg['zip']) ? $pkg['zip'] : $org_zip;
+                $shipments[$org_zip] = $pkg;
+
+                $formatted_values = $this->get_formatted_values($shipments);
+                $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+
+                if ($is_rule_applied) {
+                    $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, $org_zip, true);
+                }
+            }
+        }
+
+        // Eniture debug mode
+        $data = ['rule_name' => $rule_name, 'settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Minimum Shipping Charge Rule Applied", $data);
+
+        return $updated_rates;
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-shipping-class.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-shipping-class.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-shipping-class.php	(revision 3237693)
@@ -0,0 +1,680 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Shipping Calculation
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * UPS Small WooComerce |  Shipping Calculation Method
+ */
+function eniture_ups_small_init()
+{
+    if (!class_exists('WC_ups_small')) {
+
+        /**
+         * UPS Small WooComerce | Shipping Calculation Class
+         */
+        class WC_ups_small extends WC_Shipping_Method
+        {
+
+            public $smpkgFoundErr = array();
+            public $filter_data = array();
+            public $smpkgQuoteErr = array();
+            public $order_detail;
+            public $is_autoresid;
+            public $accessorials;
+            public $helper_obj;
+            public $instore_pickup_and_local_delivery;
+            public $group_small_shipments;
+            public $web_service_inst;
+            public $package_plugin;
+            public $InstorPickupLocalDelivery;
+            public $woocommerce_package_rates;
+            public $quote_settings;
+            public $shipment_type;
+            public $eniture_rates = [];
+            public $VersionCompat;
+            public $en_not_returned_the_quotes = FALSE;
+            public $minPrices = [];
+            // FDO
+            public $en_fdo_meta_data = [];
+            // Virtual Products
+            public $en_fdo_meta_data_third_party = [];
+
+            /**
+             * Woo-commerce Shipping Field Attributes
+             * @param $instance_id
+             */
+            public function __construct($instance_id = 0)
+            {
+                error_reporting(0);
+                $this->id = 'ups_small';
+                $this->helper_obj = new Eniture_Ups_Small_Helper_Class();
+                $this->instance_id = absint($instance_id);
+                $this->method_title = __('UPS', 'small-package-quotes-ups-edition');
+                $this->method_description = __('Parcel rates from UPS.', 'small-package-quotes-ups-edition');
+                $this->supports = array(
+                    'shipping-zones',
+                    'instance-settings',
+                    'instance-settings-modal',
+                );
+                $this->enabled = "yes";
+                $this->title = "Small Package Quotes - UPS Edition";
+                $this->init();
+            }
+
+            /**
+             * Update UPS Small Woo-commerce Shipping Settings
+             */
+            function init()
+            {
+                $this->init_form_fields();
+                $this->init_settings();
+                add_action('woocommerce_update_options_shipping_' . $this->id, array($this, 'process_admin_options'));
+            }
+
+            /**
+             * Enable Woo-commerce Shipping For UPS Small
+             */
+            function init_form_fields()
+            {
+                $this->instance_form_fields = array(
+                    'enabled' => array(
+                        'title' => __('Enable / Disable', 'small-package-quotes-ups-edition'),
+                        'type' => 'checkbox',
+                        'label' => __('Enable This Shipping Service', 'small-package-quotes-ups-edition'),
+                        'default' => 'no',
+                        'id' => 'ups_small_enable_disable_shipping'
+                    )
+                );
+            }
+
+            /**
+             * Virtual Products
+             */
+            public function en_virtual_products()
+            {
+                global $woocommerce;
+                $products = $woocommerce->cart->get_cart();
+                $items = $product_name = [];
+                foreach ($products as $key => $product_obj) {
+                    $product = $product_obj['data'];
+                    $is_virtual = $product->get_virtual();
+
+                    if ($is_virtual == 'yes') {
+                        $attributes = $product->get_attributes();
+                        $product_qty = $product_obj['quantity'];
+                        $product_title = str_replace(array("'", '"'), '', $product->get_title());
+                        $product_name[] = $product_qty . " x " . $product_title;
+
+                        $meta_data = [];
+                        if (!empty($attributes)) {
+                            foreach ($attributes as $attr_key => $attr_value) {
+                                $meta_data[] = [
+                                    'key' => $attr_key,
+                                    'value' => $attr_value,
+                                ];
+                            }
+                        }
+
+                        $items[] = [
+                            'id' => $product_obj['product_id'],
+                            'name' => $product_title,
+                            'quantity' => $product_qty,
+                            'price' => $product->get_price(),
+                            'weight' => 0,
+                            'length' => 0,
+                            'width' => 0,
+                            'height' => 0,
+                            'type' => 'virtual',
+                            'product' => 'virtual',
+                            'sku' => $product->get_sku(),
+                            'attributes' => $attributes,
+                            'variant_id' => 0,
+                            'meta_data' => $meta_data,
+                        ];
+                    }
+                }
+
+                $virtual_rate = [];
+
+                if (!empty($items)) {
+                    $virtual_rate = [
+                        'id' => 'en_virtual_rate',
+                        'label' => 'Virtual Quote',
+                        'cost' => 0,
+                    ];
+
+                    $virtual_fdo = [
+                        'plugin_type' => 'small',
+                        'plugin_name' => 'ups_small',
+                        'accessorials' => '',
+                        'items' => $items,
+                        'address' => '',
+                        'handling_unit_details' => '',
+                        'rate' => $virtual_rate,
+                    ];
+
+                    $meta_data = [
+                        'sender_origin' => 'Virtual Product',
+                        'product_name' => wp_json_encode($product_name),
+                        'en_fdo_meta_data' => $virtual_fdo,
+                    ];
+
+                    $virtual_rate['meta_data'] = $meta_data;
+
+                }
+
+                return $virtual_rate;
+            }
+
+            /**
+             * Multi shipment query
+             * @param array $en_rates
+             * @param string $accessorial
+             */
+            public function en_multi_shipment($en_rates, $accessorial, $origin)
+            {
+                $accessorial .= '_ups_small';
+                $en_rates = (isset($en_rates) && (is_array($en_rates))) ? array_slice($en_rates, 0, 1) : [];
+                $total_cost = array_sum($this->VersionCompat->enArrayColumn($en_rates, 'cost'));
+
+                !$total_cost > 0 ? $this->en_not_returned_the_quotes = TRUE : '';
+
+                $en_rates = !empty($en_rates) ? reset($en_rates) : [];
+                $this->minPrices[$origin] = $en_rates;
+                // FDO
+                $this->en_fdo_meta_data[$origin] = (isset($en_rates['meta_data']['en_fdo_meta_data'])) ? $en_rates['meta_data']['en_fdo_meta_data'] : [];
+
+                if (isset($this->eniture_rates[$accessorial])) {
+                    $this->eniture_rates[$accessorial]['cost'] += $total_cost;
+                } else {
+                    $this->eniture_rates[$accessorial] = [
+                        'id' => $accessorial,
+                        'label' => 'Shipping',
+                        'cost' => $total_cost,
+                        'label_sufex' => str_split($accessorial),
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    ];
+                }
+            }
+
+            /**
+             * Single shipment query
+             * @param array $en_rates
+             * @param string $accessorial
+             */
+            public function en_single_shipment($en_rates, $accessorial, $origin)
+            {
+                $en_rates = isset($en_rates) && is_array($en_rates) ? $en_rates : [];
+                $this->eniture_rates = array_merge($this->eniture_rates, $en_rates);
+            }
+
+            /**
+             * Calculate Shipping Rates For UPS Small
+             * @param $package
+             * @return boolean
+             */
+            public function calculate_shipping($package = array(), $eniture_admin_order_action = false)
+            {
+                if (is_admin() && !wp_doing_ajax() && !$eniture_admin_order_action) {
+                    return [];
+                }
+
+                $this->package_plugin = get_option('ups_small_package');
+
+                $coupn = WC()->cart->get_coupons();
+                if (isset($coupn) && !empty($coupn)) {
+                    $free_shipping = $this->ups_shipping_coupon_rate($coupn);
+                    if ($free_shipping == 'y')
+                        return FALSE;
+                }
+                $label_sufex_arr = array();
+                $ups_small_woo_obj = new Eniture_UPS_Small_Woo_Update_Changes();
+                (strlen(WC()->customer->get_shipping_postcode()) > 0) ? $freight_zipcode = WC()->customer->get_shipping_postcode() : $freight_zipcode = $ups_small_woo_obj->ups_small_postcode();
+                $get_packg_obj = new Eniture_UPS_Small_Shipping_Get_Package();
+                $ups_small_res_inst = new Eniture_UPS_Get_Shipping_Quotes();
+
+                $this->web_service_inst = $ups_small_res_inst;
+                $this->VersionCompat = new Eniture_VersionCompat();
+                $quotes = array();
+
+                $this->ups_get_hazardous_fields();
+
+                // Free shipping
+                if ($this->quote_settings['handling_fee'] == '-100%') {
+                    $rates = array(
+                        'id' => 'ups_small:' . 'free',
+                        'label' => 'Free Shipping',
+                        'cost' => 0,
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+                    $this->add_rate($rates);
+
+                    // Eniture debug mode
+                    do_action("eniture_debug_mood", "Free Shipping (-100% Handling Fee) Applied (UPS Small)", $rates);
+
+                    return [];
+                }
+
+                $ups_small_package = $get_packg_obj->group_ups_small_shipment($package, $ups_small_res_inst, $freight_zipcode);
+
+                // Apply free shipping rule
+                $free_shipping_rate = (new Eniture_UpsSmallShippingRulesAjaxReq())->apply_free_shipping_rule($ups_small_package);
+                if (isset($free_shipping_rate['rates']) && !empty($free_shipping_rate['rates']) && is_array($free_shipping_rate['rates'])) {
+                    $this->add_rate($free_shipping_rate['rates']);
+                    return [];
+                }
+
+                $ups_small_package = isset($free_shipping_rate['package']) ? $free_shipping_rate['package'] : $ups_small_package;
+
+                // Apply hide methods shipping rules
+                $shipping_rules_applied = $get_packg_obj->apply_shipping_rules($ups_small_package);
+                if ($shipping_rules_applied) {
+                    return [];
+                }
+
+                // Suppress small rates when weight threshold is met
+                $supress_parcel_rates = apply_filters('en_suppress_parcel_rates_hook', '');
+                if (!empty($ups_small_package) && is_array($ups_small_package) && $supress_parcel_rates) {
+                    foreach ($ups_small_package as $org_id => $pckg) {
+                        $total_shipment_weight = 0;
+
+                        $shipment_items = !empty($pckg['items']) ? $pckg['items'] : []; 
+                        foreach ($shipment_items as $item) {
+                            $total_shipment_weight += (floatval($item['productWeight']) * $item['productQty']);
+                        }
+
+                        $ups_small_package[$org_id]['shipment_weight'] = $total_shipment_weight;
+                        $weight_threshold = get_option('en_weight_threshold_lfq');
+                        $weight_threshold = isset($weight_threshold) && $weight_threshold > 0 ? $weight_threshold : 150;
+                        
+                        if ($total_shipment_weight > $weight_threshold) {
+                            $ups_small_package[$org_id]['is_shipment'] = 'ltl';
+                            $ups_small_package[$org_id]['origin']['ptype'] = 'ltl';
+
+                            // Eniture debug mode
+                            do_action("eniture_debug_mood", "Suppressing UPS Small Package Rates (Weight Threshold)", $ups_small_package[$org_id]);
+                        }
+                    }
+                }
+                
+                $SmPkgWebServiceArr = $ups_small_res_inst->ups_small_shipping_array($ups_small_package, $package, $this->package_plugin);
+                $this->instore_pickup_and_local_delivery = FALSE;
+
+                if ($SmPkgWebServiceArr === "ltl") {
+                    return FALSE;
+                }
+
+                foreach ($SmPkgWebServiceArr as $locId => $sPackage) {
+
+                    $package_bins = (isset($sPackage['bins'])) ? $sPackage['bins'] : [];
+                    $en_box_fee = (isset($sPackage['en_box_fee'])) ? $sPackage['en_box_fee'] : [];
+                    $en_multi_box_qty = (isset($sPackage['ups_small_pkg_product_quantity'])) ? $sPackage['ups_small_pkg_product_quantity'] : [];
+                    $ups_bins = (isset($sPackage['ups_bins'])) ? $sPackage['ups_bins'] : [];
+                    $hazardous_status = (isset($sPackage['hazardous_status'])) ? $sPackage['hazardous_status'] : '';
+                    $package_bins = !empty($ups_bins) ? $package_bins + $ups_bins : $package_bins;
+                    if (!isset($sPackage['ups_small_pkg_senderZip'])) {
+                        continue;
+                    }
+
+                    $speed_ship_senderZip = $sPackage['ups_small_pkg_senderZip'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['product_name'] = wp_json_encode($sPackage['product_name']);
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['products'] = $sPackage['products'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['sender_origin'] = $sPackage['sender_origin'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['package_bins'] = $package_bins;
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['en_box_fee'] = $en_box_fee;
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['en_multi_box_qty'] = $en_multi_box_qty;
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['hazardous_status'] = $hazardous_status;
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['origin_markup'] = $sPackage['origin_markup'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['product_level_markup_arr'] = $sPackage['product_level_markup_arr'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['exempt_ground_transit_restriction'] = (isset($sPackage['exempt_ground_transit_restriction'])) ? $sPackage['exempt_ground_transit_restriction'] : '';
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['hazardousItems'] = $sPackage['hazardousItems'];
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['hazardousItemsCount'] = $sPackage['hazardousItemsCount'];
+
+                    // FDO
+                    $en_fdo_meta_data = (isset($sPackage['en_fdo_meta_data'])) ? $sPackage['en_fdo_meta_data'] : '';
+                    $this->web_service_inst->product_detail[$speed_ship_senderZip]['en_fdo_meta_data'] = $en_fdo_meta_data;
+
+                    if ($sPackage != 'ltl') {
+
+                        $quotesValue = $ups_small_res_inst->ups_small_get_quotes($sPackage);
+                        
+                        if(!(isset($sPackage['exempt_ground_transit_restriction']) && $sPackage['exempt_ground_transit_restriction'] == 'yes')){
+                            $ups_transit_days = new Eniture_UpsSmallTransitDays();
+                            $quotesValue = $ups_transit_days->ups_enable_disable_ups_ground($quotesValue);
+                        }
+
+                        $hazardousIndex = array(
+                            "hazardousMaterial" => $sPackage["hazardousMaterial"]
+                        );
+
+                        $quotes[$locId] = (object)array_merge((array)$quotesValue, (array)$hazardousIndex);
+                    }
+                }
+                // Virtual products
+                $virtual_rate = $this->en_virtual_products();
+
+                $en_is_shipment = (count($quotes) > 1) || !empty($virtual_rate) ? 'en_multi_shipment' : 'en_single_shipment';
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Shipment Type (UPS Small)", $en_is_shipment);
+
+                $this->quote_settings['shipment'] = $en_is_shipment;
+                $this->eniture_rates = [];
+
+                $en_rates = $quotes;
+                // Apply override rates shipping rules
+                $en_rates = $get_packg_obj->apply_shipping_rules($ups_small_package, true, $en_rates);
+
+                foreach ($en_rates as $origin => $step_for_rates) {
+                    $product_detail = (isset($this->web_service_inst->product_detail[$origin])) ? $this->web_service_inst->product_detail[$origin] : array();
+                    $filterd_rates = $this->web_service_inst->en_ups_small_quotes($step_for_rates, $product_detail, $this->quote_settings);
+                    $en_sorting_rates = (isset($filterd_rates['en_sorting_rates'])) ? $filterd_rates['en_sorting_rates'] : "";
+
+                    $this->InstorPickupLocalDelivery = (isset($filterd_rates['InstorPickupLocalDelivery'])) ? $filterd_rates['InstorPickupLocalDelivery'] : "";
+                    if (isset($filterd_rates['en_sorting_rates']))
+                        unset($filterd_rates['en_sorting_rates']);
+
+                    if (isset($filterd_rates['InstorPickupLocalDelivery']))
+                        unset($filterd_rates['InstorPickupLocalDelivery']);
+
+                    if (is_array($filterd_rates) && !empty($filterd_rates)) {
+                        foreach ($filterd_rates as $accessorial => $service) {
+                            (!empty($filterd_rates[$accessorial])) ? array_multisort($en_sorting_rates[$accessorial], SORT_ASC, $filterd_rates[$accessorial]) : $en_sorting_rates[$accessorial] = [];
+                            $this->$en_is_shipment($filterd_rates[$accessorial], $accessorial, $origin);
+                        }
+                    } else {
+                        $this->en_not_returned_the_quotes = TRUE;
+                    }
+                }
+
+                if ($this->en_not_returned_the_quotes) {
+                    // Eniture debug mode
+                    do_action("eniture_debug_mood", "UPS Small Quotes not returned", $this->en_not_returned_the_quotes ? 'Yes' : 'No');
+
+                    return [];
+                }
+
+                if ($en_is_shipment == 'en_single_shipment') {
+                    // In-store pickup and local delivery
+                    $instore_pickup_local_devlivery_action = apply_filters('eniture_ups_small_quotes_plans_suscription_and_features', 'instore_pickup_local_devlivery');
+                    if ($this->web_service_inst->en_wd_origin_array['suppress_local_delivery'] == "1" && (!is_array($instore_pickup_local_devlivery_action))) {
+                        $this->eniture_rates = apply_filters('suppress_local_delivery', $this->eniture_rates, $this->web_service_inst->en_wd_origin_array, $this->package_plugin, $this->InstorPickupLocalDelivery);
+                    }
+                }
+                $rad_status = true;
+                $all_plugins = apply_filters('active_plugins', get_option('active_plugins'));
+                if (stripos(implode($all_plugins), 'residential-address-detection.php') || is_plugin_active_for_network('residential-address-detection/residential-address-detection.php')) {
+                    if(get_option('suspend_automatic_detection_of_residential_addresses') != 'yes') {
+                        $rad_status = get_option('residential_delivery_options_disclosure_types_to') != 'not_show_r_checkout';
+                    }
+                }
+                $accessorials = $rad_status == true ? ['R' => 'residential delivery'] : [];
+
+                add_filter('woocommerce_package_rates', array($this, 'en_sort_woocommerce_available_shipping_methods'), 10, 2);
+
+                // Images for FDO
+                $image_urls = apply_filters('en_fdo_image_urls_merge', []);
+                // Virtual products
+                if (!empty($virtual_rate)) {
+                    $en_virtual_fdo_meta_data[] = $virtual_rate['meta_data']['en_fdo_meta_data'];
+                    $this->en_fdo_meta_data_third_party = !empty($this->en_fdo_meta_data_third_party) ? array_merge($this->en_fdo_meta_data_third_party, $en_virtual_fdo_meta_data) : $en_virtual_fdo_meta_data;
+                }
+                $en_rates = $this->eniture_rates;
+
+                do_action("eniture_debug_mood", "Ups Small Eniture Quotes Rates", $en_rates);
+                foreach ($en_rates as $accessorial => $rate) {
+
+                    // Show delivery estimates
+                    if ($en_is_shipment == 'en_single_shipment') {
+
+                        $ups_small_delivey_estimate = get_option('ups_small_delivery_estimates');
+
+                        if (isset($ups_small_delivey_estimate) && !empty($ups_small_delivey_estimate) && $ups_small_delivey_estimate != 'dont_show_estimates') {
+                            if ($ups_small_delivey_estimate == 'delivery_date' && !empty($rate['transit_time'])) {
+                                $date_label = $this->get_estimated_delivery_date_label($rate);
+                                $rate['label'] .= ' (' . $date_label . ')';
+                            } else if ($ups_small_delivey_estimate == 'delivery_days' && !empty($rate['delivery_days'])) {
+                                $custom_day_format = get_option('estimated_delivery_days_format');
+                                $day_label = !empty($custom_day_format) ? $custom_day_format : 'Intransit days';
+                                $rate['label'] .= ' (' . $day_label . ': ' . $rate['delivery_days'] . ')';
+                            }
+                        }
+                    }
+
+                    if (isset($rate['label_sufex']) && !empty($rate['label_sufex'])) {
+                        $label_sufex = array_intersect_key($accessorials, array_flip($rate['label_sufex']));
+                        $rate['label'] .= (!empty($label_sufex)) ? ' with ' . implode(' and ', $label_sufex) : '';
+
+                        // Order widget detail set
+                        // FDO
+                        if (isset($this->minPrices) && !empty($this->minPrices)) {
+                            $rate['minPrices'] = $this->minPrices;
+                            $rate['meta_data']['min_prices'] = wp_json_encode($this->minPrices);
+                            $rate['meta_data']['en_fdo_meta_data']['data'] = array_values($this->en_fdo_meta_data);
+                            // Virtual Products
+                            (!empty($this->en_fdo_meta_data_third_party)) ? $rate['meta_data']['en_fdo_meta_data']['data'] = array_merge($rate['meta_data']['en_fdo_meta_data']['data'], $this->en_fdo_meta_data_third_party) : '';
+                            $rate['meta_data']['en_fdo_meta_data']['shipment'] = 'multiple';
+                            $rate['meta_data']['en_fdo_meta_data'] = wp_json_encode($rate['meta_data']['en_fdo_meta_data']);
+                        } else {
+                            $en_set_fdo_meta_data['data'] = [$rate['meta_data']['en_fdo_meta_data']];
+                            $en_set_fdo_meta_data['shipment'] = 'sinlge';
+                            $rate['meta_data']['en_fdo_meta_data'] = wp_json_encode($en_set_fdo_meta_data);
+                        }
+
+                        // Images for FDO
+                        $rate['meta_data']['en_fdo_image_urls'] = wp_json_encode($image_urls);
+
+                    }
+
+                    $override_rate = isset($rate['override_rate']) ? $rate['override_rate'] : false;
+                    if (isset($rate['cost']) && $rate['cost'] > 0 || $override_rate) {
+                        $rate['id'] = isset($rate['id']) && is_string($rate['id']) ? 'ups_small:' . $rate['id'] : '';
+                        $this->add_rate($rate);
+                        $en_rates[$accessorial] = array_merge($en_rates[$accessorial], $rate);
+                    }
+                }
+                // Origin terminal address
+                if ($en_is_shipment == 'en_single_shipment') {
+                    (isset($this->InstorPickupLocalDelivery->localDelivery) && ($this->InstorPickupLocalDelivery->localDelivery->status == 1)) ? $this->local_delivery($this->web_service_inst->en_wd_origin_array['fee_local_delivery'], $this->web_service_inst->en_wd_origin_array['checkout_desc_local_delivery'], $this->web_service_inst->en_wd_origin_array) : "";
+                    (isset($this->InstorPickupLocalDelivery->inStorePickup) && ($this->InstorPickupLocalDelivery->inStorePickup->status == 1)) ? $this->pickup_delivery($this->web_service_inst->en_wd_origin_array['checkout_desc_store_pickup'], $this->web_service_inst->en_wd_origin_array, $this->InstorPickupLocalDelivery->totalDistance) : "";
+                }
+
+                return $en_rates;
+            }
+
+            /**
+             * final rates sorting
+             * @param array type $rates
+             * @param array type $package
+             * @return array type
+             */
+            function en_sort_woocommerce_available_shipping_methods($rates, $package)
+            {
+                // if there are no rates don't do anything
+
+                if (!$rates) {
+                    return array();
+                }
+
+                // check the option to sort shipping methods by price on quote settings 
+                if (get_option('shipping_methods_do_not_sort_by_price') != 'yes') {
+
+                    $local_delivery = isset($rates['local-delivery']) ? $rates['local-delivery'] : '';
+                    $in_store_pick_up = isset($rates['in-store-pick-up']) ? $rates['in-store-pick-up'] : '';
+                    // get an array of prices
+                    $prices = array();
+                    foreach ($rates as $rate) {
+                        $prices[] = $rate->cost;
+                    }
+
+                    // use the prices to sort the rates
+                    array_multisort($prices, $rates);
+
+                    // unset instore-pickup & local delivery and set at the end of quotes array
+                    if (isset($in_store_pick_up) && !empty($in_store_pick_up)) {
+                        unset($rates['in-store-pick-up']);
+                        $rates['in-store-pick-up'] = $in_store_pick_up;
+                    }
+                    if (isset($local_delivery) && !empty($local_delivery)) {
+                        unset($rates['local-delivery']);
+                        $rates['local-delivery'] = $local_delivery;
+                    }
+                }
+                // return the rates
+                return $rates;
+            }
+
+            /**
+             * Add Hazardous Fee
+             * @param string $service_code
+             * @param array $quote_settings
+             * @return string
+             */
+            function ups_add_hazardous_material($service_code)
+            {
+                $this->ups_get_hazardous_fields();
+                return ($service_code == "03") ? $this->quote_settings['ground_hazardous_material_fee'] : $this->quote_settings['air_hazardous_material_fee'];
+            }
+
+            /**
+             * Hazardous values quote settings
+             */
+            function ups_get_hazardous_fields()
+            {
+                $this->quote_settings = [];
+                $this->quote_settings['hazardous_materials_shipments'] = get_option('ups_small_hazardous_materials_shipments');
+                $this->quote_settings['ground_hazardous_material_fee'] = get_option('ups_small_ground_hazardous_fee');
+                $this->quote_settings['air_hazardous_material_fee'] = get_option('ups_small_air_hazardous_fee');
+                $this->quote_settings['air_hazardous_material_fee'] = get_option('ups_small_air_hazardous_fee');
+                $this->quote_settings['dont_sort'] = get_option('shipping_methods_do_not_sort_by_price');
+                $this->quote_settings['handling_fee'] = get_option('ups_small_hand_fee_mark_up');
+                $this->quote_settings['services'] = [
+                    'all' => $this->web_service_inst->service_options_array(),
+                    'simple' => $this->web_service_inst->ups_simple_service_options()
+                ];
+            }
+
+            /**
+             * Pickup delivery quote
+             * @return array type
+             */
+            function pickup_delivery($label, $en_wd_origin_array, $total_distance)
+            {
+                $this->woocommerce_package_rates = 1;
+                $this->instore_pickup_and_local_delivery = TRUE;
+
+                $label = (isset($label) && (strlen($label) > 0)) ? $label : 'In-store pick up';
+                // Origin terminal address
+                $address = (isset($en_wd_origin_array['address'])) ? $en_wd_origin_array['address'] : '';
+                $city = (isset($en_wd_origin_array['city'])) ? $en_wd_origin_array['city'] : '';
+                $state = (isset($en_wd_origin_array['state'])) ? $en_wd_origin_array['state'] : '';
+                $zip = (isset($en_wd_origin_array['zip'])) ? $en_wd_origin_array['zip'] : '';
+                $phone_instore = (isset($en_wd_origin_array['phone_instore'])) ? $en_wd_origin_array['phone_instore'] : '';
+                strlen($total_distance) > 0 ? $label .= ': Free | ' . str_replace("mi", "miles", $total_distance) . ' away' : '';
+                strlen($address) > 0 ? $label .= ' | ' . $address : '';
+                strlen($city) > 0 ? $label .= ', ' . $city : '';
+                strlen($state) > 0 ? $label .= ' ' . $state : '';
+                strlen($zip) > 0 ? $label .= ' ' . $zip : '';
+                strlen($phone_instore) > 0 ? $label .= ' | ' . $phone_instore : '';
+
+                $pickup_delivery = array(
+                    'id' => 'ups_small:' . 'in-store-pick-up',
+                    'cost' => 0,
+                    'label' => $label,
+                    'plugin_name' => 'upsSmall',
+                    'plugin_type' => 'small',
+                    'owned_by' => 'eniture'
+                );
+
+                add_filter('woocommerce_package_rates', array($this, 'en_sort_woocommerce_available_shipping_methods'), 10, 2);
+                $this->add_rate($pickup_delivery);
+            }
+
+            /**
+             * Local delivery quote
+             * @param string type $cost
+             * @return array type
+             */
+            function local_delivery($cost, $label, $en_wd_origin_array)
+            {
+                $this->woocommerce_package_rates = 1;
+                $this->instore_pickup_and_local_delivery = TRUE;
+                $label = (isset($label) && (strlen($label) > 0)) ? $label : 'Local Delivery';
+
+                $local_delivery = array(
+                    'id' => 'ups_small:' . 'local-delivery',
+                    'cost' => $cost,
+                    'label' => $label,
+                    'plugin_name' => 'upsSmall',
+                    'plugin_type' => 'small',
+                    'owned_by' => 'eniture'
+                );
+
+                add_filter('woocommerce_package_rates', array($this, 'en_sort_woocommerce_available_shipping_methods'), 10, 2);
+                $this->add_rate($local_delivery);
+            }
+
+            /**
+             * Check is free shipping or not
+             * @param $coupon
+             * @return string
+             */
+            function ups_shipping_coupon_rate($coupon)
+            {
+                foreach ($coupon as $key => $value) {
+                    if ($value->get_free_shipping() == 1) {
+                        $rates = array(
+                            'id' => 'free',
+                            'label' => 'Free Shipping',
+                            'cost' => 0,
+                            'plugin_name' => 'upsSmall',
+                            'plugin_type' => 'small',
+                            'owned_by' => 'eniture'
+                        );
+                        $this->add_rate($rates);
+                        return 'y';
+                    }
+                }
+                return 'n';
+            }
+
+            function get_estimated_delivery_date_label($rate)
+            {
+                $delivery_time = isset($rate['delivery_time']) && !empty($rate['delivery_time']) && is_string($rate['delivery_time']) ? $rate['delivery_time'] : '';
+                $default_date_format = 'D M d';
+                $date_label = 'Expected delivery by ' . $delivery_time . ' on ' . gmdate($default_date_format, strtotime($rate['transit_time']));
+                $custom_date_format = get_option('estimated_delivery_date_format');
+                
+                if (!empty($custom_date_format)) {
+                    if (str_contains($custom_date_format, '%')) {
+                        try {
+                            $date_format_arr = explode('%', $custom_date_format);
+                            $_label = $date_format_arr[0];
+                            $_format = str_replace('%', '', $date_format_arr[1]);
+                            $date_label = $_label . ' ' . $delivery_time . ' on ' . gmdate($_format, strtotime($rate['transit_time']));
+                        } catch (\Throwable $th) {
+                            $date_label = $date_label;
+                        }
+                    } else {
+                        $date_label = $custom_date_format . ' ' . $delivery_time . ' on ' .  gmdate($default_date_format, strtotime($rate['transit_time']));
+                    }
+                }
+
+                return $date_label;
+            }
+        }
+
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-tab-class.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-tab-class.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-tab-class.php	(revision 3237693)
@@ -0,0 +1,218 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Setting Tab Class
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Eniture UPS Small WooComerce |  Setting Tab Class
+ */
+class Eniture_WC_Settings_UPS_Small extends WC_Settings_Page
+{
+
+    /**
+     * Setting Tabs constructor
+     */
+    public function __construct()
+    {
+        $this->id = eniture_woo_plugin_ups_small;
+        add_filter('woocommerce_settings_tabs_array', array($this, 'add_settings_tab'), 50);
+        add_action('woocommerce_sections_' . $this->id, array($this, 'output_sections'));
+        add_action('woocommerce_settings_' . $this->id, array($this, 'output'));
+        add_action('woocommerce_settings_save_' . $this->id, array($this, 'save'));
+    }
+
+    /**
+     * UPS Small Setting Tab For Woo-commerce
+     * @param $settings_tabs
+     * @return array
+     */
+    public function add_settings_tab($settings_tabs)
+    {
+        $settings_tabs[$this->id] = __('UPS', 'small-package-quotes-ups-edition');
+        return $settings_tabs;
+    }
+
+    /**
+     * UPS Small Setting Sections
+     * @return array
+     */
+    public function get_sections()
+    {
+
+        $sections = array(
+            '' => __('Connection Settings', 'small-package-quotes-ups-edition'),
+            'section-1' => __('Quote Settings', 'small-package-quotes-ups-edition'),
+            'section-2' => __('Warehouses', 'small-package-quotes-ups-edition'),
+            'shipping-rules' => __('Shipping Rules', 'small-package-quotes-ups-edition'),
+            // fdo va
+            'section-4' => __('FreightDesk Online', 'small-package-quotes-ups-edition'),
+            'section-5' => __('Validate Addresses', 'small-package-quotes-ups-edition'),
+            'section-3' => __('User Guide', 'small-package-quotes-ups-edition'),
+        );
+
+        // Logs data
+        $enable_logs = get_option('ups_small_enable_logs');
+        if ($enable_logs == 'yes') {
+            $sections['en-logs'] = 'Logs';
+        } 
+
+        $sections = apply_filters('en_woo_addons_sections', $sections, eniture_woo_plugin_ups_small);
+
+        return apply_filters('woocommerce_get_sections_' . $this->id, $sections);
+    }
+
+    /**
+     * UPS Small Warehouse Tab
+     */
+    public function ups_small_warehouse()
+    {
+        require_once 'warehouse-dropship/wild/warehouse/warehouse_template.php';
+        require_once 'warehouse-dropship/wild/dropship/dropship_template.php';
+    }
+
+    /**
+     * UPS Small User Guide Tab
+     */
+    public function ups_user_guide()
+    {
+        include_once('template/guide.php');
+    }
+
+    /**
+     * UPS Small Get Settings Pages
+     * @param $section
+     * @return array
+     */
+    public function get_settings($section = null)
+    {
+        ob_start();
+        switch ($section) {
+            case 'section-0' :
+                $settings = (new Eniture_UPS_Small_Connection_Settings())->ups_small_con_setting();
+                break;
+            case 'section-1':
+                $ups_small_qsettings = new Eniture_UPS_Small_Quote_Settings();
+                $settings = $ups_small_qsettings->ups_small_quote_settings_tab();
+                break;
+            case 'section-2' :
+                $this->ups_small_warehouse();
+                $settings = array();
+                break;
+            case 'section-3' :
+                $this->ups_user_guide();
+                $settings = array();
+                break;
+            // fdo va
+            case 'section-4' :
+                $this->freightdesk_online_section();
+                $settings = [];
+                break;
+
+            case 'section-5' :
+                $this->validate_addresses_section();
+                $settings = [];
+                break;
+
+            case 'shipping-rules' :
+                include_once('shipping-rules/shipping-rules-template.php');
+                $settings = [];
+                break;
+
+            case 'en-logs' :
+                require_once 'logs/en-logs.php';
+                $settings = [];
+                break;
+
+            default:
+                $ups_small_con_settings = new Eniture_UPS_Small_Connection_Settings();
+                $settings = $ups_small_con_settings->ups_small_con_setting();
+                break;
+        }
+        $settings = apply_filters('en_woo_addons_settings', $settings, $section, eniture_woo_plugin_ups_small);
+        $settings = $this->avaibility_addon($settings);
+        return apply_filters('woocommerce-settings-ups-small', $settings, $section);
+    }
+
+    /**
+     * @param array type $settings
+     * @return array type
+     */
+    function avaibility_addon($settings)
+    {
+        if (is_plugin_active('residential-address-detection/residential-address-detection.php')) {
+            unset($settings['avaibility_auto_residential']);
+        }
+        if (is_plugin_active('standard-box-sizes/en-standard-box-sizes.php') || is_plugin_active('standard-box-sizes/standard-box-sizes.php')) {
+            unset($settings['avaibility_box_sizing']);
+        }
+
+        return $settings;
+    }
+
+    /**
+     * UPS Small settings output
+     * @global $current_section
+     */
+    public function output()
+    {
+        global $current_section;
+        $settings = $this->get_settings($current_section);
+        WC_Admin_Settings::output_fields($settings);
+    }
+
+    /**
+     * UPS Small Save Settings
+     * @global $current_section
+     */
+    public function save()
+    {
+        global $current_section;
+        $settings = $this->get_settings($current_section);
+        if (isset($_POST['ups_small_orderCutoffTime']) && sanitize_text_field(wp_unslash($_POST['ups_small_orderCutoffTime'])) != '') {
+            $time24Formate = $this->getTimeIn24Hours(sanitize_text_field(wp_unslash( $_POST['ups_small_orderCutoffTime'] )));
+            $_POST['ups_small_orderCutoffTime'] = $time24Formate;
+        }
+        WC_Admin_Settings::save_fields($settings);
+    }
+
+    /**
+     * @param $timeStr
+     * @return false|string
+     */
+    public function getTimeIn24Hours($timeStr)
+    {
+        $cutOffTime = explode(' ', $timeStr);
+        $hours = $cutOffTime[0];
+        $separator = $cutOffTime[1];
+        $minutes = $cutOffTime[2];
+        $meridiem = $cutOffTime[3];
+        $cutOffTime = "{$hours}{$separator}{$minutes} $meridiem";
+        return gmdate("H:i", strtotime($cutOffTime));
+    }
+    // fdo va
+    /**
+     * FreightDesk Online section
+     */
+    public function freightdesk_online_section()
+    {
+        include_once plugin_dir_path(__FILE__) . 'fdo/freightdesk-online-section.php';
+    }
+
+    /**
+     * Validate Addresses Section
+     */
+    public function validate_addresses_section()
+    {
+        include_once plugin_dir_path(__FILE__) . 'fdo/validate-addresses-section.php';
+    }
+
+}
+
+return new Eniture_WC_Settings_UPS_Small();
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-test-connection.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-test-connection.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-test-connection.php	(revision 3237693)
@@ -0,0 +1,87 @@
+<?php
+
+/**
+ * UPS Small WooComerce |  Test Connection AJAX Request
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+add_action('wp_ajax_nopriv_eniture_ups_small_test_connection', 'eniture_ups_test_submit');
+add_action('wp_ajax_eniture_ups_small_test_connection', 'eniture_ups_test_submit');
+
+/**
+ * UPS Small Test Connection AJAX Request
+ */
+function eniture_ups_test_submit()
+{
+    if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'eniture_ups_small_nonce')) {
+        echo json_encode([]);
+        exit;
+    }
+
+    $iAcountNumber = (isset($_POST['ups_small_acc_number'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_acc_number'] )) : '';
+    $sLicenseKey = (isset($_POST['ups_small_license'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_license'] )) : '';
+    $domain = eniture_ups_small_get_domain();
+    $data = array(
+        'plateform' => 'WordPress',
+        'carrierName' => 'upsSmall',
+        'ups_account_number' => $iAcountNumber,
+        'plugin_licence_key' => $sLicenseKey,
+        'ups_domain_name' => $domain,
+    );
+
+    if(isset($_POST['api_end_point']) && sanitize_text_field(wp_unslash($_POST['api_end_point'])) == 'ups_old_api'){
+        $data['ups_license_key'] = (isset($_POST['ups_small_api_access_key'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_api_access_key'] )) : '';
+        $data['ups_username'] = (isset($_POST['ups_small_username'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_username'] )) : '';
+        $data['ups_password'] = (isset($_POST['ups_small_password'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_password'] )) : '';
+    }else{
+        $data['ApiVersion'] = '2.0';
+        $data['clientId'] = (isset($_POST['client_id'])) ? sanitize_text_field(wp_unslash( $_POST['client_id'] )) : "";
+        $data['clientSecret'] = (isset($_POST['client_secret'])) ? sanitize_text_field(wp_unslash( $_POST['client_secret'] )) : "";
+        $data['ups_username'] = (isset($_POST['ups_small_username'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_username'] )) : '';
+        $data['ups_password'] = (isset($_POST['ups_small_password'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_password'] )) : '';
+    }
+
+    $ups_small_curl_obj = new Eniture_UPS_Small_Curl_Request();
+    $sResponseData = $ups_small_curl_obj->ups_small_get_curl_response(ENITURE_UPS_DOMAIN_HITTING_URL . '/s/ups/auth.php', $data);
+    $sResponseData = json_decode($sResponseData);
+
+    if (isset($sResponseData->severity) && $sResponseData->severity == 'SUCCESS' || isset($sResponseData->success) && $sResponseData->success == 1) {
+        $sResult = array('success' => "The test resulted in a successful connection.");
+    }else if (isset($sResponseData->severity) && $sResponseData->severity == 'ERROR') {
+        $message = (isset($sResponseData->message) && !empty($sResponseData->message)) ? $sResponseData->message : "Please verify credentials and try again.";
+        $sResult = array('error' => $message);
+    } else {
+        $sResult = ($sResponseData->error == 1) ? 'Please verify credentials and try again.' : $sResponseData->error;
+        $sResult = array('error' => $sResult);
+    }
+
+    echo wp_json_encode($sResult);
+    exit();
+}
+
+/**
+ * Get Host
+ * @param type $url
+ * @return type
+ */
+if (!function_exists('eniture_getHost')) {
+
+    function eniture_getHost($url)
+    {
+        $parseUrl = wp_parse_url(trim($url));
+        if (isset($parseUrl['host'])) {
+            $host = $parseUrl['host'];
+        } else {
+            $path = explode('/', $parseUrl['path']);
+            $host = $path[0];
+        }
+        return trim($host);
+    }
+
+}
+    
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups-small-wc-update-change.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups-small-wc-update-change.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups-small-wc-update-change.php	(revision 3237693)
@@ -0,0 +1,124 @@
+<?php
+/**
+ * UPS Small WooComerce |  Class for new and old functions
+ * @package     Woo-commerce UPS Small Edition
+ * @author      <https://eniture.com/>
+ * @copyright   Copyright (c) 2017, Eniture
+ */
+if ( ! defined( 'ABSPATH' ) ) {
+    exit; 
+}
+
+/**
+* Eniture UPS Small WooComerce | Class for new and old functions
+*/
+class Eniture_UPS_Small_Woo_Update_Changes 
+{
+    /**
+     * WooCommerce Version Number
+     * @var int
+     */
+    public $WooVersion;
+
+    /**
+     * Update Changes Constructor
+     */
+    function __construct() 
+    {
+        if (!function_exists('get_plugins'))
+            require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+
+        $plugin_folder    = get_plugins('/' . 'woocommerce');
+        $plugin_file      = 'woocommerce.php';
+        $this->WooVersion = $plugin_folder[$plugin_file]['Version'];
+
+    }
+
+    /**
+     * WooCommerce Update Changes For Postcode
+     * @return int
+     */
+    function ups_small_postcode()
+    { 
+        $sPostCode = "";
+        switch ($this->WooVersion) 
+        {  
+            case ($this->WooVersion <= '2.7'):
+                $sPostCode = WC()->customer->get_postcode();
+                break;
+            case ($this->WooVersion >= '3.0'):
+                $sPostCode = WC()->customer->get_billing_postcode();
+                break;
+
+            default:
+                break;
+        }
+        return $sPostCode;
+    }
+    /**
+     * WooCommerce Update Changes For State
+     * @return int
+     */
+    function ups_small_getState()
+    { 
+        $sState = "";
+        switch ($this->WooVersion) 
+        {  
+            case ($this->WooVersion <= '2.7'):
+                $sState = WC()->customer->get_state();
+                break;
+            case ($this->WooVersion >= '3.0'):
+                $sState = WC()->customer->get_billing_state();
+                break;
+
+            default:
+                break;
+        }
+        return $sState;
+    }
+
+    /**
+     * WooCommerce Update Changes For City
+     * @return int
+     */
+    function ups_small_getCity()
+    { 
+        $sCity = "";
+        switch ($this->WooVersion) 
+        {  
+            case ($this->WooVersion <= '2.7'):
+                $sCity = WC()->customer->get_city();
+                break;
+            case ($this->WooVersion >= '3.0'):
+                $sCity = WC()->customer->get_billing_city();
+                break;
+
+            default:
+                break;
+        }
+        return $sCity;
+    }
+
+    /**
+     * WooCommerce Update Changes For City
+     * @return int
+     */
+    function ups_small_getCountry()
+    { 
+        $sCountry = "";
+        switch ($this->WooVersion) 
+        {  
+            case ($this->WooVersion <= '2.7'):
+                $sCountry = WC()->customer->get_country();
+                break;
+            case ($this->WooVersion >= '3.0'):
+                $sCountry = WC()->customer->get_billing_country();
+                break;
+
+            default:
+                break;
+        }
+        return $sCountry;
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/ups_small_version_compact.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/ups_small_version_compact.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/ups_small_version_compact.php	(revision 3237693)
@@ -0,0 +1,29 @@
+<?php
+
+if (!defined('ABSPATH')){
+    exit; 
+}
+
+// Includes Eniture_VersionCompat class
+
+if(! class_exists('Eniture_VersionCompat')){
+
+    Class Eniture_VersionCompat{
+        public $phpVersion;
+        function __construct() {
+            $this->phpVersion = PHP_VERSION;
+        }
+
+        function enArrayColumn($data,$key){
+            $oldVersion = $this->phpVersion <= 5.4;
+            $columns = (!$oldVersion && function_exists("array_column")) ? array_column($data, $key) : array();
+            $arrLength = count($data);
+            if(empty($arrLength) || !$oldVersion) return $columns;
+            $indexArr = array_fill(0, $arrLength, $key);
+            $columns = array_map(function($data, $index){$column = is_object($data) ? $data->$index : $data[$index] ; return $column;},$data,$indexArr);
+            return $columns;
+
+        }
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/get-distance-request.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/get-distance-request.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/get-distance-request.php	(revision 3237693)
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * WWE Small Get Distance
+ *
+ * @package     WWE Small Quotes
+ * @author      Eniture-Technology
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+/**
+ * Distance Request Class
+ */
+class Eniture_Get_ups_small_distance
+{
+
+    function __construct()
+    {
+        add_filter("eniture_wd_get_address", array($this, "eniture_ups_small_address"), 10, 2);
+    }
+
+    /**
+     * Get Address Upon Access Level
+     * @param $map_address
+     * @param $accessLevel
+     */
+    function ups_small_address($map_address, $accessLevel, $destinationZip = array())
+    {
+
+        $domain = eniture_ups_small_get_domain();
+        $postData = array(
+            'acessLevel' => $accessLevel,
+            'address' => $map_address,
+            'originAddresses' => (isset($map_address)) ? $map_address : "",
+            'destinationAddress' => (isset($destinationZip)) ? $destinationZip : "",
+            'eniureLicenceKey' => get_option('ups_small_licence_key'),
+
+            'ServerName' => $domain,
+        );
+
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "Multi Warehouse Distance Request (UPS Small)", $postData);
+
+        $Ups_Small_Curl_Request = new Eniture_UPS_Small_Curl_Request();
+        $output = $Ups_Small_Curl_Request->ups_small_get_curl_response(ENITURE_UPS_DOMAIN_HITTING_URL . '/addon/google-location.php', $postData);
+
+
+        return $output;
+    }
+
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild-delivery.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild-delivery.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild-delivery.php	(revision 3237693)
@@ -0,0 +1,309 @@
+<?php
+
+
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+require_once 'wild/includes/wild-delivery-save.php';
+
+
+/**
+ * Admin Warehouse Dropship Scripts
+ */
+if (!function_exists("eniture_woo_wd_admin_script_style")) {
+    function eniture_woo_wd_admin_script_style()
+    {
+        wp_enqueue_script('en_woo_wd_tagging', plugin_dir_url(__FILE__) . '/wild/assets/js/tagging.js', array(), '1.0.0');
+        wp_localize_script('en_woo_wd_tagging', 'script', array(
+            'pluginsUrl' => plugins_url(),
+        ));
+
+        wp_enqueue_script('en_woo_wd_script', plugin_dir_url(__FILE__) . '/wild/assets/js/warehouse_section.js', array(), '1.0.6');
+        wp_localize_script('en_woo_wd_script', 'script', array(
+            'pluginsUrl' => plugins_url(),
+        ));
+
+        wp_register_style('warehouse_section', plugin_dir_url(__FILE__) . '/wild/assets/css/warehouse_section.css', false, '1.0.4');
+        wp_enqueue_style('warehouse_section');
+        wp_localize_script('en_woo_wd_script', 'en_ups_small_wh_script', array(
+            'pluginsUrl' => plugins_url(),
+            'nonce' => wp_create_nonce("en_woo_wd_nonce"),
+        ));
+    }
+
+    add_action('admin_enqueue_scripts', 'eniture_woo_wd_admin_script_style');
+}
+
+/**
+ * Warehouse Template
+ */
+if (!function_exists('eniture_warehouse_template')) {
+    function eniture_warehouse_template($action = FALSE)
+    {
+
+        ob_start();
+
+        global $wpdb;
+        $warehous_list = $wpdb->get_results(
+            "SELECT *
+                  FROM " . $wpdb->prefix . "warehouse WHERE location = 'warehouse'"
+        );
+
+        $multi_warehouse_disabled = "";
+        $multi_warehouse_package_required = "";
+        $tr_disabled_me = "";
+        $add_space = "";
+
+        $plugin_tab = (isset($_REQUEST['tab'])) ? sanitize_text_field(wp_unslash($_REQUEST['tab'])) : "";
+        $multi_warehouse = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'multi_warehouse');
+
+        if (is_array($multi_warehouse) && count($warehous_list) > 0) {
+            $add_space = "<br><br>";
+            $multi_warehouse_disabled = "wild_disabled_me";
+            $tr_disabled_me = "tr_disabled_me";
+            $multi_warehouse_package_required = apply_filters("eniture_ups_small_plans_notification_link", $multi_warehouse);
+        }
+        ?>
+
+
+        <div class="add_btn_warehouse">
+
+        <a href="#en_wd_add_warehouse_btn" onclick="en_wd_add_warehouse_btn()" title="Add Warehouse"
+           class="en_wd_add_warehouse_btn <?php echo esc_attr($multi_warehouse_disabled);
+           ?>" name="avc">Add</a>
+
+           <?php
+                echo "<br /> <br />";
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Warehouse List", $warehous_list);
+            ?>
+
+        <div class="wild_warehouse pakage_notify heading_right">
+            <?php echo $multi_warehouse_package_required; ?>
+        </div>
+
+        <br><?php echo $add_space; ?>
+
+        <div class="warehouse_text">
+            <p>Warehouses that inventory all products not otherwise identified as drop shipped items. The warehouse with
+                the lowest shipping cost to the destination is used for quoting purposes.</p>
+        </div>
+        <div id="message" class="updated inline warehouse_deleted">
+            <p><strong>Success!</strong> Warehouse deleted successfully.</p>
+        </div>
+        <div id="message" class="updated inline warehouse_created">
+            <p><strong>Success!</strong> New warehouse added successfully.</p>
+        </div>
+        <div id="message" class="updated inline warehouse_updated">
+            <p><strong>Success!</strong> Warehouse updated successfully.</p>
+        </div>
+        <table class="en_wd_warehouse_list" id="append_warehouse">
+            <thead>
+            <tr>
+                <th class="en_wd_warehouse_list_heading">
+                    City
+                </th>
+                <th class="en_wd_warehouse_list_heading">
+                    State
+                </th>
+                <th class="en_wd_warehouse_list_heading">
+                    Zip
+                </th>
+                <th class="en_wd_warehouse_list_heading">
+                    Country
+                </th>
+                <th class="en_wd_warehouse_list_heading">
+                    Action
+                </th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php
+            if (count($warehous_list) > 0) {
+                $count = 0;
+                foreach ($warehous_list as $list) {
+                    ?>
+                    <tr class="<?php echo (strlen($tr_disabled_me) > 0 && $count != 0) ? esc_attr($tr_disabled_me) : ""; ?>"
+                        id="row_<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>"
+                        data-id="<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>">
+                        <td class="en_wd_warehouse_list_data">
+                            <?php echo (isset($list->city)) ? esc_attr($list->city) : ''; ?>
+                        </td>
+                        <td class="en_wd_warehouse_list_data">
+                            <?php echo (isset($list->state)) ? esc_attr($list->state) : ''; ?>
+                        </td>
+                        <td class="en_wd_warehouse_list_data">
+                            <?php echo (isset($list->zip)) ? esc_attr($list->zip) : ''; ?>
+                        </td>
+                        <td class="en_wd_warehouse_list_data">
+                            <?php echo (isset($list->country)) ? esc_attr($list->country) : ''; ?>
+                        </td>
+                        <td class="en_wd_warehouse_list_data">
+                            <a href="javascript(0)"
+                               onclick="return en_ups_small_wd_edit_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                                        src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"
+                                        title="Edit"></a>
+                            <a href="javascript(0)"
+                               onclick="return en_ups_small_wd_delete_current_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                                        src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"
+                                        title="Delete"></a>
+                        </td>
+                    </tr>
+                    <?php
+                    $count++;
+                }
+            } else {
+                ?>
+                <tr class="new_warehouse_add" data-id=0></tr>
+            <?php } ?>
+            </tbody>
+        </table>
+
+
+        <?php
+
+        echo '</div>';
+
+        if ($action) {
+            $ob_get_clean = ob_get_clean();
+            return $ob_get_clean;
+        }
+    }
+}
+
+/**
+ * Dropship Template
+ */
+if (!function_exists('eniture_dropship_template')) {
+    function eniture_dropship_template($action = FALSE)
+    {
+
+        ob_start();
+
+        global $wpdb;
+        $dropship_list = $wpdb->get_results(
+            "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE location = 'dropship'"
+        );
+
+        $multi_dropship_disabled = "";
+        $multi_dropship_package_required = "";
+        $tr_disabled_me = "";
+        $add_space = "";
+        $plugin_tab = (isset($_REQUEST['tab'])) ? sanitize_text_field(wp_unslash($_REQUEST['tab'])) : "";
+        $multi_dropship = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'multi_dropship');
+
+        if (is_array($multi_dropship) && count($dropship_list) > 0) {
+            $add_space = "<br><br>";
+            $multi_dropship_disabled = "wild_disabled_me";
+            $tr_disabled_me = "tr_disabled_me";
+            $multi_dropship_package_required = apply_filters("eniture_ups_small_plans_notification_link", $multi_dropship);
+        }
+        ?>
+
+        <div class="add_btn_dropship">
+        <a href="#add_dropship_btn" onclick="hide_drop_val()" title="Add Drop Ship"
+           class="en_wd_add_dropship_btn hide_drop_val <?php echo esc_attr($multi_dropship_disabled); ?>">Add</a>
+
+           <?php
+                echo "<br /> <br />";
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Dropship List", $dropship_list);
+            ?>
+
+        <div class="wild_warehouse pakage_notify heading_right">
+            <?php echo $multi_dropship_package_required; ?>
+        </div>
+
+        <br><?php echo $add_space; ?>
+        <div class="warehouse_text">
+            <p>Locations that inventory specific items that are drop shipped to the destination. Use the product's
+                settings page to identify it as a drop shipped item and its associated drop ship location. Orders that
+                include drop shipped items will display a single figure for the shipping rate estimate that is equal to
+                the sum of the cheapest option of each shipment required to fulfill the order.</p>
+        </div>
+        <div id="message" class="updated inline dropship_created">
+            <p><strong>Success!</strong> New drop ship added successfully.</p>
+        </div>
+        <div id="message" class="updated inline dropship_updated">
+            <p><strong>Success!</strong> Drop ship updated successfully.</p>
+        </div>
+        <div id="message" class="updated inline dropship_deleted">
+            <p><strong>Success!</strong> Drop ship deleted successfully.</p>
+        </div>
+        <table class="en_wd_dropship_list" id="append_dropship">
+            <thead>
+            <tr>
+                <th class="en_wd_dropship_list_heading">
+                    Nickname
+                </th>
+                <th class="en_wd_dropship_list_heading">
+                    City
+                </th>
+                <th class="en_wd_dropship_list_heading">
+                    State
+                </th>
+                <th class="en_wd_dropship_list_heading">
+                    Zip
+                </th>
+                <th class="en_wd_dropship_list_heading">
+                    Country
+                </th>
+                <th class="en_wd_dropship_list_heading">
+                    Action
+                </th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php
+            if (count($dropship_list) > 0) {
+                $count = 0;
+                foreach ($dropship_list as $list) {
+                    ?>
+                    <tr class="<?php echo (strlen($tr_disabled_me) > 0 && $count != 0) ? esc_attr($tr_disabled_me) : ""; ?>"
+                        id="row_<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>">
+                        <td class="en_wd_dropship_list_data">
+                            <?php echo (isset($list->nickname)) ? esc_attr($list->nickname) : ''; ?>
+                        </td>
+                        <td class="en_wd_dropship_list_data">
+                            <?php echo (isset($list->city)) ? esc_attr($list->city) : ''; ?>
+                        </td>
+                        <td class="en_wd_dropship_list_data">
+                            <?php echo (isset($list->state)) ? esc_attr($list->state) : ''; ?>
+                        </td>
+                        <td class="en_wd_dropship_list_data">
+                            <?php echo (isset($list->zip)) ? esc_attr($list->zip) : ''; ?>
+                        </td>
+                        <td class="en_wd_dropship_list_data">
+                            <?php echo (isset($list->country)) ? esc_attr($list->country) : ''; ?>
+                        </td>
+                        <td class="en_wd_dropship_list_data">
+                            <a href="javascript(0)"
+                               onclick="return en_ups_small_wd_edit_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                                        src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"
+                                        title="Edit"></a>
+                            <a href="javascript(0)"
+                               onclick="return en_ups_small_wd_delete_current_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                                        src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"
+                                        title="Delete"></a>
+                        </td>
+                    </tr>
+                    <?php
+                    $count++;
+                }
+            } else {
+                ?>
+                <tr class="new_dropship_add" data-id=0></tr>
+            <?php } ?>
+            </tbody>
+        </table>
+
+        <?php
+
+        echo '</div>';
+
+        if ($action) {
+            return ob_get_clean();
+        }
+    }
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/css/warehouse_section.css
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/css/warehouse_section.css	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/css/warehouse_section.css	(revision 3237693)
@@ -0,0 +1,616 @@
+/**
+*   Warehouse template
+**/
+.en_wd_add_warehouse_btn{
+    background: #0085ba none repeat scroll 0 0;
+    border: medium none;
+    border-radius: 3px;
+    color: #fff;
+    padding: 7px 20px;
+    text-decoration: none;
+    text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
+}
+.en_wd_add_warehouse_btn:hover{
+    background: #008ec2;
+    color: #fff;
+    border-color: #006799;
+}
+
+/**
+*   Warehouse table
+**/
+.en_wd_warehouse_list {
+    font-family: 'Arial';
+    margin: 25px auto 40px;
+    border-collapse: collapse;
+    border: 1px solid #eee;
+    width: 100%;
+    background: #fff;
+}
+.en_wd_warehouse_list  .en_wd_warehouse_list_heading, .en_wd_warehouse_list_data {
+    color: #555;
+    padding: 12px 35px;
+    border-collapse: collapse;
+    text-align: center;
+}
+.en_wd_warehouse_list  .en_wd_warehouse_list_heading {
+    background: #fff none repeat scroll 0 0;
+    border-bottom: 1px solid #e1e1e1;
+    color: #0073aa;
+    font-size: 14px;
+    font-weight: 400;
+}
+.en_wd_warehouse_list_data a img{
+    margin-left: 5px;
+    width: 17px;
+}
+#append_warehouse tbody > tr:nth-of-type(2n-1){
+    background: #f9f9f9;
+}
+
+/**
+*   Warehouse Popup
+**/
+
+.en_wd_add_warehouse_popup .content{
+    overflow-y: scroll;
+    height: 80vh;
+}
+.en_wd_warehouse_overlay {
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background: rgba(0, 0, 0, 0.7);
+    transition: opacity 500ms;
+    visibility: hidden;
+    opacity: 0;
+    z-index: 9999;
+}
+.en_wd_warehouse_overlay:target {
+    visibility: visible;
+    opacity: 1;
+}
+
+.en_wd_add_warehouse_popup {
+    margin: 3% auto;
+    padding: 20px;
+    background: #fff;
+    border-radius: 5px;
+    width: 40%;
+    position: relative;
+    transition: all 5s ease-in-out;
+}
+
+.en_wd_add_warehouse_popup h2 {
+    margin-top: 0;
+    color: #333;
+    font-family: Tahoma, Arial, sans-serif;
+}
+.en_wd_add_warehouse_popup .close {
+    position: absolute;
+    top: 20px;
+    right: 30px;
+    transition: all 200ms;
+    font-size: 30px;
+    font-weight: bold;
+    text-decoration: none;
+    color: #333;
+}
+.en_wd_add_warehouse_popup .close:hover {
+    color: #ea6153;
+}
+.en_wd_add_warehouse_popup .content {
+    max-height: 80vh;
+    overflow: auto;
+}
+.en_wd_add_warehouse_popup .content label {
+    cursor: default;
+}
+
+.en_wd_add_warehouse_popup .content label{
+    font-weight: 900;
+}
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_input,
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_tagging{
+    width: 100%;
+    clear: both;
+}
+
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_input input[type="text"],
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_input select{
+    margin: 10px;
+    width: 57.9%;
+    padding: 5px;
+    float: right;
+    height: 40px;
+}
+
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_input input[type="checkbox"]{
+    margin: 10px 0px 0px 8px !important;
+    float: left;
+    width: 5% !important;
+}
+
+.pickup-delivery-checkboxes{
+    width: 57%;
+    float: right;
+    margin-right: 20px;
+}
+
+
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_input label,
+.en_wd_add_warehouse_popup .content .en_wd_add_warehouse_tagging label{
+    font-weight: 600;
+    float: left;
+    line-height: 3.5;
+}
+
+.save_warehouse_form{
+    background       : #0085ba none repeat scroll 0 0;
+    border           : medium none;
+    color            : #fff;
+    text-decoration  : none;
+    padding: 7px 20px;
+    cursor           : pointer;
+    border-radius    : 2px;
+    font-size        : 14px;
+    background-image : -webkit-linear-gradient(top, #0085ba, #2980b9);
+    background-image : -moz-linear-gradient(top, #0085ba, #2980b9);
+    background-image : -ms-linear-gradient(top, #0085ba, #2980b9);
+    background-image : -o-linear-gradient(top, #0085ba, #2980b9);
+    background-image : linear-gradient(to bottom, #0085ba, #2980b9);
+    float            : right;
+    margin: 10px !important;
+}
+.save_warehouse_form:hover{
+    background: #008ec2;
+    border-color: #006799;
+    color: #fff;
+}
+.save_warehouse_form:focus + div#en_wd_add_warehouse_btn {
+    display: none;
+}
+.already_exist{
+    background: #f1f1f1 none repeat scroll 0 0;
+    border-left: 4px solid #dc3232;
+    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+    margin: 5px 15px 2px 0px;
+    padding: 10px 12px;
+    display: none;
+}
+.warehouse_created{
+    margin-top: 20px !important;
+    display: none;
+}
+.warehouse_updated{
+    margin-top: 20px !important;
+    display: none;
+}
+.warehouse_deleted{
+    margin-top: 20px !important;
+    display: none;
+}
+.city_select_css{
+    width: 70%;
+    border-radius: 5px;
+    margin: 10px;
+}
+.city_select{
+    display: none;
+}
+
+.en_wd_zip_validation_err, .en_wd_city_validation_err, .en_wd_state_validation_err, .en_wd_country_validation_err {
+    color: #ff0000;
+    font-size: 11px;
+    font-weight: normal !important;
+    margin-top: 15px;
+    margin: 0 0px 0px 242px;
+    float: left;
+}
+
+.en_wd_err{
+    color: #ff0000;
+    font-size: 11px;
+    font-weight: normal !important;
+    margin-top: 15px;
+    margin: 0 0px 0px 242px;
+    float: left;
+}
+
+.not_allowed , .zero_results{
+    background: #f1f1f1 none repeat scroll 0 0;
+    border-left: 4px solid #dc3232;
+    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+    padding: 1px 12px;
+    display: none;
+}
+.dropship_invalid_miles_error,
+.warehouse_invalid_miles_error,
+.dynamic_warehouse_error,
+.dynamic_dropship_error,
+.wrng_credential,
+.wrng_instore,
+.wrng_local{
+    background: #f1f1f1 none repeat scroll 0 0;
+    border-left: 4px solid #dc3232;
+    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+    padding: 1px 12px;
+    display: none;
+    width: 93.5%;
+}
+
+/**
+*   Warehouse End
+**/
+
+
+/**
+*   Dropship Section
+**/
+.en_wd_dropship_list {
+    font-family: 'Arial';
+    margin: 25px auto;
+    border-collapse: collapse;
+    border: 1px solid #eee;
+    background: #fff;
+    width: 100%;
+}
+.en_wd_dropship_list  .en_wd_dropship_list_heading, .en_wd_dropship_list_data {
+    color: #555;
+    padding: 12px 35px;
+    text-align: center;
+    border-collapse: collapse;
+}
+.en_wd_dropship_list  .en_wd_dropship_list_heading {
+    background: #fff none repeat scroll 0 0;
+    border-bottom: 1px solid #e1e1e1;
+    color: #0073aa;
+    font-size: 14px;
+    font-weight: 400;
+}
+#append_dropship tbody > tr:nth-of-type(2n-1){
+    background: #f9f9f9;
+}
+.en_wd_dropship_list_data a img{
+    margin-left: 5px;
+    width: 17px;
+}
+.en_wd_add_warehouse_btn{
+    background: #298cba none repeat scroll 0 0;
+    border: medium none;
+    border-radius: 3px;
+    color: #fff;
+    padding: 7px 20px;
+    text-decoration: none;
+    text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
+    background-image: -webkit-linear-gradient(top, #0085ba, #2980b9);
+    background-image: -moz-linear-gradient(top, #0085ba, #2980b9);
+    background-image: -ms-linear-gradient(top, #0085ba, #2980b9);
+    background-image: -o-linear-gradient(top, #0085ba, #2980b9);
+    background-image: linear-gradient(to bottom, #0085ba, #2980b9);
+}
+.en_wd_add_warehouse_btn:hover{
+    background: #008ec2;
+    border-color: #006799;
+    color: #fff;
+}
+.en_wd_add_dropship_btn{
+    background: #0085ba none repeat scroll 0 0;
+    border: medium none;
+    border-radius: 3px;
+    color: #fff;
+    padding: 7px 20px;
+    text-decoration: none;
+    text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
+}
+.en_wd_add_dropship_btn:hover{
+    background: #008ec2;
+    color: #fff;
+    border-color: #006799;
+}
+.dropship_created{
+    display: none;
+}
+.dropship_updated{
+    display: none;
+}
+.dropship_deleted{
+    display: none;
+}
+
+.warehouse_text p{
+    font-size: 13px;
+}
+.break_hr{
+    margin: 50px 0;
+}
+.err{
+    color: #ff0000;
+    font-size: 13px;
+    font-weight: normal !important;
+    padding-left: 10px;
+}
+.delete_p{
+    border-bottom: 1px solid #ccc;
+    border-top: 1px solid #ccc;
+    font-size: 15px;
+    font-weight: normal;
+    padding: 25px 3px;
+}
+.del_btns{
+    margin-right: 40px;
+    text-align: right;
+    margin-top: 20px;
+}
+.cancel_delete{
+    background: #fff none repeat scroll 0 0;
+    border: 1px solid #ccc;
+    border-radius: 3px;
+    padding: 5px 10px;
+    text-decoration: none;
+}
+.cancel_delete:hover{
+    text-decoration: none;
+}
+.confirm_delete{
+    background: #008ec2;
+    border-color: #006799;
+    border-image: none;
+    border-radius: 3px;
+    border-style: solid;
+    border-width: 1px;
+    color: #fff;
+    padding: 5px 10px;
+    text-decoration: none;
+}
+.confirm_delete:hover{
+    text-decoration: none;
+    color: #fff;
+}
+
+label[for="en_wd_origin_zip"]:after, label[for="en_wd_origin_city"]:after, label[for="en_wd_origin_state"]:after, label[for="en_wd_origin_country"]:after {
+    content: " *";
+    color: red;
+}
+
+/**
+*   Dropship End
+**/
+
+/**
+*   Tagging Basic Style
+**/
+
+.en_wd_setting_section .tagging {
+    border: 1px solid #aaa;
+    font-size: 1em;
+    height: auto;
+    padding: 6px 0px 6px;
+    background: #fff;
+    width: 57.5%;
+    float: right;
+    margin: 10px;
+}
+
+.en_wd_setting_section .tagging.editable {
+    cursor: text;
+}
+
+.en_wd_setting_section .tag {
+    background: none repeat scroll 0 0 #ccc;
+    border-radius: 2px;
+    color: black;
+    cursor: default;
+    display: inline-block;
+    position: relative;
+    white-space: nowrap;
+    padding: 4px 20px 4px 4px;
+    margin: 2px 10px 2px 0;
+}
+
+.en_wd_setting_section .tag span {
+    display: none;
+}
+
+.en_wd_setting_section .tag .tag-i {
+    color: black;
+    cursor: pointer;
+    font-size: 1.3em;
+    height: 0;
+    line-height: 0.1em;
+    position: absolute;
+    right: 5px;
+    top: 0.7em;
+    text-align: center;
+    width: 10px;
+    text-decoration: none;
+}
+
+.en_wd_setting_section .tag .tag-i:hover {
+    color: black;
+    text-decoration: none;
+}
+
+.en_wd_setting_section .type-zone {
+    border: 0 none;
+    height: auto;
+    width: auto;
+    min-width: 20px;
+    display: inline-block;
+}
+
+.en_wd_setting_section .type-zone:focus {
+    outline: none;
+    background-color: #fff;
+    color: #32373c;
+}
+
+#instore-pickup-zipmatch{
+    border: 1px solid #8c8f94;
+    background-color: #fff;
+    color: #32373c;
+    border-radius: 5px;
+}
+
+#local-delivery-zipmatch{
+    border: 1px solid #8c8f94;
+    background-color: #fff;
+    color: #32373c;
+    border-radius: 5px;
+}
+
+.instore-pickup-input, .local-delivery-input{
+    width: 100%;
+    text-align: right;
+    clear: both;
+}
+
+.instore-pickup-input label, .local-delivery-input label{
+    font-weight: 600;
+    float: left;
+    line-height: 3.5;
+}
+.instore-pickup-input input, .local-delivery-input input{
+    margin: 10px;
+    width: 55%;
+    padding: 5px;
+}
+
+/**
+*   Tagging Basic Style End
+**/
+
+/**
+*   Hide btn
+**/
+
+.en_wd_setting_section .button-primary, 
+.en_shipping_rules_setting_section .button-primary,
+.en_wd_setting_section .is-primary {
+    display: none;
+}
+
+.form-btns {
+    float: right;
+    margin-top: 5px;
+    width: 100%;
+}
+
+.heading .heading_left{
+    float: left;
+}
+
+.user_guide p.submit {
+    display: none;
+}
+.heading .pakage_notify{
+    margin-right: 10px;
+    color: red;
+}
+
+.heading .hide{
+    display: none;
+}
+
+.wild_disabled_me{
+    float: left;
+    pointer-events: none;
+    opacity: 0.5;
+    /*margin-right: 18px;*/
+}
+
+.wild_warehouse a{
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    float: left;
+}
+
+.tr_disabled_me{
+    pointer-events: none;
+    opacity: 0.5;
+}
+
+.disabled_me{
+    pointer-events: none;
+    opacity: 0.5;
+    display:inherit;
+    color: #dc3232;
+}
+
+.pakage_notify a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    margin: 5px 0 0 6px;
+    display: inline-block;
+}
+._dropship_location a {
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    margin: 5px 0 0 6px ;
+    display: inline-block;
+}
+
+.pakage_notify_local_dropship a {
+    color: red;
+    margin: 0 0 0 48px;
+    text-decoration: none;
+}
+.pakage_notify_instore_warehouse a {
+    text-decoration: none;
+    color: red;
+    margin: 0 0 0 39px;
+}
+.pakage_notify_local_warehouse a{
+    text-decoration: none;
+    color: red;
+    margin: 0 0 0 48px;
+}
+.pakage_notify_instore_dropship a {
+    text-decoration: none;
+    color: red;
+    margin: 0 0 0 39px;
+}
+
+._en_hazardous_material .description a,._en_insurance_fee .description a,._dropship_location .description{
+    text-decoration: none;
+    font-size: 17px;
+    color: red;
+    font-weight: bold;
+    position: relative;
+    top:3px;
+}
+
+._en_hazardous_material .description,._en_insurance_fee .description{
+    font-style: normal;
+}
+
+.spinner_disable {
+    color: #000000;
+    pointer-events: none;
+    opacity: 0.5;
+}
+@media only screen and (max-width: 1920px) and (min-width: 1080px)  {
+
+    .en_wd_err {
+        color: #ff0000;
+        font-size: 11px;
+        font-weight: normal !important;
+        width: 59.3%;
+        float: right;
+        margin-top: -10px;
+        margin-bottom: 0px;
+
+    }
+}
+#en_wd_dropship_zip,
+#en_wd_origin_zip{
+    text-transform:uppercase;
+}
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/tagging.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/tagging.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/tagging.js	(revision 3237693)
@@ -0,0 +1,812 @@
+// taggingJS v1.3.3
+//    2014-04-28
+
+// Copyright (c) 2014 Fabrizio Fallico
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+(function( $, window, document, undefined ) {
+
+    window.alert = function() {};
+
+    /**
+     * taggingJS Constructor
+     *
+     * @param obj elem     DOM object of tag box
+     * @param obj options  Custom JS options
+     */
+    var Tagging = function( elem, options ) {
+        this.elem    = elem;          // The tag box
+        this.$elem   = $( elem );     // jQuerify tag box
+        this.options = options;       // JS custom options
+        this.tags = [];               // Here we store all tags
+    };
+
+    /**
+     * taggingJS Prototype
+     */
+    Tagging.prototype = {
+
+
+        // All special Keys
+        keys: {
+            // Special keys to add a tag
+            add: {
+                comma:    188,
+                enter:    13,
+            },
+
+            // Special keys to remove last tag
+            remove: {
+                del: 46,
+                backspace: 8,
+            }
+        },
+
+        // Default options value
+        defaults: {
+            "case-sensitive": false,                        // True to allow differences between lowercase and uppercase
+            "close-char": "&times;",                        // Single Tag close char
+            "close-class": "tag-i",                         // Single Tag close class
+            "edit-on-delete": false,                         // True to edit tag that has just been removed from tag box
+            "forbidden-chars": [ ".", "_", "?", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=" ], // Array of forbidden characters
+            "forbidden-chars-callback": window.alert,       // Function to call when there is a forbidden chars
+            "forbidden-chars-text": "Forbidden character:", // Basic text passed to forbidden-chars callback
+            "forbidden-words": [],                          // Array of forbidden words
+            "forbidden-words-callback": window.alert,       // Function to call when there is a forbidden words
+            "forbidden-words-text": "Forbidden word:",      // Basic text passed to forbidden-words callback
+            "no-backspace": false,                          // Backspace key remove last tag, true to avoid that
+            "no-comma": false,                              // Comma "," key add a new tag, true to avoid that
+            "no-del": false,                                // Delete key remove last tag, true to avoid that
+            "no-duplicate": true,                           // No duplicate in tag box
+            "no-duplicate-callback": window.alert,          // Function to call when there is a duplicate tag
+            "no-duplicate-text": "Duplicate tag:",          // Basic text passed to no-duplicate callback
+            "no-enter": false,                              // Enter key add a new tag, true to avoid that
+            "no-spacebar": false,                           // Spacebar key add a new tag by default, true to avoid that
+            "pre-tags-separator": ", ",                     // By default, you must put new tags using a new line
+            "tag-box-class": "tagging",                     // Class of the tag box
+            "tag-char": "",                                // Single Tag char
+            "tag-class": "tag",                             // Single Tag class
+            "tags-input-name": "tag",                       // Name to use as name="" in single tags (by default tag[])
+            "tag-on-blur": true,                            // Add the current tag if user clicks away from type-zone
+            "type-zone-class": "type-zone",                 // Class of the type-zone
+        },
+
+        /**
+         * Add a tag
+         *
+         * @param string            text  Text to add as tag, if null we get the content of tag box type_zone.
+         * @return boolean|funtion        true if OK; false if NO; function with some config error.
+         */
+        add: function( text ) {
+
+            var $tag, l, self,
+                index, forbidden_words,
+                callback_f, callback_t;
+
+            // Caching this
+            self = this;
+
+            // If text is an array, call add on each element
+            if ( $.isArray( text ) ) {
+                // Adding text present on type_zone as tag on first call
+                return $.each( text, function() {
+                    self.add( this + "" );
+                });
+            }
+
+            // Forbidden Words shortcut
+            forbidden_words = self.config[ "forbidden-words" ];
+
+            // If no text is passed, take it as text of $type_zone and then empty it
+            if ( ! text ) {
+                text = self.valInput();
+                self.emptyInput();
+            }
+
+            // If text is empty too, then go out
+            if ( ! text || ! text.length ) {
+                return false;
+            }
+
+            // If case-sensitive is true, write everything in lowercase
+            if ( ! self.config[ "case-sensitive" ] ) {
+            }
+
+            // Checking if text is a Forbidden Word
+            l = forbidden_words.length;
+            while ( l-- ) {
+
+                // Looking for a forbidden words
+                index = text.indexOf( forbidden_words[ l ] );
+
+                // There is a forbidden word
+                if ( index >= 0 ) {
+
+                    // Removing all text and ','
+                    self.emptyInput();
+
+                    // Renaiming
+                    callback_f = self.config[ "forbidden-words-callback" ];
+                    callback_t = self.config[ "forbidden-words-text" ];
+
+                    // Remove as a duplicate
+                    return self.throwError( callback_f, callback_t, text );
+                }
+            }
+
+            // If no-duplicate is true, check that the text is not already present
+            if ( self.config[ "no-duplicate" ] ) {
+
+                // Looking for each text inside tags
+                l = self.tags.length;
+                while ( l-- ) {
+                    if ( self.tags[ l ].pure_text === text ) {
+
+                        // Removing all text and ','
+                        self.emptyInput();
+
+                        // Renaiming
+                        callback_f = self.config[ "no-duplicate-callback" ];
+                        callback_t = self.config[ "no-duplicate-text" ];
+
+                        // Remove the duplicate
+                        return self.throwError( callback_f, callback_t, text );
+
+                    }
+                }
+            }
+
+            text = text.split(' ').join('');
+
+            // Creating a new div for the new tag
+            $tag = $( document.createElement( "div" ) )
+                .addClass( self.config[ "tag-class" ] )
+                .html(  "<span>" + self.config[ "tag-char" ] + "</span> " + text  );
+
+            // Creating and Appending hidden input
+            $( document.createElement( "input" ) )
+                .attr( "type", "hidden" )
+                // custom input name
+                .attr( "name", self.config[ "tags-input-name" ] + "[]" )
+                .val( text )
+                .appendTo( $tag );
+
+            // Creating and tag button (with "x" to remove tag)
+            $( document.createElement( "a" ) )
+                .attr( "role", "button" )
+                // adding custom class
+                .addClass( self.config[ "close-class" ] )
+                // using custom char
+                .html( self.config[ "close-char" ] )
+                // click addEventListener
+                .click(function() {
+                    self.remove( $tag );
+                })
+                // finally append close button to tag element
+                .appendTo( $tag );
+
+            // Adding pure_text and position property to $tag
+            $tag.pure_text = text;
+
+            // Adding to tags the new tag (as jQuery Object)
+            self.tags.push( $tag );
+
+            // Adding tag in the type zone
+            self.$type_zone.before( $tag );
+
+            return true;
+        },
+
+        /**
+         * Add a special keys
+         *
+         * @param  array       arr  Array like ['type', obj], where 'type' is 'add' or 'remove', obj is { key_name: key_num }
+         * @return string|obj       Error message or actually 'type'_key (add_key or remove_key).
+         */
+        addSpecialKeys: function( arr ) {
+
+            var self, value, to_add, obj, type;
+
+            self   = this;
+            type   = arr[0];
+            obj    = arr[1];
+            to_add = {};
+
+            // If obj is an array, call addSpecialKeys on each element
+            if ( $.isArray( obj ) ) {
+                return $.each( obj, function() {
+                    self.addSpecialKeys( [ type, this ] );
+                });
+            }
+
+            // Check if obj is really an object
+            // @link http://stackoverflow.com/a/16608045
+            if ( ( ! obj ) && ( obj.constructor !== Object ) ) {
+                return "Error -> The second argument is not an Object!";
+            }
+
+            for ( value in obj ) {
+                if ( obj.hasOwnProperty( value ) ) {
+                    // @link stackoverflow.com/a/3885844
+                    if ( obj[ value ] === +obj[ value ] && obj[ value ] === ( obj[ value ]|0 ) ) {
+                        $.extend( to_add, obj );
+                    }
+                }
+            }
+
+            self.keys[ type ] = $.extend( {}, to_add, self.keys[ type ] );
+
+            return self.keys[ type ];
+        },
+
+        /**
+         * Opposite of init, remove type_zone, all tags and other things.
+         *
+         * @return boolean
+         */
+        destroy: function() {
+
+            // Removing the type-zone
+            this.$elem.find( "." + this.config[ "type-zone-class" ] ).remove();
+
+            // Removing all tags
+            this.$elem.find( "." + this.config[ "tag-class" ] ).remove();
+
+            // Destroy tag-box parameters
+            this.$elem.data( "tag-box", null );
+
+            // Exit with success
+            return true;
+        },
+
+        /**
+         * Empty tag box's type_zone
+         *
+         * @return $_obj       The type_zone itself
+         */
+        emptyInput: function() {
+
+            this.focusInput();
+
+            return this.valInput( "" );
+        },
+
+        /**
+         * Trigger focus on tag box's input
+         *
+         * @return $_obj The tag box's input
+         */
+        focusInput: function() {
+
+            return this.$type_zone.focus();
+        },
+
+        /**
+         * Get Data attributes custom options
+         *
+         * @return object  Tag-box data attributes options
+         */
+        getDataOptions: function() {
+
+            var key, data_option, data_options;
+
+            // Here we store all data_options
+            data_options = {};
+
+            // For each option
+            for ( key in this.defaults ) {
+
+                // Getting value
+                data_option = this.$elem.data( key );
+
+                // Checking if it is not undefined
+                if ( data_option ) {
+
+                    // Saving in data_options object
+                    data_options[ key ] = data_option;
+
+                }
+            }
+
+            return data_options;
+        },
+
+        /**
+         * Return all special keys inside an object (without distinction)
+         *
+         * @return obj
+         */
+        getSpecialKeys: function() {
+            return $.extend( {}, this.keys.add, this.keys.remove );
+        },
+
+        /**
+         * Return all special keys inside an object (with distinction)
+         *
+         * @return obj
+         */
+        getSpecialKeysD: function() {
+            return this.keys;
+        },
+
+        /**
+         * Return all tags as string
+         *
+         * @return array   All tags as member of strings.
+         */
+        getTags: function() {
+
+            var all_txt_tags, i, l;
+
+            l = this.tags.length;
+            all_txt_tags = [];
+
+            for ( i = 0; i < l; i += 1 ) {
+                all_txt_tags.push( this.tags[ i ].pure_text );
+            }
+
+            return all_txt_tags;
+        },
+
+        /**
+         * Return all tags as object
+         *
+         * @return array   All tags as member of objects.
+         */
+        getTagsObj: function() {
+
+            return this.tags;
+        },
+
+        /**
+         * Return string is numeric or not
+         *
+         * @return string
+         */
+        isNumeric: function (n) {
+            return !isNaN(parseFloat(n)) && isFinite(n);
+        },
+
+        /**
+         * Init method to bootstrap all things
+         *
+         * @return $_obj   The jQuerify tag box
+         */
+        init: function() {
+
+            var init_text, self, text;
+
+            self = this;
+
+            // Getting all data Parameters to fully customize the single tag box selecteds
+            self.config = $.extend( {}, self.defaults, self.options, self.getDataOptions() );
+
+            // Pre-existent text
+            init_text = self.$elem.text();
+
+            // Empty the original div
+            self.$elem.empty();
+
+            // Create the type_zone input using custom class and contenteditable attribute
+            self.$type_zone = $( document.createElement( "input" ) )
+                .addClass( self.config[ "type-zone-class" ] )
+                .attr( "contenteditable", true )
+                .attr('maxlength','7')
+                .attr( "onkeydown", "stopSpecialCharacters(event)" )
+                .attr( "onkeyup", "en_valid_zip_code(event,this.value)" );
+
+            // Adding tagging class and appending the type zone
+            self.$elem
+                .addClass( self.config[ "tag-box-class" ] )
+                .append( self.$type_zone );
+
+            // Keydown event listener on tag box type_zone
+            self.$type_zone.keydown(function( e ) {
+                var key, index, l, pressed_key, all_keys,
+                    forbidden_chars, actual_text,
+                    callback_f, callback_t;
+
+                all_keys = self.getSpecialKeys();
+
+                // Forbidden Chars shortcut
+                forbidden_chars = self.config[ "forbidden-chars" ];
+
+                // Actual text in the type_zone
+                actual_text     = self.valInput();
+
+                // The pressed key
+                pressed_key     = e.which;
+
+                self.$type_zone.keyup(function( e ) {
+
+                    var actual_value = $(this).val();
+
+                    if(actual_value.length > 4 && self.isNumeric(actual_value))
+                    {
+                        // Prevent Default
+                        e.preventDefault();
+                        self.valInput( actual_value.slice(0,5) );
+                    }
+                });
+
+                // For in loop to look to Remove Keys
+                if ( ! actual_text ) {
+
+                    for ( key in all_keys ) {
+
+                        // Some special key
+                        if ( pressed_key === all_keys[ key ] ) {
+
+                            // Enter or comma or spacebar - We cannot add an empty tag
+                            if ( self.keys.add[ key ] ) {
+
+                                // Prevent Default
+                                e.preventDefault();
+
+                                // Exit with 'true'
+                                return true;
+                            }
+
+                            // Backspace or Del
+                            if ( self.keys.remove[ key ] ) {
+
+                                // Checking if it enabled
+                                if ( ! self.config[ "no-" + key ] ) {
+
+                                    // Prevent Default
+                                    e.preventDefault();
+
+                                    return self.remove();
+
+                                }
+                            }
+                        }
+                    }
+                } else {
+
+                    // For loop to remove Forbidden Chars from Text
+                    l = forbidden_chars.length;
+                    while ( l-- ) {
+
+                        // Looking for a forbidden char
+                        index = actual_text.indexOf( forbidden_chars[ l ] );
+
+                        // There is a forbidden text
+                        if ( index >= 0 ) {
+
+                            // Prevent Default
+                            e.preventDefault();
+
+                            // Removing Forbidden Char
+                            actual_text = actual_text.replace( forbidden_chars[ l ], "" );
+
+                            // Update type_zone text
+                            self.focusInput();
+                            self.valInput( actual_text );
+
+                            // Renaiming
+                            callback_f = self.config[ "forbidden-chars-callback" ];
+                            callback_t = self.config[ "forbidden-chars-text" ];
+
+                            // Remove the duplicate
+                            return self.throwError( callback_f, callback_t, forbidden_chars[ l ] );
+                        }
+                    }
+
+                    // For in to look in Add Keys
+                    for ( key in self.keys.add ) {
+
+                        // Enter or comma or spacebar if enabled
+                        if ( pressed_key === self.keys.add[ key ] ) {
+
+                            if ( ! self.config[ "no-" + key ] ) {
+
+                                // Prevent Default
+                                e.preventDefault();
+
+                                // Adding tag with no text
+                                return self.add();
+                            }
+                        }
+                    }
+                }
+
+                // Exit with success
+                return true;
+            });
+
+            // Add tag on a click away from the type_zone
+            if ( self.config[ "tag-on-blur" ] ) {
+                self.$type_zone.focusout(function() {
+
+                    // Get text from current input box
+                    text = self.valInput();
+
+                    // If text is empty, then continue focusout
+                    if ( ! text || ! text.length ) {
+                        return false;
+                    }
+
+                    // Otherwise add the tag first
+                    return self.add();
+                });
+            }
+
+            // On click, we focus the type_zone
+            self.$elem.on( "click", function() {
+                self.focusInput();
+            });
+
+            // Refresh tag box using refresh public method with a text
+            self.refresh( init_text );
+
+            // We don't break the chain, right?
+            return self;
+        },
+
+        /**
+         * Remove and insert all tag
+         *
+         * @param  string  text String with all tags (if null, simply we call getTags method)
+         * @return boolean
+         */
+        refresh: function( text ) {
+
+            var self, separator;
+
+            self = this;
+            separator = self.config[ "pre-tags-separator" ];
+
+            text = text || self.getTags().join( separator );
+
+            self.reset();
+
+            // Adding text present on type_zone as tag on first call
+            $.each( text.split( separator ), function() {
+                self.add( this + "" );
+            });
+
+            return true;
+        },
+
+        /**
+         * Remove last tag in tag box's type_zone or a specified one.
+         *
+         * @param  string|$_obj         The text of tag to remove or the $_obj of itself.
+         * @return string|$_obj         An error if the tag is not found, or the $_obj of removed tag.
+         */
+        remove: function( $tag ) {
+
+            var self, text, l;
+
+            self = this;
+
+            // If $tag is an array, call remove on each element
+            if ( $.isArray( $tag ) ) {
+                // Adding text present on type_zone as tag on first call
+                return $.each( $tag, function() {
+                    self.remove( this + "" );
+                });
+            }
+
+            // If $tag is a string, we must find the $_obj of the tag
+            if ( typeof $tag === "string" ) {
+
+                // Renaiming
+                text = $tag;
+
+                // Retrieving the $_obj of the tag
+                $tag = self.$elem.find( "input[value=" + text + "]" ).parent();
+
+                // If nothing is found, return an error
+                if ( ! $tag.length ) {
+                    return "Error -> Tag not found";
+                }
+            }
+
+            // Not specified any tags
+            if ( ! $tag ) {
+
+                // Retrieving the last
+                $tag = self.tags.pop();
+
+            } else {
+
+                // Iterate the tags array and removing the specified tags
+                l = self.tags.length;
+                while ( l-- ) {
+                    // Confront the content of $tag and the tags array
+                    if ( self.tags[ l ][0].innerHTML === $tag[0].innerHTML ) {
+                        // Removing definitively
+                        self.tags.splice( l, 1 );
+                    }
+                }
+            }
+
+            // Getting text if not alredy setted
+            // text = text || $tag.pure_text;
+
+            // Removing last tag
+            $tag.remove();
+
+            // If you want to change the text when a tag is deleted
+            if ( self.config[ "edit-on-delete" ] ) {
+
+                // Empting input
+                self.emptyInput();
+
+                // Set the new text
+                self.valInput( $tag.pure_text );
+            }
+
+            return $tag;
+
+        },
+
+        /**
+         * Alias of reset
+         *
+         * @return array  All removed tags
+         */
+        removeAll: function() {
+
+            return this.reset();
+        },
+
+        /**
+         * Remove a special keys
+         *
+         * @param  array  arr  Array like ['type', key_code], where 'type' is 'add' or 'remove', key_code is the key number
+         * @return obj         Actually 'type'_key (add_key or remove_key).
+         */
+        removeSpecialKeys: function( arr ) {
+
+            var self, value, to_add, key_code, type;
+
+            self     = this;
+            type     = arr[0];
+            key_code = arr[1];
+            to_add   = {};
+
+            // If key_code is an array, call removeSpecialKeys on each element
+            if ( $.isArray( key_code ) ) {
+                return $.each( key_code, function() {
+                    self.removeSpecialKeys( [ type, this ] );
+                });
+            }
+
+            // Iterate proper array
+            for ( value in self.keys[ type ] ) {
+                if ( self.keys[ type ].hasOwnProperty( value ) ) {
+
+                    // If the key_code is equal to the actual key_code
+                    if ( self.keys[ type ][ value ] === key_code ) {
+                        // We set to undefined the property
+                        self.keys[ type ][ value ] = undefined;
+                    }
+                }
+            }
+
+            return self.keys[ type ];
+        },
+
+        /**
+         * Remove all tags from tag box's type_zone
+         *
+         * @return array  All removed tags
+         */
+        reset: function() {
+
+            while (this.tags.length ) {
+                this.remove( this.tags[ this.tags.length ] );
+            }
+
+            this.emptyInput();
+
+            return this.tags;
+
+        },
+
+        /**
+         * Raise a callback with some text
+         *
+         * @param  function callback_f Callback function
+         * @param  string   callback_t Basic text
+         * @param  string   tag_text   Tag text
+         * @return function
+         */
+        throwError: function( callback_f, callback_t, tag_text ) {
+            // Calling the callback with t as th
+            return callback_f( [ callback_t + " '" + tag_text + "'." ] );
+        },
+
+        /**
+         * Get or Set the tag box type_zone's value
+         *
+         * @param  string        text String to put as tag box type_zone's value
+         * @return string|$_obj       The value of tag box's type_zone or the type_zone itself
+         */
+        valInput: function( text ) {
+
+            if ( text == null ) {
+                return this.$type_zone.val();
+            }
+
+            return this.$type_zone.val( text );
+
+        },
+
+    };
+
+    /**
+     * Registering taggingJS
+     *
+     * @param  obj|string arg1 Object with custom options or string with a method
+     * @param  string     arg2 Argument to pass to the method
+     * @return $_Obj           All tag-box or result from "arg2" public method.
+     */
+    $.fn.tagging = function( arg1, arg2 ) {
+        var results = [];
+
+        this.each(function() {
+            var $this, tagging, val;
+
+            $this   = $( this );
+            tagging = $this.data( "tag-box" );
+
+            // Initialize a new tags input
+            if ( ! tagging ) {
+
+                tagging = new Tagging( this, arg1 );
+
+                $this.data( "tag-box", tagging );
+
+                tagging.init();
+
+                results.push( tagging.$elem );
+
+            } else {
+
+                // Invoke function on existing tags input
+                val = tagging[ arg1 ]( arg2 );
+
+                if ( val ) {
+                    results.push( val );
+                }
+            }
+        });
+
+        if ( typeof arg1 === "string") {
+            // Return the results from the invoked function calls
+            return ( results.length > 1 ) ? results : results[0];
+        }
+
+        return results;
+    };
+
+})( window.jQuery, window, document );
+
+// jQuery on Ready example
+(function( $, window, document, undefined ) {
+    $( document ).ready(function() {
+        var t = $( ".tagging-js" ).tagging();
+        t.length > 0 ? t[0].addClass( "form-control" ) : "";
+        window.alert = function() {};
+    });
+})( window.jQuery, window, document );
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/warehouse_section.js
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/warehouse_section.js	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/assets/js/warehouse_section.js	(revision 3237693)
@@ -0,0 +1,774 @@
+jQuery(document).ready(function () {
+    // Origin terminal address
+    jQuery("#en_wd_origin_address,#en_wd_dropship_address").keypress(function (e) {
+        if (!String.fromCharCode(e.keyCode).match(/^[a-z\d\-_,.\s]+$/i)) return false;
+    });
+    // Terminal phone number
+    jQuery(".en-phone-number").keypress(function (e) {
+        if (!String.fromCharCode(e.keyCode).match(/^[0-9\d\-+\s]+$/i)) return false;
+    });
+
+    jQuery("._en_hazardous_material").closest('p').addClass('_en_hazardous_material');
+    jQuery("._en_insurance_fee").closest('p').addClass('_en_insurance_fee');
+
+    jQuery(".disabled_me").on('click', function () {
+        return false;
+    });
+
+    jQuery("#instore-pickup-address , #local-delivery-address , #local-delivery-fee").keydown(function (e) {
+        // Allow: backspace, delete, tab, escape, enter and .
+        if (jQuery.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
+                // Allow: Ctrl+A, Command+A
+                        (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
+                        // Allow: home, end, left, right, down, up
+                                (e.keyCode >= 35 && e.keyCode <= 40)) {
+                    // let it happen, don't do anything
+                    return;
+                }
+                // Ensure that it is a number and stop the keypress
+                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
+                    e.preventDefault();
+                }
+            });
+});
+
+/**
+ * Round values
+ * @param {type} el
+ * @returns {undefined}
+ */
+if (typeof validate_delivery_fee != 'function')
+{
+    function validate_delivery_fee(el)
+    { 
+        const v = el.value;
+        el.value = (isNaN(v)) ? '' : v; 
+    }
+}
+
+/**
+ * Round values
+ * @param {type} el
+ * @returns {undefined}
+ */
+if (typeof get_parameter_by_name != 'function')
+{
+    function get_parameter_by_name(name) {
+        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
+        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
+                results = regex.exec(location.search);
+        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+    }
+}
+
+/**
+ * Validate Input String
+ */
+if (typeof validateString != 'function')
+{
+    function validateString(string)
+    {
+        if (string == '')
+            return 'empty';
+        else
+            return true;
+
+    }
+}
+
+/**
+ * Eniture Validation Form JS
+ */
+if (typeof enWdValidateInput != 'function')
+{
+    function enWdValidateInput(form_id)
+    {
+        var has_err = true;
+        jQuery(form_id + " input[type='text']").each(function () {
+            var input = jQuery(this).val();
+            var response = validateString(input);
+            var errorText = jQuery(this).attr('title');
+            var optional = jQuery(this).data('optional');
+
+            var errorElement = jQuery(this).parent().find('.en_wd_err');
+            jQuery(errorElement).html('');
+
+            optional = (optional === undefined) ? 0 : 1;
+            errorText = (errorText != undefined) ? errorText : '';
+
+            if ((optional == 0) && (response == false || response == 'empty'))
+            {
+                errorText = (response == 'empty') ? errorText + ' is required.' : 'Invalid input.';
+                jQuery(errorElement).html(errorText);
+            }
+            has_err = (response != true && optional == 0) ? false : has_err;
+        });
+        return has_err;
+    }
+}
+
+/**
+ *
+ * @param {type} evt
+ * @return {Boolean}
+ */
+if (typeof instorePickupDeliveryValidateNum != 'function')
+{
+    function instorePickupDeliveryValidateNum(e)
+    {
+        var val = this.value;
+        var re = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)$/g;
+        var re1 = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)/g;
+        if (re.test(val)) {
+            //do something here
+
+        } else {
+            val = re1.exec(val);
+            if (val) {
+                this.value = val[0];
+            } else {
+                this.value = "";
+            }
+        }
+    }
+}
+
+/**
+ * Check input field length
+ * @param {type} len
+ * @param {type} ele
+ * @return {Boolean}
+ */
+if (typeof checkLength != 'function')
+{
+    function checkLength(len, ele)
+    {
+        var fieldLength = ele.value.length;
+        if (fieldLength <= len) {
+            return true;
+        } else
+        {
+            var str = ele.value;
+            str = str.substring(0, str.length - 1);
+            ele.value = str;
+        }
+    }
+}
+
+
+/**
+ * Will remove all falsy values: undefined, null, 0, false, NaN and "" (empty string)
+ * @param {type} actual
+ * @return {Array|cleanArray.newArray}
+ */
+if (typeof cleanArray != 'function')
+{
+    function cleanArray(actual)
+    {
+        var newArray = new Array();
+        for (var i = 0; i < actual.length; i++) {
+            if (actual[i]) {
+                newArray.push(actual[i].replace('×', ''));
+            }
+        }
+        return newArray;
+    }
+}
+
+if (typeof reset_warehouse_popup_form != 'function')
+{
+    function reset_warehouse_popup_form()
+    {
+        jQuery('#add_warehouses').find("input[type='text']").val("");
+        jQuery('#add_warehouses').find("input[type='checkbox']").prop('checked', false);
+        jQuery('#instore-pickup-zipmatch .tag-i, #local-delivery-zipmatch .tag-i').trigger('click');
+    }
+}
+
+/**
+ * get tags input zip codes
+ * @return {String|instorePickupLocalDeliveryZipmatch.zipmatch}
+ */
+if (typeof instorePickupLocalDeliveryZipmatch != 'function')
+{
+    function instorePickupLocalDeliveryZipmatch(zipId)
+    {
+        var allZipString = jQuery(zipId).children().text();
+        var allZipArray = allZipString.split(" ");
+        var newZipArr = cleanArray(allZipArray);
+        var zips = newZipArr.toString();
+        return zips;
+    }
+}
+
+/**
+ * instore pickup input val
+ * @return {instorePickupInputVal.instorePickup}
+ */
+if (typeof instorePickupInputVal != 'function')
+{
+    function instorePickupInputVal(formID)
+    {
+        var deliveryZipId = formID + ' #instore-pickup-zipmatch';
+        var pickupZipmatch = instorePickupLocalDeliveryZipmatch(deliveryZipId);
+        var instorePickup = {
+            'enable_instore': jQuery(formID + ' #enable-instore-pickup').is(':checked'),
+            'address_miles_instore': jQuery(formID + ' #instore-pickup-address').val(),
+            'zipmatch_instore': pickupZipmatch,
+            'desc_instore': jQuery(formID + ' #instore-pickup-desc').val(),
+            // Terminal phone number
+            'phone_instore': jQuery(formID + ' #en-phone-number').val()
+        };
+
+        return instorePickup;
+    }
+}
+
+/**
+ * local delivery input val
+ * @return {instorePickupInputVal.instorePickup}
+ */
+if (typeof localDeliveryInputVal != 'function')
+{
+    function localDeliveryInputVal(formID)
+    {
+        var deliveyZipId = formID + ' #local-delivery-zipmatch';
+        var deliveryZipMatch = instorePickupLocalDeliveryZipmatch(deliveyZipId);
+        var localDelivery = {
+            'enable_delivery': jQuery(formID + ' #enable-local-delivery').is(':checked'),
+            'address_miles_delivery': jQuery(formID + ' #local-delivery-address').val(),
+            'zipmatch_delivery': deliveryZipMatch,
+            'desc_delivery': jQuery(formID + ' #local-delivery-desc').val(),
+            'fee_delivery': jQuery(formID + ' #local-delivery-fee').val(),
+            'supppress_delivery': jQuery(formID + ' #suppress-local-delivery').is(':checked')
+        };
+
+        return localDelivery;
+    }
+}
+
+
+/**
+ * merge all objects of warehouse
+ * @param {type} arrObj
+ * @return {unresolved}
+ */
+if (typeof mergeWarehouseSectionObjects != 'function')
+{
+    function mergeWarehouseSectionObjects(arrObj)
+    {
+        var resultObject = arrObj.reduce(function (result, currentObject) {
+            for (var key in currentObject) {
+                if (currentObject.hasOwnProperty(key)) {
+                    result[key] = currentObject[key];
+                }
+            }
+            return result;
+        }, {});
+
+        return resultObject;
+    }
+}
+
+/**
+ *
+ * @param {type} data
+ * @return {undefined}
+ */
+if (typeof load_inside_pikup_and_local_delivery_data != 'function')
+{
+    function load_inside_pikup_and_local_delivery_data(data, formID)
+    {
+        jQuery('' + formID + ' #instore-pickup-zipmatch .tag-i, ' + formID + ' #local-delivery-zipmatch .tag-i').trigger('click');
+
+        (data[0].enable_store_pickup == 1) ? jQuery(formID + ' #enable-instore-pickup').prop('checked', true) : '';
+        (data[0].enable_local_delivery == 1) ? jQuery(formID + ' #enable-local-delivery').prop('checked', true) : '';
+        (data[0].suppress_local_delivery == 1) ? jQuery(formID + ' #suppress-local-delivery').prop('checked', true) : '';
+
+        jQuery(formID + ' #instore-pickup-desc').val(data[0].checkout_desc_store_pickup);
+        // Terminal phone number
+        jQuery(formID + ' #en-phone-number').val(data[0].phone_instore);
+        jQuery(formID + ' #local-delivery-desc').val(data[0].checkout_desc_local_delivery);
+        jQuery(formID + ' #local-delivery-fee').val(data[0].fee_local_delivery);
+
+        var storePickupZipArray = data[0].match_postal_store_pickup.split(',');
+
+        jQuery.each(storePickupZipArray, function (index, value) {
+            jQuery(formID + " #instore-pickup-zipmatch .type-zone").val(value).focusout();
+        });
+
+        var localDeliveryZipArray = data[0].match_postal_local_delivery.split(',');
+        jQuery.each(localDeliveryZipArray, function (index, value) {
+            jQuery(formID + " #local-delivery-zipmatch .type-zone").val(value).focusout();
+        });
+
+        jQuery(formID + ' #instore-pickup-address').val(data[0].miles_store_pickup);
+        jQuery(formID + ' #local-delivery-address').val(data[0].miles_local_delivery);
+
+    }
+}
+
+if (typeof en_wd_check_postal_length != 'function')
+{
+    function en_wd_check_postal_length(html_id)
+    {
+        return jQuery(html_id).children().text().length == 0 ? true : false;
+    }
+}
+
+
+/**
+ * Warehouse Section Script Start
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_save_warehouse != 'function')
+{
+    function en_ups_small_wd_save_warehouse()
+    {
+        var validate = enWdValidateInput("#add_warehouses");
+
+        var enable_local_delivery = jQuery('#add_warehouses #enable-local-delivery').is(':checked');
+        var local_delivary_fee = jQuery("#add_warehouses #local-delivery-fee").val();
+
+        switch (true)
+        {
+            case (validate == false):
+                jQuery('.content').delay(200).animate({scrollTop: 0}, 300);
+                return false;
+        }
+
+        var city = jQuery('#en_wd_origin_city').val();
+        var tab = get_parameter_by_name('tab');
+
+        var postForm = {
+            'action': 'en_ups_small_wd_save_warehouse',
+            'origin_id': jQuery('#edit_form_id').val(),
+            'origin_city': city,
+            'origin_state': jQuery('#en_wd_origin_state').val(),
+            // Origin terminal address
+            'origin_address': jQuery('#en_wd_origin_address').val(),
+            'origin_zip': jQuery('#en_wd_origin_zip').val(),
+            'origin_country': jQuery('#en_wd_origin_country').val(),
+            'origin_markup': jQuery('#en_wd_origin_markup').val(),
+            'location': jQuery('#en_wd_location').val(),
+            'tab': tab,
+            // preferred origin
+            'pref_loc_lfq': jQuery('#add_warehouses #pref_loc_lfq').val(),
+            'pref_loc_spq': jQuery('#add_warehouses #pref_loc_spq').val(),
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+
+        var form_id = "#add_warehouses";
+        var arrObj = [postForm, instorePickupInputVal(form_id), localDeliveryInputVal(form_id)];
+        var whData = mergeWarehouseSectionObjects(arrObj);
+        postForm = whData;
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            beforeSend: function () {
+                jQuery('.save_warehouse_form').addClass('spinner_disable').val("Loading ..");
+            },
+            success: function (data)
+            {
+                jQuery('.save_warehouse_form').removeClass('spinner_disable').val("Save");
+                var WarehpuseDataId = data.id;
+                if (data.insert_qry == 1) {
+
+                    jQuery(".add_btn_warehouse").html(data.html);
+
+                    jQuery('.warehouse_created').show('slow').delay(5000).hide('slow');
+                    jQuery('.warehouse_updated').css('display', 'none');
+                    jQuery('.warehouse_deleted').css('display', 'none');
+                    jQuery('.dropship_deleted').css('display', 'none');
+                    jQuery('.dropship_updated').css('display', 'none');
+                    jQuery('.dropship_created').css('display', 'none');
+                    window.location.href = jQuery('.close').attr('href');
+
+                } else if (data.update_qry == 1) {
+
+                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_warehouse_list_data">' + data.origin_city + '</td><td class="en_wd_warehouse_list_data">' + data.origin_state + '</td><td class="en_wd_warehouse_list_data">' + data.origin_zip + '</td><td class="en_wd_warehouse_list_data">' + data.origin_country + '</td><td class="en_wd_warehouse_list_data"><a href="javascript(0)" title="Edit" onclick="return en_ups_small_wd_edit_warehouse(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_ups_small_wd_delete_current_warehouse(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
+                    jQuery('.warehouse_updated').show('slow').delay(5000).hide('slow');
+                    jQuery('.warehouse_deleted').css('display', 'none');
+                    jQuery('.dropship_deleted').css('display', 'none');
+                    jQuery('.dropship_updated').css('display', 'none');
+                    jQuery('.dropship_created').css('display', 'none');
+                    window.location.href = jQuery('.close').attr('href');
+                } else {
+                    jQuery('.already_exist').show('slow');
+                    jQuery('.content').delay(200).animate({scrollTop: 0}, 300);
+                    setTimeout(function () {
+                        jQuery('.already_exist').hide('slow');
+                    }, 5000);
+                }
+            },
+        });
+        return false;
+    }
+}
+
+/**
+ * Delete Warehouse
+ * @param e
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_delete_current_warehouse != 'function')
+{
+    function en_ups_small_wd_delete_current_warehouse(e)
+    {
+        var tab = get_parameter_by_name('tab');
+        var postForm = {
+            'action': 'en_ups_small_wd_delete_warehouse',
+            'delete_id': e,
+            'tab': tab,
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            success: function (data)
+            {
+                if (data.length > 1) {
+
+                    jQuery(".add_btn_warehouse").html(data);
+                    jQuery('#row_' + e).remove();
+                    jQuery('.warehouse_deleted').show('slow').delay(5000).hide('slow');
+                    jQuery('.warehouse_updated').css('display', 'none');
+                    jQuery('.warehouse_created').css('display', 'none');
+                    jQuery('.dropship_deleted').css('display', 'none');
+                    jQuery('.dropship_updated').css('display', 'none');
+                    jQuery('.dropship_created').css('display', 'none');
+
+
+                }
+            },
+        });
+        return false;
+    }
+}
+
+/**
+ * Edit Warehouse
+ * @param e
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_edit_warehouse != 'function')
+{
+    function en_ups_small_wd_edit_warehouse(e)
+    {
+        console.log('en_ups_small_wd_edit_warehouse');
+        var postForm = {
+            'action': 'en_ups_small_wd_edit_warehouse',
+            'edit_id': e,
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            success: function (data)
+            {
+                if (data[0]) {
+                    jQuery('#add_warehouses')[0].reset();
+                    // preferred origin
+                    jQuery('#add_warehouses #pref_loc_lfq').val(data[0].pref_loc_lfq);
+                    jQuery('#add_warehouses #pref_loc_spq').val(data[0].pref_loc_spq);
+                    jQuery('#edit_form_id').val(data[0].id);
+                    jQuery('#en_wd_origin_zip').val(data[0].zip);
+                    jQuery('.city_select').hide();
+                    jQuery('#en_wd_origin_city').val(data[0].city);
+                    jQuery('.city_input').show();
+                    jQuery('#en_wd_origin_city').css('background', 'none');
+                    jQuery('#en_wd_origin_state').val(data[0].state);
+                    // Origin terminal address
+                    jQuery('#en_wd_origin_address').val(data[0].address);
+                    jQuery('#en_wd_origin_country').val(data[0].country);
+                    jQuery('#en_wd_origin_markup').val(data[0].origin_markup);
+                    jQuery('.en_wd_zip_validation_err').hide();
+                    jQuery('.en_wd_city_validation_err').hide();
+                    jQuery('.en_wd_state_validation_err').hide();
+                    jQuery('.en_wd_country_validation_err').hide();
+                    window.location.href = jQuery('.en_wd_add_warehouse_btn').attr('href');
+                    jQuery('.already_exist').hide();
+                    jQuery(".en_wd_err").html("");
+                    setTimeout(function () {
+                        if (jQuery('.en_wd_add_warehouse_popup').is(':visible')) {
+                            jQuery('.en_wd_add_warehouse_input > input').eq(0).focus();
+                        }
+                    }, 100);
+
+                    load_inside_pikup_and_local_delivery_data(data, "#add_warehouses");
+                }
+            },
+        });
+        return false;
+    }
+}
+
+/**
+ * Dropship Section Script Start
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_save_dropship != 'function')
+{
+    function en_ups_small_wd_save_dropship()
+    {
+
+        var validate = enWdValidateInput("#add_dropships");
+
+        var enable_local_delivery = jQuery('#add_dropships  #enable-local-delivery').is(':checked');
+        var dropship_local_delivary_fee = jQuery("#add_dropships #local-delivery-fee").val();
+
+        switch (true)
+        {
+            case (validate == false):
+                jQuery('.content').delay(200).animate({scrollTop: 0}, 300);
+                return false;
+        }
+
+        var city = jQuery('#en_wd_dropship_city').val();
+        var tab = get_parameter_by_name('tab');
+
+        var postForm = {
+            'action': 'en_ups_small_wd_save_dropship',
+            'dropship_id': jQuery('#edit_dropship_form_id').val(),
+            'dropship_city': city,
+            'nickname': jQuery('#en_wd_dropship_nickname').val(),
+            'dropship_state': jQuery('#en_wd_dropship_state').val(),
+            // Origin terminal address
+            'dropship_address': jQuery('#en_wd_dropship_address').val(),
+            'dropship_zip': jQuery('#en_wd_dropship_zip').val(),
+            'dropship_country': jQuery('#en_wd_dropship_country').val(),
+            'origin_markup': jQuery('#en_wd_dropship_markup').val(),
+            'location': jQuery('#en_wd_dropship_location').val(),
+            'tab': tab,
+            // preferred origin
+            'pref_loc_lfq': jQuery('#add_dropships #pref_loc_lfq').val(),
+            'pref_loc_spq': jQuery('#add_dropships #pref_loc_spq').val(),
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+
+        var form_id = "#add_dropships";
+
+        var arrObj = [postForm, instorePickupInputVal(form_id), localDeliveryInputVal(form_id)];
+        var whData = mergeWarehouseSectionObjects(arrObj);
+
+        postForm = whData;
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            beforeSend: function () {
+                jQuery('.save_warehouse_form').addClass('spinner_disable').val("Loading ..");
+            },
+            success: function (data)
+            {
+                jQuery('.save_warehouse_form').removeClass('spinner_disable').val("Save");
+                var WarehpuseDataId = data.id;
+                if (data.insert_qry == 1) {
+
+                    jQuery(".add_btn_dropship").html(data.html);
+                    jQuery('.dropship_created').show('slow').delay(5000).hide('slow');
+                    jQuery('.dropship_updated').css('display', 'none');
+                    jQuery('.dropship_deleted').css('display', 'none');
+                    jQuery('.warehouse_deleted').css('display', 'none');
+                    jQuery('.warehouse_updated').css('display', 'none');
+                    jQuery('.warehouse_created').css('display', 'none');
+                    window.location.href = jQuery('.close').attr('href');
+
+                } else if (data.update_qry == 1) {
+                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_dropship_list_data">' + data.nickname + '</td><td class="en_wd_dropship_list_data">' + data.origin_city + '</td><td class="en_wd_dropship_list_data">' + data.origin_state + '</td><td class="en_wd_dropship_list_data">' + data.origin_zip + '</td><td class="en_wd_dropship_list_data">' + data.origin_country + '</td><td class="en_wd_dropship_list_data"><a href="javascript(0)" title="Edit" onclick="return en_ups_small_wd_edit_dropship(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_ups_small_wd_delete_current_dropship(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
+                    jQuery('.dropship_updated').show('slow').delay(5000).hide('slow');
+                    jQuery('.dropship_created').css('display', 'none');
+                    jQuery('.dropship_deleted').css('display', 'none');
+                    jQuery('.warehouse_deleted').css('display', 'none');
+                    jQuery('.warehouse_updated').css('display', 'none');
+                    jQuery('.warehouse_created').css('display', 'none');
+                    window.location.href = jQuery('.close').attr('href');
+
+                } else {
+                    jQuery('.already_exist').show('slow');
+                    jQuery('.content').delay(200).animate({scrollTop: 0}, 300);
+                    setTimeout(function () {
+                        jQuery('.already_exist').hide('slow');
+                    }, 5000);
+                }
+
+                jQuery('html, body').animate({
+                    scrollTop: jQuery(".en_wd_add_dropship_btn").offset().top
+                }, 1000);
+            },
+        });
+        return false;
+    }
+}
+
+/**
+ * Edit Dropship
+ * @param e
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_edit_dropship != 'function')
+{
+    function en_ups_small_wd_edit_dropship(e)
+    {
+        var postForm = {
+            'action': 'en_ups_small_wd_edit_dropship',
+            'dropship_edit_id': e,
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            success: function (data)
+            {
+                if (data[0]) {
+                    jQuery('#add_dropships')[0].reset();
+                    // preferred origin
+                    jQuery('#add_dropships #pref_loc_lfq').val(data[0].pref_loc_lfq);
+                    jQuery('#add_dropships #pref_loc_spq').val(data[0].pref_loc_spq);
+                    jQuery('#edit_dropship_form_id').val(data[0].id);
+                    jQuery('#en_wd_dropship_zip').val(data[0].zip);
+                    jQuery('.city_select').hide();
+                    jQuery('#en_wd_dropship_nickname').val(data[0].nickname);
+                    jQuery('#en_wd_dropship_city').val(data[0].city);
+                    jQuery('.city_input').show();
+                    jQuery('#en_wd_dropship_city').css('background', 'none');
+                    jQuery('#en_wd_dropship_state').val(data[0].state);
+                    jQuery('#en_wd_dropship_markup').val(data[0].origin_markup);
+                    // Origin terminal address
+                    jQuery('#en_wd_dropship_address').val(data[0].address);
+                    jQuery('#en_wd_dropship_country').val(data[0].country);
+                    jQuery('.en_wd_zip_validation_err').hide();
+                    jQuery('.en_wd_city_validation_err').hide();
+                    jQuery('.en_wd_state_validation_err').hide();
+                    jQuery('.en_wd_country_validation_err').hide();
+                    window.location.href = jQuery('.en_wd_add_dropship_btn').attr('href');
+                    jQuery('.already_exist').hide();
+                    jQuery(".en_wd_err").html("");
+                    setTimeout(function () {
+                        if (jQuery('.ds_popup').is(':visible')) {
+                            jQuery('.ds_input > input').eq(0).focus();
+                        }
+                    }, 100);
+
+                    load_inside_pikup_and_local_delivery_data(data, "#add_dropships");
+                }
+            },
+        });
+        return false;
+    }
+}
+
+/**
+ * Delete Dropship Popup
+ * @param e
+ * @returns {Boolean}
+ */
+if (typeof en_ups_small_wd_delete_current_dropship != 'function')
+{
+    function en_ups_small_wd_delete_current_dropship(e)
+    {
+        var id = e;
+        window.location.href = jQuery('.delete_dropship_btn').attr('href');
+        jQuery('.cancel_delete').on('click', function () {
+            id = false;
+            window.location.href = jQuery('.cancel_delete').attr('href');
+        });
+        jQuery('.confirm_delete').on('click', function () {
+            window.location.href = jQuery('.confirm_delete').attr('href');
+            if (id != false) {
+                return en_wd_confirm_delete_dropship(id);
+            }
+        });
+        return false;
+    }
+}
+
+/**
+ * Delete Dropship
+ * @param e
+ * @returns {Boolean}
+ */
+if (typeof en_wd_confirm_delete_dropship != 'function')
+{
+    function en_wd_confirm_delete_dropship(e)
+    {
+        var tab = get_parameter_by_name('tab');
+        var postForm = {
+            'action': 'en_ups_small_wd_delete_dropship',
+            'dropship_delete_id': e,
+            'tab': tab,
+            'wp_nonce': en_ups_small_wh_script.nonce
+        };
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            beforeSend: function () {
+                jQuery('.confirm_delete').addClass('spinner_disable').text("Loading ..");
+            },
+            success: function (data)
+            {
+                jQuery('.confirm_delete').removeClass('spinner_disable').text("OK");
+                if (data.length > 1) {
+
+                    jQuery(".add_btn_dropship").html(data);
+                    jQuery('#row_' + e).remove();
+                    jQuery('.dropship_deleted').show('slow').delay(5000).hide('slow');
+                    jQuery('.dropship_updated').css('display', 'none');
+                    jQuery('.dropship_created').css('display', 'none');
+                    jQuery('.warehouse_deleted').css('display', 'none');
+                    jQuery('.warehouse_updated').css('display', 'none');
+                    jQuery('.warehouse_created').css('display', 'none');
+
+
+                }
+
+                jQuery('html, body').animate({
+                    scrollTop: jQuery(".en_wd_add_dropship_btn").offset().top
+                }, 1000);
+            },
+        });
+        return false;
+    }
+}
+function en_valid_zip_code(e, zip_code) {
+    const regix_zip = /^[a-zA-Z0-9]+$/;
+    if (!regix_zip.test(zip_code)) {
+        e.preventDefault();
+        return;
+    }
+}
+function stopSpecialCharacters(e) {
+
+    // Allow: backspace, delete, tab, escape, enter and .
+    if (jQuery.inArray(e.keyCode, [46, 9, 27, 13, 110, 190, 189]) !== -1 ||
+            // Allow: Ctrl+A, Command+A
+                    (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
+                    // Allow: home, end, left, right, down, up
+                            (e.keyCode >= 35 && e.keyCode <= 40)) {
+                // let it happen, don't do anything
+                e.preventDefault();
+                return;
+            }
+            // Ensure that it is a number and stop the keypress
+            if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 90)) && (e.keyCode < 96 || e.keyCode > 105) && e.keyCode != 186 && e.keyCode != 8) {
+                e.preventDefault();
+            }
+            if (e.keyCode == 186 || e.keyCode == 190 || e.keyCode == 189) {
+                e.preventDefault();
+                return;
+            }
+        }
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/dropship/dropship_template.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/dropship/dropship_template.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/dropship/dropship_template.php	(revision 3237693)
@@ -0,0 +1,383 @@
+<?php
+/**
+ * Eniture Dropship Template
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+
+?>
+<script type="text/javascript">
+    jQuery(document).ready(function () {
+
+        jQuery("#en_wd_dropship_state").keyup(function (e) {
+
+            jQuery("#en_wd_dropship_state").val(this.value.toUpperCase());
+        });
+
+        jQuery("#en_wd_dropship_country").keyup(function (e) {
+
+            jQuery("#en_wd_dropship_country").val(this.value.toUpperCase());
+        });
+    });
+
+    function hide_drop_val()
+    {
+        jQuery('#add_dropships')[0].reset();
+
+        jQuery('#edit_dropship_form_id').val('');
+        jQuery("#en_wd_dropship_zip").val('');
+        jQuery('.city_select').hide();
+        jQuery('.city_input').show();
+        jQuery('#en_wd_dropship_city').css('background', 'none');
+        jQuery("#en_wd_dropship_nickname").val('');
+        jQuery("#en_wd_dropship_city").val('');
+        jQuery('.en_wd_multi_state').empty();
+        jQuery("#en_wd_dropship_state").val('');
+        // Origin terminal address
+        jQuery("#en_wd_dropship_address").val('');
+        jQuery("#en_wd_dropship_country").val('');
+        jQuery('.en_wd_zip_validation_err').hide();
+        jQuery('.en_wd_city_validation_err').hide();
+        jQuery('.en_wd_state_validation_err').hide();
+        jQuery('.en_wd_country_validation_err').hide();
+        jQuery('.not_allowed').hide();
+        jQuery('.zero_results').hide();
+        jQuery('.already_exist').hide();
+        jQuery('.wrng_credential').hide();
+        jQuery('#add_dropships').find("input[type='text']").val("");
+        jQuery(".en_wd_err").html("");
+        jQuery('#add_dropships').find("input[type='checkbox']").prop('checked',false);
+        jQuery('#instore-pickup-zipmatch .tag-i, #local-delivery-zipmatch .tag-i').trigger('click');
+
+        setTimeout(function () {
+            if (jQuery('.ds_popup').is(':visible')) {
+                jQuery('.ds_input > input').eq(0).focus();
+            }
+        }, 100);
+    }
+    function change_dropship_zip()
+    {
+        if (jQuery("#en_wd_dropship_zip").val() == '') {
+            return false;
+        }
+
+
+        jQuery('#en_wd_dropship_city').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('#en_wd_dropship_state').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('.city_select_css').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('#en_wd_dropship_country').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+
+        var postForm = {
+            'action': 'eniture_wd_get_address',
+            'origin_zip': jQuery('#en_wd_dropship_zip').val(),
+        };
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            beforeSend: function ()
+            {
+                jQuery('.en_wd_zip_validation_err').hide();
+                jQuery('.en_wd_city_validation_err').hide();
+                jQuery('.en_wd_state_validation_err').hide();
+                jQuery('.en_wd_country_validation_err').hide();
+            },
+            success: function (data)
+            {
+                if (data) {
+                    if (data.country === 'US' || data.country === 'CA') {
+                        if (data.postcode_localities == 1) {
+                            jQuery('.city_select').show();
+                            jQuery('#dropship_actname').replaceWith(data.city_option);
+                            jQuery('.en_wd_multi_state').replaceWith(data.city_option);
+                            jQuery('#en_wd_dropship_state').val(data.state);
+                            jQuery('#en_wd_dropship_country').val(data.country);
+                            jQuery('.city-multiselect').change(function () {
+                                setDSCity(this);
+                            });
+                            jQuery('#en_wd_dropship_city').val(data.first_city);
+                            jQuery('#en_wd_dropship_state').css('background', 'none');
+                            jQuery('.city_select_css').css('background', 'none');
+                            jQuery('#en_wd_dropship_country').css('background', 'none');
+                            jQuery('.city_input').hide();
+                        } else {
+                            jQuery('.city_input').show();
+                            jQuery('#_city').removeAttr('value');
+                            jQuery('.city_select').hide();
+                            jQuery('#en_wd_dropship_city').val(data.city);
+                            jQuery('#en_wd_dropship_state').val(data.state);
+                            jQuery('#en_wd_dropship_country').val(data.country);
+                            jQuery('#en_wd_dropship_city').css('background', 'none');
+                            jQuery('#en_wd_dropship_state').css('background', 'none');
+                            jQuery('#en_wd_dropship_country').css('background', 'none');
+                        }
+                    } else if (data.result === 'ZERO_RESULTS') {
+                        jQuery('.zero_results').show('slow');
+                        jQuery('#en_wd_dropship_city').css('background', 'none');
+                        jQuery('#en_wd_dropship_state').css('background', 'none');
+                        jQuery('#en_wd_dropship_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.zero_results').hide('slow');
+                        }, 5000);
+                    } else if (data.result === 'false') {
+                        jQuery('.zero_results').show('slow').delay(5000).hide('slow');
+                        jQuery('#en_wd_dropship_city').css('background', 'none');
+                        jQuery('#en_wd_dropship_state').css('background', 'none');
+                        jQuery('#en_wd_dropship_country').css('background', 'none');
+                        jQuery('#en_wd_dropship_city').val('');
+                        jQuery('#en_wd_dropship_state').val('');
+                        jQuery('#en_wd_dropship_country').val('');
+                    } else if (data.apiResp === 'apiErr') {
+                        jQuery('.wrng_credential').show('slow');
+                        jQuery('#en_wd_dropship_city').css('background', 'none');
+                        jQuery('#en_wd_dropship_state').css('background', 'none');
+                        jQuery('#en_wd_dropship_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.wrng_credential').hide('slow');
+                        }, 5000);
+                    } else {
+                        jQuery('.not_allowed').show('slow');
+                        jQuery('#en_wd_dropship_city').css('background', 'none');
+                        jQuery('#en_wd_dropship_state').css('background', 'none');
+                        jQuery('#en_wd_dropship_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.not_allowed').hide('slow');
+                        }, 5000);
+                    }
+                }
+            },
+        });
+        return false;
+    }
+    function setDSCity($this) {
+        var city = jQuery($this).val();
+        jQuery('#en_wd_dropship_city').val(city);
+    }
+
+    jQuery(function () {
+        jQuery('input.alphaonly').keyup(function () {
+            var location_field_id = jQuery(this).attr("id");
+            var location_regex = location_field_id == 'en_wd_origin_city' || location_field_id == 'en_wd_dropship_city' ? /[^a-zA-Z- ]/g : /[^a-zA-Z]/g;
+            if (this.value.match(location_regex)) {
+                this.value = this.value.replace(location_regex, '');
+            }
+        });
+    });
+</script>
+
+<div class="en_wd_setting_section ups_small_wrapper">
+    <a href="#delete_dropship_btn" class="delete_dropship_btn hide_drop_val"></a>
+    <div id="delete_dropship_btn" class="en_wd_warehouse_overlay">
+        <div class="en_wd_add_warehouse_popup">
+            <h2 class="del_hdng">
+                Warning!
+            </h2>
+            <p class="delete_p">
+                Warning! If you delete this location, Drop ship location settings will be disabled against products if any.
+            </p>
+            <div class="del_btns">
+                <a href="#" class="cancel_delete">Cancel</a>
+                <a href="#" class="confirm_delete">OK</a>
+            </div>
+        </div>
+    </div>
+
+    <h1>Drop ships</h1><br>
+
+    <?php eniture_dropship_template(); ?>
+
+    <!-- Add Popup for new dropship -->
+    <div id="add_dropship_btn" class="en_wd_warehouse_overlay">
+        <div class="en_wd_add_warehouse_popup ds_popup">
+            <h2 class="dropship_heading">Drop ship</h2>
+            <a class="close" href="#">&times;</a>
+            <div class="content">
+                <div class="already_exist">
+                    <strong>Error!</strong> Zip code already exists.
+                </div>
+                <div class="not_allowed">
+                    <p><strong>Error!</strong> Please enter US zip code.</p>
+                </div>
+                <div class="zero_results">
+                    <p><strong>Error!</strong> Please enter valid US zip code.</p>
+                </div>
+                <div class="wrng_credential">
+                    <p><strong>Error!</strong> Please verify credentials at connection settings panel.</p>
+                </div>
+
+                <!-- Wordpress Form closed -->
+                </form>
+
+                <form method="post" id="add_dropships">
+                    <?php
+                    // preferred origin
+                    if (is_plugin_active('preferred-origin/preferred-origin.php')) {
+                        $preferred_provider_lfq = apply_filters('en_pref_origin_lfq', true);
+                        $preferred_provider_sqp = apply_filters('en_pref_origin_sqp', true);
+                        echo esc_attr($preferred_provider_lfq);
+                        echo esc_attr($preferred_provider_sqp);
+                    }
+                    ?>
+                    <input type="hidden" name="edit_dropship_form_id" value="" id="edit_dropship_form_id">
+                    <div class="en_wd_add_warehouse_input ds_input">
+                        <label for="en_wd_dropship_nickname">Nickname</label>
+                        <input type="text" title="Nickname" value="" data-optional="1" name="en_wd_dropship_nickname" placeholder="Nickname" id="en_wd_dropship_nickname">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <!-- Origin terminal address -->
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_address">Street Address</label>
+                        <input type="text" title="Street Address"
+                               name="en_wd_dropship_address" data-optional="1"
+                               placeholder="320 W. Lanier Ave, Ste 200"
+                               id="en_wd_dropship_address">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_zip">Zip </label>
+                        <input title="Zip" type="text" maxlength="6" value="" onchange="change_dropship_zip()" name="en_wd_dropship_zip" placeholder="30214" id="en_wd_dropship_zip">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input city_input">
+                        <label for="en_wd_origin_city">City</label>
+                        <input type="text" class="alphaonly" title="City" value="" name="en_wd_dropship_city" placeholder="Fayetteville" id="en_wd_dropship_city">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input city_select">
+                        <label for="en_wd_origin_city">City</label>
+                        <select id="dropship_actname"></select>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_state">State</label>
+                        <input type="text" class="alphaonly" maxlength="2" title="State" value="" name="en_wd_dropship_state" placeholder="GA" id="en_wd_dropship_state">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_country">Country</label>
+                        <input type="text" class="alphaonly" maxlength="2" title="Country" name="en_wd_dropship_country" value="" placeholder="US" id="en_wd_dropship_country">
+                        <span class="en_wd_err"></span>
+                        <input type="hidden" name="en_wd_dropship_location" value="dropship" id="en_wd_dropship_location">
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_markup">Handling Fee / Markup</label>
+                        <input type="text" class="numericonly" title="Handling Fee / Markup" name="en_wd_dropship_markup" 
+                                data-optional="1" value="" placeholder="" id="en_wd_dropship_markup">
+                    </div>
+
+                    <div style="clear: both;"></div>
+                    <br>
+
+                    <?php
+                    $disabled = "";
+                    $package_required = "";
+                    $plugin_tab = (isset($_REQUEST['tab'])) ? sanitize_text_field(wp_unslash( $_REQUEST['tab'] )) : "";
+                    $action_instore = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features" , 'instore_pickup_local_devlivery');
+                    if(is_array($action_instore))
+                    {
+                        $disabled = "disabled_me";
+                        $package_required = apply_filters("eniture_ups_small_plans_notification_link" , $action_instore);
+                    }
+                    ?>
+
+                    <!--
+                        Instore Pick Up Starts
+                    -->
+                    <div class="heading">
+                        <h2 class="warehouse_heading heading_left">In-store pick up</h2>
+                        <div class="pickup-delivery-checkboxes">
+                            <h2 class="warehouse_heading pakage_notify"><?php echo $package_required ?></h2>
+                        </div>
+                        </a>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Enable in-store pick up</label>
+                        <div class="pickup-delivery-checkboxes">
+                            <input type="checkbox" title="Enable in-store pick up" id="enable-instore-pickup" data-optional="1" name="enable-instore-pickup" value="" class="enable-instore-pickup <?php echo esc_attr($disabled); ?>" />
+                            <span class="en_wd_err"></span>
+                        </div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input ">
+                        <label>Offer if address is within (miles):</label>
+                        <input type="text" title="Offer if address is within (miles):" data-optional="1"  id="instore-pickup-address" class="<?php echo esc_attr($disabled); ?>" name="instore-pickup-address">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_tagging">
+                        <label>Offer if postal code matches:</label>
+                        <div data-tags-input-name="tag" title="Offer if postal code matches:" data-optional="1" id="instore-pickup-zipmatch" value="" name="instore-pickup-zipmatch" class="tagging-js <?php echo esc_attr($disabled); ?>"></div>
+                        <span class="en_wd_err"></span>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Checkout description:</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?>" title="Checkout description:" id="instore-pickup-desc" placeholder="In-store pick up" data-optional="1" name="instore-pickup-desc">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <!-- Terminal phone number -->
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Phone number:</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?> en-phone-number" title="Phone number:" id="en-phone-number"
+                               placeholder="404-369-0680" data-optional="1" name="en-phone-number">
+                    </div>
+
+                    <div style="clear: both;"></div>
+                    <br>
+
+                    <!--
+                        Local Delivery Starts
+                    -->
+
+                    <div class="heading">
+                        <h2 class="local-delivery-heading heading_left">Local Delivery</h2>
+                        <div class="pickup-delivery-checkboxes">
+                            <h2 class="local-delivery-heading pakage_notify heading_right"><?php echo $package_required; ?></h2>
+                        </div>
+                        </a>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Enable local delivery</label>
+                        <div class="pickup-delivery-checkboxes">
+                            <input type="checkbox" title="Enable local delivery" id="enable-local-delivery" data-optional="1" name="enable-local-delivery" value="" class="enable-local-delivery <?php echo esc_attr($disabled); ?>" />
+                        </div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Offer if address is within (miles):</label>
+                        <input type="text" title="Offer if address is within (miles):" class="<?php echo esc_attr($disabled); ?>" data-optional="1" id="local-delivery-address" name="local-delivery-address">
+                    </div>
+                    <div class="en_wd_add_warehouse_tagging">
+                        <label>Offer if postal code matches:</label>
+                        <div data-tags-input-name="tag" title="Offer if postal code matches:" data-optional="1" id="local-delivery-zipmatch" value="" name="local-delivery-zipmatch" class="tagging-js <?php echo esc_attr($disabled); ?>"></div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Checkout description:</label>
+                        <input id="local-delivery-desc" title="Checkout description:" placeholder="Local delivery" type="text" class="<?php echo esc_attr($disabled); ?>" data-optional="1" name="local-delivery-desc">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Local delivery fee</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?>" title="Local delivery fee" data-optional="1" onchange="validate_delivery_fee(this);" id="local-delivery-fee" name="local-delivery-fee" maxlength="10">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Suppress other rates <span class="suppress-span" title="This setting only suppresses rates that would otherwise be returned by the Eniture Technology products.">[?]</span></label>
+                        <div class="pickup-delivery-checkboxes <?php echo esc_attr($disabled); ?>">
+                            <input type="checkbox" title="Suppress other rates" id="suppress-local-delivery" name="suppress-local-delivery" value="" class="suppress-local-delivery" />
+                        </div>
+                    </div>
+
+                    <!--
+                        Local Delivery Ends
+                    -->
+                    <div class="form-btns">
+                        <input type="submit" name="en_wd_submit_dropship" value="Save" class="save_warehouse_form" onclick="return en_ups_small_wd_save_dropship();">
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/includes/wild-delivery-save.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/includes/wild-delivery-save.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/includes/wild-delivery-save.php	(revision 3237693)
@@ -0,0 +1,469 @@
+<?php
+
+/**
+ * Includes Ajax Request class
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+if (!class_exists("Eniture_WooWdAddonsAjaxReqIncludes")) {
+
+    class Eniture_WooWdAddonsAjaxReqIncludes
+    {
+
+        public $plugin_standards;
+        public $selected_plan;
+        public $EnWooAddonAutoResidDetectionTemplate;
+
+        /**
+         * Get Address ajax request
+         */
+        public function __construct()
+        {
+            add_action('wp_ajax_nopriv_eniture_wd_get_address', array($this, 'eniture_get_address_api_ajax'));
+            add_action('wp_ajax_eniture_wd_get_address', array($this, 'eniture_get_address_api_ajax'));
+
+            // Warehouse actions
+            add_action('wp_ajax_nopriv_en_ups_small_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
+
+            // Dropship actions
+            add_action('wp_ajax_nopriv_en_ups_small_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
+        }
+
+        /**
+         * Get Address From ZipCode Using API
+         */
+        function eniture_get_address_api_ajax()
+        {
+            if (isset($_POST['origin_zip'])) {
+                $map_address = (isset($_POST['origin_zip'])) ? sanitize_text_field(wp_unslash( $_POST['origin_zip'] )) : "";
+                $zipCode = str_replace(' ', '', $map_address);
+                $accessLevel = 'address';
+                $Get_sm_distance = new Eniture_Get_ups_small_distance();
+                $resp_json = $Get_sm_distance->ups_small_address($zipCode, $accessLevel);
+                $map_result = json_decode($resp_json, true);
+
+                $city = "";
+                $state = "";
+                $country = "";
+                $postcode_localities = 0;
+                $address_type = $city_name = $city_option = '';
+
+                if (isset($map_result['error']) && !empty($map_result['error'])) {
+                    echo wp_json_encode(array('apiResp' => 'apiErr'));
+                    exit;
+                }
+                if (isset($map_result['results'], $map_result['status']) && (empty($map_result['results'])) && ($map_result['status'] == "ZERO_RESULTS")) {
+                    echo wp_json_encode(array('result' => 'ZERO_RESULTS'));
+                    exit;
+                }
+                if (count($map_result['results']) == 0) {
+                    echo wp_json_encode(array('result' => 'false'));
+                    exit;
+                }
+                $first_city = '';
+                if (count($map_result['results']) > 0) {
+                    $arrComponents = $map_result['results'][0]['address_components'];
+                    if (isset($map_result['results'][0]['postcode_localities']) && $map_result['results'][0]['postcode_localities']) {
+                        foreach ($map_result['results'][0]['postcode_localities'] as $index => $component) {
+                            $first_city = ($index == 0) ? $component : $first_city;
+                            $city_option .= '<option value="' . trim($component) . ' "> ' . $component . ' </option>';
+                        }
+                        $city = '<select id="' . $address_type . '_city" class="city-multiselect select en_wd_multi_state city_select_css" name="' . $address_type . '_city" aria-required="true" aria-invalid="false">
+                                    ' . $city_option . '</select>';
+                        $postcode_localities = 1;
+                    } elseif ($arrComponents) {
+                        foreach ($arrComponents as $index => $component) {
+                            $type = $component['types'][0];
+                            if ($city == "" && ($type == "sublocality_level_1" || $type == "locality")) {
+                                $city_name = trim($component['long_name']);
+                            }
+                        }
+                    }
+                    if ($arrComponents) {
+                        foreach ($arrComponents as $index => $state_app) {
+                            $type = $state_app['types'][0];
+                            if ($state == "" && ($type == "administrative_area_level_1")) {
+                                $state_name = trim($state_app['short_name']);
+                                $state = $state_name;
+                            }
+                            if ($country == "" && ($type == "country")) {
+                                $country_name = trim($state_app['short_name']);
+                                $country = $country_name;
+                            }
+                        }
+                    }
+                    echo wp_json_encode(array('first_city' => $first_city, 'city' => $city_name, 'city_option' => $city, 'state' => $state, 'country' => $country, 'postcode_localities' => $postcode_localities));
+                    exit;
+                }
+            }
+        }
+
+        /**
+         * Validate Input Fields
+         * @param type $sPostData
+         * @return string
+         */
+        function pkg_validate_post_data($sPostData)
+        {
+            foreach ($sPostData as $key => &$tag) {
+                $check_characters = $key == "city" ? preg_match('/[#$%@^&!_*()+=\[\]\';,\/{}|":<>?~\\\\]/', $tag) : preg_match('/[#$%@^&!_*()+=\-\[\]\';,\/{}|":<>?~\\\\]/', $tag);
+                // preferred origin
+                if ($check_characters != 1 ||
+                    $key == "pref_loc_lfq" ||
+                    $key == "pref_loc_spq" ||
+                    $key == "address" ||
+                    $key == "match_postal_local_delivery" ||
+                    $key == "match_postal_store_pickup" ||
+                    $key == "checkout_desc_local_delivery" ||
+                    $key == "checkout_desc_store_pickup" ||
+                    // Terminal phone number
+                    $key == "phone_instore" ||
+                    $key == "nickname" ||
+                    $key == "origin_markup") {
+                    $data[$key] = sanitize_text_field($tag);
+                } else {
+                    $data[$key] = 'Error';
+                }
+            }
+
+            return $data;
+        }
+
+        /**
+         * Filtered Data Array
+         * @param $validateData
+         * @return array
+         */
+        function filtered_data($validateData)
+        {
+            return array(
+                'city' => $validateData["city"],
+                'state' => $validateData["state"],
+                'zip' => preg_replace('/\s+/', '', $validateData["zip"]),
+                'country' => $validateData["country"],
+                'location' => $validateData["location"],
+                'nickname' => (isset($validateData["nickname"])) ? $validateData["nickname"] : "",
+            );
+        }
+
+        /**
+         * Save Warehouse Function
+         * @global $wpdb
+         */
+        function eniture_save_warehouse_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $html = "";
+
+            if (isset($_POST['origin_country']) && $_POST['origin_country'] != '') {
+                $origin_country_code = sanitize_text_field( wp_unslash( $_POST['origin_country']) );
+                $countrycode = strtolower($origin_country_code);
+                $origin_country = ($countrycode == 'un') ? 'US' : $origin_country_code;
+            }
+
+            $input_data_arr = array(
+                'city'                         =>  isset($_POST['origin_city']) ? sanitize_text_field(wp_unslash($_POST['origin_city'])) : '',
+                'state'                        =>  isset($_POST['origin_state']) ? sanitize_text_field(wp_unslash($_POST['origin_state'])) : '',
+                // Origin terminal address
+                'address'                      =>  isset($_POST['origin_address']) ? sanitize_text_field(wp_unslash($_POST['origin_address'])) : '',
+                'zip'                          =>  isset($_POST['origin_zip']) ? sanitize_text_field(wp_unslash($_POST['origin_zip'])) : '',
+                'country'                      =>  $origin_country,
+                'location'                     =>  isset($_POST['location']) ? sanitize_text_field(wp_unslash($_POST['location'])) : '',
+                'enable_store_pickup'          =>  isset($_POST['enable_instore']) && $_POST['enable_instore'] === 'true' ? 1 : 0,
+                'miles_store_pickup'           =>  isset($_POST['address_miles_instore']) ? sanitize_text_field(wp_unslash($_POST['address_miles_instore'])) : '',
+                'match_postal_store_pickup'    =>  isset($_POST['zipmatch_instore']) ? sanitize_text_field(wp_unslash($_POST['zipmatch_instore'])) : '',
+                'checkout_desc_store_pickup'   =>  isset($_POST['desc_instore']) ? sanitize_text_field(wp_unslash($_POST['desc_instore'])) : '',
+                // Terminal phone number
+                'phone_instore'                =>  isset($_POST['phone_instore']) ? sanitize_text_field(wp_unslash($_POST['phone_instore'])) : '',
+                'enable_local_delivery'        =>  isset($_POST['enable_delivery']) && $_POST['enable_delivery'] === 'true' ? 1 : 0,
+                'miles_local_delivery'         =>  isset($_POST['address_miles_delivery']) ? sanitize_text_field(wp_unslash($_POST['address_miles_delivery'])) : '',
+                'match_postal_local_delivery'  =>  isset($_POST['zipmatch_delivery']) ? sanitize_text_field(wp_unslash($_POST['zipmatch_delivery'])) : '',
+                'checkout_desc_local_delivery' =>  isset($_POST['desc_delivery']) ? sanitize_text_field(wp_unslash($_POST['desc_delivery'])) : '',
+                'fee_local_delivery'           =>  isset($_POST['fee_delivery']) ? sanitize_text_field(wp_unslash($_POST['fee_delivery'])) : '',
+                'suppress_local_delivery'      =>  isset($_POST['supppress_delivery']) ? (sanitize_text_field(wp_unslash($_POST['supppress_delivery'])) === 'true' ? 1 : 0) : 0,
+                'origin_markup'                =>  isset($_POST['origin_markup']) ? sanitize_text_field(wp_unslash($_POST['origin_markup'])) : '',
+
+            );
+            // preferred origin
+            if (is_plugin_active('preferred-origin/preferred-origin.php')) {
+                $input_data_arr = apply_filters('en_pref_field', $input_data_arr, $_POST);
+            }
+            $validateData = $this->pkg_validate_post_data($input_data_arr);
+            $get_warehouse = $wpdb->get_results(
+                $wpdb->prepare(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE city = %s AND state = %s AND zip = %s AND country = %s",
+                    $validateData["city"],
+                    $validateData["state"],
+                    $validateData["zip"],
+                    $validateData["country"]
+                )
+            );
+
+            $insert_qry = $update_qry = '';
+            if ($validateData["city"] != 'Error') {
+                $data = $validateData;
+                
+                if (isset($validateData["city"])) {
+                    $get_warehouse_id = (isset($_POST['origin_id']) && intval($_POST['origin_id'])) ? intval($_POST['origin_id']) : "";
+                    if ($get_warehouse_id && (empty($get_warehouse) || (!empty($get_warehouse) && reset($get_warehouse)->id == $get_warehouse_id))) {
+                        $update_qry = $wpdb->update(
+                            $wpdb->prefix . 'warehouse', $data, array('id' => $get_warehouse_id)
+                        );
+
+                        $update_qry = (!empty($get_warehouse) && reset($get_warehouse)->id == $get_warehouse_id) ? 1 : $update_qry;
+                    } else {
+                        if (empty($get_warehouse)) {
+                            $insert_qry = $wpdb->insert(
+                                $wpdb->prefix . 'warehouse', $data
+                            );
+
+                            $html = eniture_warehouse_template(TRUE);
+                        }
+                    }
+                }
+                $lastid = $wpdb->insert_id;
+                if ($lastid == 0) {
+                    $lastid = $get_warehouse_id;
+                }
+                $warehous_list = array('origin_city' => $data["city"], 'origin_state' => $data["state"], 'origin_zip' => $data["zip"], 'origin_country' => $data["country"], 'insert_qry' => $insert_qry, 'update_qry' => $update_qry, 'id' => $lastid, 'html' => $html);
+                echo wp_json_encode($warehous_list);
+                exit;
+            } else {
+                echo "false";
+                exit;
+            }
+        }
+
+
+        /**
+         * Edit Warehouse Function
+         * @global $wpdb
+         */
+        function eniture_edit_warehouse_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            // Terminal phone number
+            global $wpdb;
+            $get_warehouse_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? intval($_POST['edit_id']) : "";
+            $warehous_list = $wpdb->get_results(
+                $wpdb->prepare(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE id=%d",
+                    $get_warehouse_id
+                )
+            );
+
+            echo wp_json_encode($warehous_list);
+            exit;
+        }
+
+
+        /**
+         * Delete Warehouse Function
+         * @global $wpdb
+         */
+        function eniture_delete_warehouse_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_warehouse_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? intval($_POST['delete_id']) : "";
+            $qry = $wpdb->delete($wpdb->prefix . 'warehouse', array('id' => $get_warehouse_id, 'location' => 'warehouse'));
+
+            $html = eniture_warehouse_template(TRUE);
+            echo wp_json_encode($html);
+            exit;
+        }
+
+
+        /**
+         * Save Dropship Function
+         * @global $wpdb
+         */
+        function eniture_save_dropship_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $html = "";
+
+            if (isset($_POST['dropship_country']) && $_POST['dropship_country'] != '') {
+                $dropship_contry = sanitize_text_field( wp_unslash( $_POST['dropship_country']) );
+                $countrycode = strtolower($dropship_contry);
+                $dropship_contry = ($countrycode == 'un') ? 'US' : $dropship_contry;
+            }
+
+            $input_data_arr = array(
+                'city'     => isset($_POST['dropship_city']) ? sanitize_text_field(wp_unslash($_POST['dropship_city'])) : '',
+                'state'    => isset($_POST['dropship_state']) ? sanitize_text_field(wp_unslash($_POST['dropship_state'])) : '',
+                // Origin terminal address
+                'address'  => isset($_POST['dropship_address']) ? sanitize_text_field(wp_unslash($_POST['dropship_address'])) : '',
+                'zip'      => isset($_POST['dropship_zip']) ? sanitize_text_field(wp_unslash($_POST['dropship_zip'])) : '',
+                'country'  => $dropship_contry,
+                'location' => isset($_POST['location']) ? sanitize_text_field(wp_unslash($_POST['location'])) : '',
+                'nickname' => isset($_POST['nickname']) ? sanitize_text_field(wp_unslash($_POST['nickname'])) : '',
+
+                'enable_store_pickup'          =>  isset($_POST['enable_instore']) && $_POST['enable_instore'] === 'true' ? 1 : 0,
+                'miles_store_pickup'           =>  isset($_POST['address_miles_instore']) ? sanitize_text_field( wp_unslash($_POST['address_miles_instore'])) : '',
+                'match_postal_store_pickup'    =>  isset($_POST['zipmatch_instore']) ? sanitize_text_field( wp_unslash($_POST['zipmatch_instore'])) : '',
+                'checkout_desc_store_pickup'   =>  isset($_POST['desc_instore']) ? sanitize_text_field( wp_unslash($_POST['desc_instore'])) : '',
+                // Terminal phone number
+                'phone_instore'                =>  isset($_POST['phone_instore']) ? sanitize_text_field(wp_unslash($_POST['phone_instore'])) : '',
+                'enable_local_delivery'        =>  isset($_POST['enable_delivery']) && $_POST['enable_delivery'] === 'true' ? 1 : 0,
+                'miles_local_delivery'         =>  isset($_POST['address_miles_delivery']) ? sanitize_text_field(wp_unslash($_POST['address_miles_delivery'])) : '',
+                'match_postal_local_delivery'  =>  isset($_POST['zipmatch_delivery']) ? sanitize_text_field(wp_unslash($_POST['zipmatch_delivery'])) : '',
+                'checkout_desc_local_delivery' =>  isset($_POST['desc_delivery']) ? sanitize_text_field(wp_unslash($_POST['desc_delivery'])) : '',
+                'fee_local_delivery'           =>  isset($_POST['fee_delivery']) ? sanitize_text_field(wp_unslash($_POST['fee_delivery'])) : '',
+                'suppress_local_delivery'      =>  isset($_POST['supppress_delivery']) ? (sanitize_text_field(wp_unslash($_POST['supppress_delivery'])) === 'true' ? 1 : 0) : 0,
+                'origin_markup'                =>  isset($_POST['origin_markup']) ? sanitize_text_field(wp_unslash($_POST['origin_markup'])) : '',
+            );
+            // preferred origin
+            if (is_plugin_active('preferred-origin/preferred-origin.php')) {
+                $input_data_arr = apply_filters('en_pref_field', $input_data_arr, $_POST);
+            }
+            $validateData = $this->pkg_validate_post_data($input_data_arr);
+            $get_dropship = $wpdb->get_results(
+                $wpdb->prepare(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE city = %s AND state = %s AND zip = %s AND nickname = %s AND country = %s",
+                    $validateData["city"],
+                    $validateData["state"],
+                    $validateData["zip"],
+                    $validateData["nickname"],
+                    $validateData["country"]
+                )
+            );
+        
+            $insert_qry = $update_qry = '';
+            if ($validateData["city"] != 'Error' && $validateData["nickname"] != 'Error') {
+                $data = $validateData;
+
+                if (isset($validateData["city"])) {
+                    $get_dropship_id = (isset($_POST['dropship_id']) && intval($_POST['dropship_id'])) ? intval($_POST['dropship_id']) : "";
+
+                    if ($get_dropship_id != '' && (empty($get_dropship) || (!empty($get_dropship) && reset($get_dropship)->id == $get_dropship_id))) {
+                        $update_qry = $wpdb->update(
+                            $wpdb->prefix . 'warehouse', $data, array('id' => $get_dropship_id)
+                        );
+
+                        $update_qry = (!empty($get_dropship) && reset($get_dropship)->id == $get_dropship_id) ? 1 : $update_qry;
+                    } else {
+                        if (empty($get_dropship)) {
+                            $insert_qry = $wpdb->insert(
+                                $wpdb->prefix . 'warehouse', $data
+                            );
+
+                            $html = eniture_dropship_template(TRUE);
+                        }
+                    }
+                }
+                $lastid = $wpdb->insert_id;
+                if ($lastid == 0) {
+                    $lastid = $get_dropship_id;
+                }
+                $warehous_list = array('nickname' => $data["nickname"], 'origin_city' => $data["city"], 'origin_state' => $data["state"], 'origin_zip' => $data["zip"], 'origin_country' => $data["country"], 'insert_qry' => $insert_qry, 'update_qry' => $update_qry, 'id' => $lastid, 'html' => $html);
+                echo wp_json_encode($warehous_list);
+                exit;
+            } else {
+                echo "false";
+                exit;
+            }
+        }
+
+
+        /**
+         * Edit Dropship Function
+         * @global $wpdb
+         */
+        function eniture_edit_dropship_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            // Terminal phone number
+            global $wpdb;
+            $get_dropship_id = (isset($_POST['dropship_edit_id']) && intval($_POST['dropship_edit_id'])) ? intval($_POST['dropship_edit_id']) : "";
+            $warehous_list = $wpdb->get_results(
+                $wpdb->prepare(
+                    "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE id=%d",
+                    $get_dropship_id
+                )
+            );
+            echo wp_json_encode($warehous_list);
+            exit;
+        }
+
+
+        /**
+         * Delete Dropship Function
+         * @global $wpdb
+         */
+        function eniture_delete_dropship_ajax()
+        {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+
+            $get_dropship_id = (isset($_POST['dropship_delete_id']) && intval($_POST['dropship_delete_id'])) ? intval($_POST['dropship_delete_id']) : "";
+            $dropship_id = isset($_POST['dropship_delete_id']) ? sanitize_text_field(wp_unslash($_POST['dropship_delete_id'])) : "";
+            $get_dropship_array = array($dropship_id);
+            $get_dropship_val = array_map('intval', $get_dropship_array);
+            $ser = maybe_serialize($get_dropship_val);
+            $get_post_id = $wpdb->get_results(
+                $wpdb->prepare(
+                    "SELECT group_concat(post_id) as post_ids_list FROM `" . $wpdb->prefix . "postmeta` WHERE `meta_key` = '_dropship_location' AND (`meta_value` LIKE %s OR `meta_value` = %s)",
+                    '%' . $ser . '%',
+                    $dropship_id
+                )
+            );
+            $post_id = reset($get_post_id)->post_ids_list;
+
+            if (isset($post_id)) {
+                $wpdb->query("UPDATE `" . $wpdb->prefix . "postmeta` SET `meta_value` = '' WHERE `meta_key` IN('_enable_dropship','_dropship_location') AND `post_id` IN ($post_id)");
+            }
+
+            $qry = $wpdb->delete($wpdb->prefix . "warehouse", array('id' => $get_dropship_id, 'location' => 'dropship'));
+
+            $html = eniture_dropship_template(TRUE);
+            echo wp_json_encode($html);
+            exit;
+        }
+
+    }
+}
+
+new Eniture_WooWdAddonsAjaxReqIncludes();
Index: /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/warehouse/warehouse_template.php
===================================================================
--- /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/warehouse/warehouse_template.php	(revision 3237693)
+++ /small-package-quotes-ups-edition/tags/4.5.17/warehouse-dropship/wild/warehouse/warehouse_template.php	(revision 3237693)
@@ -0,0 +1,364 @@
+<?php
+/**
+ * Eniture Warehouse Template
+ */
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+
+?>
+<script type="text/javascript">
+    jQuery(document).ready(function () {
+        window.location.href = jQuery('.close').attr('href');
+
+        jQuery("#en_wd_origin_state").keyup(function (e) {
+
+            jQuery("#en_wd_origin_state").val(this.value.toUpperCase());
+        });
+
+        jQuery("#en_wd_origin_country").keyup(function (e) {
+
+            jQuery("#en_wd_origin_country").val(this.value.toUpperCase());
+        });
+    });
+    function en_wd_add_warehouse_btn()
+    {
+        jQuery('#add_warehouses')[0].reset();
+        jQuery('#edit_form_id').val('');
+        jQuery("#en_wd_origin_zip").val('');
+        jQuery('.city_select').hide();
+        jQuery('.city_input').show();
+        jQuery('#en_wd_origin_city').css('background', 'none');
+        jQuery("#en_wd_origin_city").val('');
+        jQuery("#en_wd_origin_state").val('');
+        // Origin terminal address
+        jQuery("#en_wd_origin_address").val('');
+        jQuery("#en_wd_origin_country").val('');
+        jQuery("#en_wd_origin_markup").val('');
+        jQuery('.en_wd_zip_validation_err').hide();
+        jQuery('.en_wd_city_validation_err').hide();
+        jQuery('.en_wd_state_validation_err').hide();
+        jQuery('.en_wd_country_validation_err').hide();
+        jQuery('.not_allowed').hide();
+        jQuery('.zero_results').hide();
+        jQuery('.already_exist').hide();
+        jQuery('.wrng_credential').hide();
+        jQuery('#add_warehouses').find("input[type='text']").val("");
+        jQuery(".en_wd_err").html("");
+        jQuery('#add_warehouses').find("input[type='checkbox']").prop('checked',false);
+        jQuery('#instore-pickup-zipmatch .tag-i, #local-delivery-zipmatch .tag-i').trigger('click');
+
+        setTimeout(function () {
+            if (jQuery('.en_wd_add_warehouse_popup').is(':visible')) {
+                jQuery('.en_wd_add_warehouse_input > input').eq(0).focus();
+            }
+        }, 100);
+    }
+    function change_warehouse_zip()
+    {
+        if (jQuery("#en_wd_origin_zip").val() == '') {
+            return false;
+        }
+
+
+        jQuery('#en_wd_origin_city').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('#en_wd_origin_state').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('.city_select_css').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+        jQuery('#en_wd_origin_country').css('background', 'rgba(255, 255, 255, 1) url("<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%');
+
+        var postForm = {
+            'action': 'eniture_wd_get_address',
+            'origin_zip': jQuery('#en_wd_origin_zip').val(),
+        };
+
+        jQuery.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            data: postForm,
+            dataType: 'json',
+            beforeSend: function ()
+            {
+                jQuery('.en_wd_zip_validation_err').hide();
+                jQuery('.en_wd_city_validation_err').hide();
+                jQuery('.en_wd_state_validation_err').hide();
+                jQuery('.en_wd_country_validation_err').hide();
+            },
+            success: function (data)
+            {
+              
+                if (data) {
+                    if (data.country === 'US' || data.country === 'CA') {
+                        if (data.postcode_localities == 1) {
+                            jQuery('.city_select').show();
+                            jQuery('#actname').replaceWith(data.city_option);
+                            jQuery('.en_wd_multi_state').replaceWith(data.city_option);
+                            jQuery('.city-multiselect').change(function () {
+                                setCity(this);
+                            });
+                            jQuery('#en_wd_origin_city').val(data.first_city);
+                            jQuery('#en_wd_origin_state').val(data.state);
+                            jQuery('#en_wd_origin_country').val(data.country);
+                            jQuery('#en_wd_origin_state').css('background', 'none');
+                            jQuery('.city_select_css').css('background', 'none');
+                            jQuery('#en_wd_origin_country').css('background', 'none');
+                            jQuery('.city_input').hide();
+                        } else {
+                            jQuery('.city_input').show();
+                            jQuery('#_city').removeAttr('value');
+                            jQuery('.city_select').hide();
+                            jQuery('#en_wd_origin_city').val(data.city);
+                            jQuery('#en_wd_origin_state').val(data.state);
+                            jQuery('#en_wd_origin_country').val(data.country);
+                            jQuery('#en_wd_origin_city').css('background', 'none');
+                            jQuery('#en_wd_origin_state').css('background', 'none');
+                            jQuery('#en_wd_origin_country').css('background', 'none');
+                        }
+                    } else if (data.result === 'ZERO_RESULTS') {
+                        jQuery('.zero_results').show('slow');
+                        jQuery('#en_wd_origin_city').css('background', 'none');
+                        jQuery('#en_wd_origin_state').css('background', 'none');
+                        jQuery('#en_wd_origin_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.zero_results').hide('slow');
+                        }, 5000);
+                    } else if (data.result === 'false') {
+                        jQuery('.zero_results').show('slow').delay(5000).hide('slow');
+                        jQuery('#en_wd_origin_city').css('background', 'none');
+                        jQuery('#en_wd_origin_state').css('background', 'none');
+                        jQuery('#en_wd_origin_country').css('background', 'none');
+                        jQuery('#en_wd_origin_city').val('');
+                        jQuery('#en_wd_origin_state').val('');
+                        jQuery('#en_wd_origin_country').val('');
+                    } else if (data.apiResp === 'apiErr') {
+                        jQuery('.wrng_credential').show('slow');
+                        jQuery('#en_wd_origin_city').css('background', 'none');
+                        jQuery('#en_wd_origin_state').css('background', 'none');
+                        jQuery('#en_wd_origin_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.wrng_credential').hide('slow');
+                        }, 5000);
+                    } else {
+                        jQuery('.not_allowed').show('slow');
+                        jQuery('#en_wd_origin_city').css('background', 'none');
+                        jQuery('#en_wd_origin_state').css('background', 'none');
+                        jQuery('#en_wd_origin_country').css('background', 'none');
+                        setTimeout(function () {
+                            jQuery('.not_allowed').hide('slow');
+                        }, 5000);
+                    }
+                }
+            },
+        });
+        return false;
+    }
+    function setCity(e) {
+        var city = jQuery(e).val();
+        jQuery('#en_wd_origin_city').val(city);
+    }
+    jQuery(function () {
+        jQuery('input.alphaonly').keyup(function () {
+            var location_field_id = jQuery(this).attr("id");
+            var location_regex = location_field_id == 'en_wd_origin_city' || location_field_id == 'en_wd_dropship_city' ? /[^a-zA-Z- ]/g : /[^a-zA-Z]/g;
+            if (this.value.match(location_regex)) {
+                this.value = this.value.replace(location_regex, '');
+            }
+        });
+    });
+</script>
+<div class="en_wd_setting_section ups_small_wrapper">
+    <h1>Warehouses</h1><br>
+
+    <?php eniture_warehouse_template(); ?>
+
+    <!-- Add Popup for new warehouse -->
+    <div id="en_wd_add_warehouse_btn" class="en_wd_warehouse_overlay">
+        <div class="en_wd_add_warehouse_popup">
+            <h2 class="warehouse_heading">Warehouse</h2>
+            <a class="close" href="#">&times;</a>
+            <div class="content" style="overflow-y: auto; height: 80vh;">
+                <div class="already_exist">
+                    <strong>Error!</strong> Zip code already exists.
+                </div>
+                <div class="not_allowed">
+                    <p><strong>Error!</strong> Please enter US zip code.</p>
+                </div>
+                <div class="zero_results">
+                    <p><strong>Error!</strong> Please enter valid US zip code.</p>
+                </div>
+                <div class="wrng_credential">
+                    <p><strong>Error!</strong> Please verify credentials at connection settings panel.</p>
+                </div>
+
+                <!-- Wordpress Form closed -->
+                </form>
+
+                <form method="post" id="add_warehouses">
+                    <?php
+                    // preferred origin
+                    if (is_plugin_active('preferred-origin/preferred-origin.php')) {
+                        $preferred_provider_lfq = apply_filters('en_pref_origin_lfq', true);
+                        $preferred_provider_sqp = apply_filters('en_pref_origin_sqp', true);
+                        echo esc_attr($preferred_provider_lfq);
+                        echo esc_attr($preferred_provider_sqp);
+                    }
+                    ?>
+                    <input type="hidden" name="edit_form_id" value="" id="edit_form_id">
+                    <!-- Origin terminal address -->
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_address">Street Address</label>
+                        <input type="text" title="Street Address" data-optional="1"
+                               name="en_wd_origin_address" data-optional="1"
+                               placeholder="320 W. Lanier Ave, Ste 200"
+                               id="en_wd_origin_address">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_zip">Zip </label>
+                        <input type="text" title="Zip"  maxlength="6" onchange="change_warehouse_zip()" value="" name="en_wd_origin_zip" placeholder="30214" id="en_wd_origin_zip">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input city_input">
+                        <label for="en_wd_origin_city">City</label>
+                        <input type="text" class="alphaonly" title="City" value="" name="en_wd_origin_city" placeholder="Fayetteville" id="en_wd_origin_city">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input city_select">
+                        <label for="en_wd_origin_city">City</label>
+                        <select id="actname"></select>
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_state">State</label>
+                        <input type="text" class="alphaonly" maxlength="2" title="State" value="" name="en_wd_origin_state" placeholder="GA" id="en_wd_origin_state">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_country">Country</label>
+                        <input type="text" class="alphaonly" maxlength="2" title="Country" name="en_wd_origin_country" value="" placeholder="US" id="en_wd_origin_country">
+                        <input type="hidden" name="en_wd_location" value="warehouse" id="en_wd_location">
+                        <span class="en_wd_err"></span>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label for="en_wd_origin_markup">Handling Fee / Markup</label>
+                        <input type="text" class="numericonly" title="Handling Fee / Markup" name="en_wd_origin_markup"
+                            data-optional="1" value="" placeholder="" id="en_wd_origin_markup">
+                    </div>
+
+                    <div style="clear: both;"></div>
+                    <br>
+
+                    <?php
+                    $disabled = "";
+                    $package_required = "";
+                    $plugin_tab = (isset($_REQUEST['tab'])) ? sanitize_text_field(wp_unslash( $_REQUEST['tab'] )) : "";
+
+                    $action_instore = apply_filters("eniture_ups_small_quotes_plans_suscription_and_features", 'instore_pickup_local_devlivery');
+
+                    if(is_array($action_instore))
+                    {
+                        $disabled = "disabled_me";
+                        $package_required = apply_filters("eniture_ups_small_plans_notification_link" , $action_instore);
+                    }
+                    ?>
+
+                    <!--
+                        Instore Pick Up Starts
+                    -->
+                    <div class="heading">
+                        <h2 class="warehouse_heading heading_left">In-store pick up</h2>
+                        <div class="pickup-delivery-checkboxes">
+                            <h2 class="warehouse_heading pakage_notify"><?php echo $package_required ?></h2>
+                        </div>
+                        </a>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Enable in-store pick up</label>
+                        <div class="pickup-delivery-checkboxes">
+                            <input type="checkbox" title="Enable in-store pick up" id="enable-instore-pickup" data-optional="1" name="enable-instore-pickup" value="" class="enable-instore-pickup <?php echo esc_attr($disabled); ?>" />
+                            <span class="en_wd_err"></span>
+                        </div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input ">
+                        <label>Offer if address is within (miles):</label>
+                        <input type="text" title="Offer if address is within (miles):" data-optional="1"  id="instore-pickup-address" class="<?php echo esc_attr($disabled); ?>" name="instore-pickup-address">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_tagging">
+                        <label>Offer if postal code matches:</label>
+                        <div data-tags-input-name="tag"  title="Offer if postal code matches:" data-optional="1" id="instore-pickup-zipmatch" value="" name="instore-pickup-zipmatch" class="tagging-js <?php echo esc_attr($disabled); ?>"></div>
+                        <span class="en_wd_err"></span>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Checkout description:</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?>" title="Checkout description:" id="instore-pickup-desc" placeholder="In-store pick up" data-optional="1" name="instore-pickup-desc">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <!-- Terminal phone number -->
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Phone number:</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?> en-phone-number" title="Phone number:" id="en-phone-number"
+                               placeholder="404-369-0680" data-optional="1" name="en-phone-number">
+                    </div>
+
+                    <div style="clear: both;"></div>
+                    <br>
+
+                    <!--
+                        Local Delivery Starts
+                    -->
+
+                    <div class="heading">
+                        <h2 class="local-delivery-heading heading_left">Local Delivery</h2>
+                        <div class="pickup-delivery-checkboxes">
+                            <h2 class="local-delivery-heading pakage_notify heading_right"><?php echo $package_required; ?></h2>
+                        </div>
+                        </a>
+                    </div>
+
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Enable local delivery</label>
+                        <div class="pickup-delivery-checkboxes">
+                            <input type="checkbox" title="Enable local delivery" id="enable-local-delivery" data-optional="1" name="enable-local-delivery" value="" class="enable-local-delivery <?php echo esc_attr($disabled); ?>" />
+                        </div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Offer if address is within (miles):</label>
+                        <input type="text" title="Offer if address is within (miles):" class="<?php echo esc_attr($disabled); ?>" data-optional="1"  id="local-delivery-address" name="local-delivery-address">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_tagging">
+                        <label>Offer if postal code matches:</label>
+                        <div data-tags-input-name="tag" title="Offer if postal code matches:" data-optional="1" id="local-delivery-zipmatch" value="" name="local-delivery-zipmatch" class="tagging-js <?php echo esc_attr($disabled); ?>"></div>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Checkout description:</label>
+                        <input id="local-delivery-desc" title="Checkout description:" placeholder="Local delivery" type="text" class="<?php echo esc_attr($disabled); ?>" data-optional="1" name="local-delivery-desc">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Local delivery fee</label>
+                        <input type="text" class="<?php echo esc_attr($disabled); ?>" title="Local delivery fee" data-optional="1" onchange="validate_delivery_fee(this);" id="local-delivery-fee" name="local-delivery-fee" maxlength="10">
+                        <span class="en_wd_err"></span>
+                    </div>
+                    <div class="en_wd_add_warehouse_input">
+                        <label>Suppress other rates <span class="suppress-span" title="This setting only suppresses rates that would otherwise be returned by the Eniture Technology products.">[?]</span></label>
+                        <div class="pickup-delivery-checkboxes <?php echo esc_attr($disabled); ?>">
+                            <input type="checkbox" title="Suppress other rates" id="suppress-local-delivery" name="suppress-local-delivery" value="" class="suppress-local-delivery" />
+                        </div>
+                    </div>
+
+
+                    <!--
+                        Local Delivery Ends
+                    -->
+                    <div class="form-btns">
+                        <input type="submit" name="en_wd_submit_warehouse" value="Save" class="save_warehouse_form" onclick="return en_ups_small_wd_save_warehouse();">
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
Index: /small-package-quotes-ups-edition/trunk/css/ups-small-style.css
===================================================================
--- /small-package-quotes-ups-edition/trunk/css/ups-small-style.css	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/css/ups-small-style.css	(revision 3237693)
@@ -422,5 +422,5 @@
 /*estimated delivery options css*/
 tr.all_shipment_days_ups_small_tr {
-    display: inline-block;
+    display: inline-table;
 }
 
@@ -640,2 +640,12 @@
     padding: 0 !important;
 }
+#en-woo-review-plugin {
+    display: flex;
+    justify-content: end;
+}
+#en-woo-review-plugin a {
+    width: initial !important;
+    height: auto !important;
+    text-transform: initial !important;
+    font-size: unset !important;
+}
Index: /small-package-quotes-ups-edition/trunk/fdo/freightdesk-online-section.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/fdo/freightdesk-online-section.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/fdo/freightdesk-online-section.php	(revision 3237693)
@@ -48,5 +48,5 @@
     }
 }
-$message = wp_sprintf('<div class="user_guide_fdo">
+$message = wp_sprintf('<div class="user_guide_fdo ups_small_wrapper">
     <h2>Connect to FreightDesk Online.</h2>
     <p>
Index: /small-package-quotes-ups-edition/trunk/fdo/validate-addresses-section.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/fdo/validate-addresses-section.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/fdo/validate-addresses-section.php	(revision 3237693)
@@ -12,5 +12,5 @@
 $link_freight = '<a href="https://validate-addresses.com/" target="_blank">Learn more</a>';
 $link_register = '<a href="https://validate-addresses.com/register" target="_blank">click here</a>';
-$message = wp_sprintf('<div class="user_guide_fdo">
+$message = wp_sprintf('<div class="user_guide_fdo ups_small_wrapper">
     <h2>Connect to Validate Addresses.</h2>
     <p>
Index: /small-package-quotes-ups-edition/trunk/js/en-ups-small.js
===================================================================
--- /small-package-quotes-ups-edition/trunk/js/en-ups-small.js	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/js/en-ups-small.js	(revision 3237693)
@@ -70,4 +70,15 @@
     jQuery('input[name=ups_small_delivery_estimates]').on('change', toggle_ups_delivery_estimate_label_fields);
 
+    // Review plugin button
+    if (jQuery('.ups_small_plan_notice').length > 0 || jQuery('.ups_small_wrapper').length > 0) {
+        const review_plugin_html = '<div id="en-woo-review-plugin"><a href="https://wordpress.org/support/plugin/small-package-quotes-ups-edition/reviews/#new-post" target="_blank" class="button button-primary is-primary">Review this plugin</a></div>';
+
+        if (jQuery('ul.subsubsub').length > 0) {
+            jQuery('.subsubsub').after(review_plugin_html); 
+        } else {
+            jQuery('li a:contains("Connection Settings")').closest('ul').after(review_plugin_html);
+        }
+    }
+
     var upsSmallCurrentTime = eniture_ups_small_admin_script.ups_small_order_cutoff_time;
     if (upsSmallCurrentTime != '') {
@@ -156,5 +167,5 @@
             type: "POST",
             url: ajaxurl,
-            data: {action: 'eniture_ups_small_activate_hit_to_update_plan'},
+            data: { action: 'eniture_ups_small_activate_hit_to_update_plan', wp_nonce: eniture_ups_small_admin_script.nonce },
             success: function (data_response) {}
         });
@@ -393,4 +404,5 @@
             'ups_small_license': jQuery('#ups_small_licence_key').val(),
             'api_end_point': api_endpoint,
+            'wp_nonce': eniture_ups_small_admin_script.nonce
         };
 
@@ -435,5 +447,6 @@
             'action': 'ups_s_fd',
             'company_id': jQuery('#freightdesk_online_id').val(),
-            'disconnect': jQuery('#fd_online_id_ups_s').attr("data")
+            'disconnect': jQuery('#fd_online_id_ups_s').attr("data"),
+            'wp_nonce': eniture_ups_small_admin_script.nonce
         }
         var id_lenght = jQuery('#freightdesk_online_id').val();
@@ -1039,5 +1052,5 @@
             type: "POST",
             url: ajaxurl,
-            data: {action: action},
+            data: { action: action, wp_nonce: eniture_ups_small_admin_script.nonce },
             success: function (data_response) {
                 window.location.reload(true);
Index: /small-package-quotes-ups-edition/trunk/logs/en-logs.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/logs/en-logs.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/logs/en-logs.php	(revision 3237693)
@@ -68,5 +68,8 @@
             $logs = (!empty($logs) && is_string($logs) && strlen($logs) > 0) ? json_decode($logs, true) : [];
 
-            echo '<table class="en_logs">';
+            // Eniture debug mode
+            do_action('eniture_debug_mode', 'UPS Small Logs', $logs);
+
+            echo '<table class="en_logs ups_small_wrapper">';
 
             if (isset($logs['severity'], $logs['data']) && $logs['severity'] == 'SUCCESS') {
@@ -207,5 +210,5 @@
             }
 
-            echo '<table>';
+            echo '</table>';
         }
 
Index: /small-package-quotes-ups-edition/trunk/order-details/en-order-widget.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/order-details/en-order-widget.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/order-details/en-order-widget.php	(revision 3237693)
@@ -35,4 +35,8 @@
                         case 'en_fdo_meta_data':
                             $en_widget_details = json_decode($meta_data->value, true);
+
+                            // Eniture debug mode
+                            do_action("eniture_debug_mood", "Order Widget Details (UPS Small)", $en_widget_details);
+
                             if (!empty($en_widget_details)) {
                                 $this->en_widget_details[] = $en_widget_details;
@@ -168,5 +172,7 @@
                 'liftgate' => 'Lift gate delivery',
                 'hazmat' => 'Hazardous Material',
-                'holdatterminal' => 'Hold At Terminal'
+                'holdatterminal' => 'Hold At Terminal',
+                'limitedaccess' => 'Limited access delivery',
+                'liftgate_pickup' => 'Lift gate pickup',
             ];
 
Index: /small-package-quotes-ups-edition/trunk/readme.txt
===================================================================
--- /small-package-quotes-ups-edition/trunk/readme.txt	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/readme.txt	(revision 3237693)
@@ -4,5 +4,5 @@
 Requires at least: 6.6
 Tested up to: 6.7.1
-Stable tag: 4.5.16
+Stable tag: 4.5.17
 License:           GPL-2.0-or-later
 License URI:       https://www.gnu.org/licenses/gpl-2.0.html
@@ -143,4 +143,15 @@
 == Changelog ==
 
+= 4.5.17 =
+* Update:  Added a new "Review Plugin" button for improved user feedback and engagement.
+* Update:  Override Rates Shipping Rule: added Negative & Percentage Service Rate.
+* Update:  Restrict To Location Rule: Introduced filters support.
+* Update:  Minimum Shipping Charge Rule: Implemented a new rule to set a minimum charge for shipping.
+* Update:  Free Shipping Rule: Added functionality to allow free shipping conditions based on configured rules.
+* Fix: Export Products Functionality: Fixed issues with old nested material attributes of products to ensure accurate exports.
+* Fix:Security Enhancements: Resolved vulnerability issues for improved plugin security and compliance.
+* Fix:Request Parameters Sanitization: Improved sanitization in shipping rules to enhance data integrity
+
+
 = 4.5.16 =
 * Fix: Fixed order the shipping rule "Type" alphabetically. 
Index: /small-package-quotes-ups-edition/trunk/shipping-rules/assets/css/shipping_rules.css
===================================================================
--- /small-package-quotes-ups-edition/trunk/shipping-rules/assets/css/shipping_rules.css	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/shipping-rules/assets/css/shipping_rules.css	(revision 3237693)
@@ -18,5 +18,6 @@
 .en_sr_form_control #en_ups_small_filter_by_state_label,
 .en_sr_form_control #en_ups_small_filter_by_origin_label,
-.en_sr_form_control #en_ups_small_filter_by_sevices_label {
+.en_sr_form_control #en_ups_small_filter_by_sevices_label,
+.en_sr_form_control #en_ups_small_msc_filter_by_sevices_label {
 	margin-bottom: -15px !important;
 }
@@ -46,8 +47,10 @@
 
 label[for='en_sr_service_name']::after,
-label[for='en_sr_service_rate']::after,
+label[for='en_ups_small_sr_service_rate']::after,
 label[for='en_ups_small_filter_by_state']::after,
 label[for='en_ups_small_filter_by_origin']::after,
-label[for='en_ups_small_filter_by_sevices']::after {
+label[for='en_ups_small_filter_by_sevices']::after,
+label[for='en_ups_small_msc_filter_by_sevices']::after,
+label[for='en_sr_minimum_shipping_charge']::after {
 	content: ' *';
 	color: red;
Index: /small-package-quotes-ups-edition/trunk/shipping-rules/assets/js/shipping_rules.js
===================================================================
--- /small-package-quotes-ups-edition/trunk/shipping-rules/assets/js/shipping_rules.js	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/shipping-rules/assets/js/shipping_rules.js	(revision 3237693)
@@ -9,9 +9,11 @@
 
 	const rule_types = {
+		free_shipping: 'Free Shipping',
 		hide_methods: 'Hide Methods',
+		hide_methods_by_origin_location: 'Hide Methods By Origin',
+		large_cart_settings: 'Large Cart Settings',
+		minimum_shipping_charge: 'Minimum Shipping Charge',
 		override_rates: 'Override Rates',
 		restrict_to_state: 'Restrict To State',
-		large_cart_settings: 'Large Cart Settings',
-		hide_methods_by_origin_location: 'Hide Methods By Origin',
 	};
 
@@ -28,5 +30,5 @@
 			'en_sr_product_tags_list',
 			'en_sr_service_name',
-			'en_sr_service_rate',
+			'en_ups_small_sr_service_rate',
 			'en_sr_max_items',
 			'en_sr_max_weight_per_package'
@@ -43,8 +45,19 @@
 		jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val([]);
 		jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val([]);
+		// Override rates
+		jQuery('#en_ups_small_or_sr_country').val('');
+		jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val([]);
+		jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val([]);
+		// Minimum shipping charge
+		jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val([]);
 
 		enUpsSmalltoggleRuleTypeFields();
+		
+		// Restrict to state
 		enUpsSmallToggleCountryStates();
 		enUpsSmallSetStatesValidation(false, true);
+
+		// Override rates shipping rule
+		enUpsSmallORToggleCountryStates();
 	});
 
@@ -52,5 +65,5 @@
 
 	jQuery(
-		'#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_service_rate, #en_sr_max_items, #en_sr_max_weight_per_package'
+		'#en_sr_weight_from, #en_sr_weight_to, #en_sr_price_from, #en_sr_price_to, #en_sr_max_items, #en_sr_max_weight_per_package, #en_sr_minimum_shipping_charge'
 	).keypress(function (e) {
 		if (!String.fromCharCode(e.keyCode).match(/^[0-9.]+$/)) return false;
@@ -59,5 +72,9 @@
 		if (!String.fromCharCode(e.keyCode).match(/^[0-9]+$/)) return false;
 	});
-
+	jQuery('#en_ups_small_sr_service_rate').keypress(function (e) {
+		if (!String.fromCharCode(e.keyCode).match(/^[0-9.%+-]+$/)) return false;
+	});
+
+	// Restrict to state
 	enUpsSmallToggleCountryStates();
 	jQuery('#en_ups_small_sr_country').on('change load', function() {
@@ -66,9 +83,18 @@
 	});
 
+	// Override rates shipping rule
+	enUpsSmallORToggleCountryStates();
+	jQuery('#en_ups_small_or_sr_country').on('change load', enUpsSmallORToggleCountryStates);
+	jQuery('#filter_by_country_or').on('change', function () {
+		!this.checked && jQuery('#filter_by_state_or').prop('checked', false);
+	});
+	jQuery('#filter_by_state_or').on('change', function () {
+		this.checked && jQuery('#filter_by_country_or').prop('checked', true);
+	});
+
 	jQuery('#en_ups_small_filter_by_country').on('change load', function () {
 		// if country is unchecked, then uncheck state also
 		if (!this.checked) jQuery('#en_ups_small_filter_by_state').prop('checked', false);
 	});
-
 	jQuery('#en_ups_small_filter_by_state').on('change', function () {
 		this.checked && jQuery('#en_ups_small_filter_by_country').prop('checked', this.checked);
@@ -222,4 +248,5 @@
 	function enUpsSmallSaveShippingRule(e) {
 		e.preventDefault();
+		jQuery('.en_ups_small_sr_form .en_sr_err').html('');
 
 		let is_valid = enUpsSmallSRValidateInput('#add_shipping_rule');
@@ -234,4 +261,10 @@
 		}
 
+		// apply required field validations for override rates rule
+		if (rule_type === rule_types.override_rates) {
+			const validate = enUpsSmallORValidations();
+			is_valid = is_valid && validate;
+		}
+
 		// apply required field validations for hide methods by origin location rule
 		if (rule_type === rule_types.hide_methods_by_origin_location) {
@@ -240,4 +273,10 @@
 		}
 
+		// apply required field validations for minimum shipping charge rule
+		if (rule_type === rule_types.minimum_shipping_charge) {
+			const validate = enUpsSmallMSCValidations();
+			is_valid = is_valid && validate;
+		}
+
 		if (!is_valid) {
 			jQuery('.content').delay(200).animate({ scrollTop: 0 }, 300);
@@ -251,8 +290,16 @@
 		const origins_value = hide_methods_by_origin_rule ? jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val() : [];
 		const services_value = hide_methods_by_origin_rule ? jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val() : [];
+		// Override rates rule
+		const or_rule = rule_type === rule_types.override_rates;
+		let or_states_values = [];
+		or_states_values = jQuery('#en_ups_small_or_sr_country').val() === 'US' ? jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val(): or_states_values;
+		or_states_values = jQuery('#en_ups_small_or_sr_country').val() === 'CA' ? jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val(): or_states_values;
+		// Minimum shipping charge rule
+		const msc_rule = rule_type === rule_types.minimum_shipping_charge;
 
 		// Submit the form to save settings
 		const postData = {
 			action: 'en_save_shipping_rule',
+			wp_nonce: sr_script.nonce,
 			rule_id: jQuery('#edit_sr_form_id').val(),
 			name: jQuery('#en_sr_rule_name').val(),
@@ -260,5 +307,5 @@
 			is_active: Number(jQuery('#en_sr_avialable').prop('checked')),
 			settings: {
-				filter_name: [rule_types.hide_methods, rule_types.override_rates].includes(rule_type) ? jQuery('#en_sr_filter_name').val() : '',
+				filter_name: '',
 				apply_to: jQuery('input[name="apply_to"]:checked').val(),
 				// Filter by country
@@ -284,6 +331,6 @@
 				filter_by_product_tag_value: jQuery('#en_sr_product_tags_list').val(),
 				// Service info
-				service: jQuery('#en_sr_service_name').val(),
-				service_rate: jQuery('#en_sr_service_rate').val(),
+				service: or_rule ? jQuery('#en_sr_service_name').val() : '',
+				service_rate: or_rule ? jQuery('#en_ups_small_sr_service_rate').val() : '',
 				// Large cart settings
 				max_items: jQuery('#en_sr_max_items').val(),
@@ -294,4 +341,12 @@
 				filter_by_service: hide_methods_by_origin_rule,
 				filter_by_service_value: hide_methods_by_origin_rule ? services_value : [],
+				// Override rates country and state filters
+				filter_by_country_or: or_rule ? jQuery('#filter_by_country_or').prop('checked') : false,
+				filter_by_country_value_or: or_rule ? jQuery('#en_ups_small_or_sr_country').val() : '',
+				filter_by_state_or: or_rule ? jQuery('#filter_by_state_or').prop('checked') : false,
+				filter_by_state_value_or: or_rule ? or_states_values : [],
+				// Minimum shipping charge
+				minimum_shipping_charge: msc_rule ? jQuery('#en_sr_minimum_shipping_charge').val() : '',
+				minimum_shipping_charge_services: msc_rule ? jQuery('#en_msc_sr_services_list').val() : [],
 			},
 		};
@@ -359,8 +414,10 @@
 		jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').val([]);
 		jQuery('.en_ups_small_sr_services_list #en_sr_services_list').val([]);
+		jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val([]);
 
 		const postForm = {
 			action: 'en_edit_shipping_rule',
 			edit_id: rule_id,
+			wp_nonce: sr_script.nonce,
 		};
 
@@ -374,5 +431,5 @@
 				jQuery(elem).css(
 					'background',
-					`rgba(255, 255, 255, 1) url("${script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
 				);
 			},
@@ -382,85 +439,5 @@
 
 				if (data) {
-					jQuery('#edit_sr_form_id').val(data?.rule_data.id);
-					jQuery('#en_sr_rule_name').val(data?.rule_data?.name);
-					jQuery('#en_ups_small_rule_type').val(data?.rule_data?.type);
-					jQuery('#en_sr_avialable').prop(
-						'checked',
-						Number(data?.rule_data?.is_active)
-					);
-
-					enUpsSmalltoggleRuleTypeFields();
-
-					const settings = JSON.parse(data?.rule_data?.settings) ?? {};
-					
-					jQuery('input[name="apply_to"]').val([settings?.apply_to]);
-					jQuery('#en_sr_filter_name').val(settings?.filter_name);
-					// Override rates
-					jQuery('#en_sr_service_name').val(settings?.service);
-					jQuery('#en_sr_service_rate').val(settings?.service_rate);
-					// Large cart settings
-					jQuery('#en_sr_max_items').val(settings?.max_items);
-					jQuery('#en_sr_max_weight_per_package').val(
-						settings?.max_weight_per_package
-					);
-
-					// Restrict to state
-					if (jQuery('#en_ups_small_rule_type').val() === rule_types.restrict_to_state) {
-						jQuery('#en_ups_small_filter_by_country').prop('checked', settings?.filter_by_country === 'true');
-						jQuery('#en_ups_small_sr_country').val(settings?.filter_by_country_value || 'US');
-						jQuery('#en_ups_small_filter_by_state').prop('checked', settings?.filter_by_state === 'true');
-						enUpsSmallSetStatesValidation(true, false);
-						
-						if (data?.country_states_markup) {
-							const countryId = settings?.filter_by_country_value;
-							jQuery(countryId === 'US' ? '.en_ups_small_sr_us_states_list #en_sr_states_list' : '.en_ups_small_sr_ca_states_list #en_sr_states_list').html(data?.country_states_markup).trigger('change');
-						}
-						
-						enUpsSmallToggleCountryStates();
-					}
-
-					// Hide methods by origin location
-					if (jQuery('#en_ups_small_rule_type').val() === rule_types.hide_methods_by_origin_location) {
-						jQuery('#filter_by_origin').prop('checked', settings?.filter_by_origin === 'true');
-						jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').html(data?.origins_markup).trigger('change');
-
-						jQuery("#filter_by_service").prop('checked', settings?.filter_by_service === 'true');
-						jQuery('.en_ups_small_sr_services_list #en_sr_services_list').html(data?.services_markup).trigger('change');
-					}
-
-					// Common filters settings
-					jQuery('#filter_by_weight').prop(
-						'checked',
-						settings?.filter_by_weight === 'true'
-					);
-					settings?.filter_by_weight === 'true' &&
-						removeDataAttribute('en_sr_weight_from');
-					jQuery('#en_sr_weight_from').val(settings?.filter_by_weight_from);
-					jQuery('#en_sr_weight_to').val(settings?.filter_by_weight_to);
-					jQuery('#en_sr_filter_price').prop(
-						'checked',
-						settings?.filter_by_price === 'true'
-					);
-					settings?.filter_by_price === 'true' &&
-						removeDataAttribute('en_sr_price_from');
-					jQuery('#en_sr_price_from').val(settings?.filter_by_price_from);
-					jQuery('#en_sr_price_to').val(settings?.filter_by_price_to);
-					jQuery('#filter_by_quantity').prop(
-						'checked',
-						settings?.filter_by_quantity === 'true'
-					);
-					settings?.filter_by_quantity === 'true' &&
-						removeDataAttribute('en_sr_quantity_from');
-					jQuery('#en_sr_quantity_from').val(settings?.filter_by_quantity_from);
-					jQuery('#en_sr_quantity_to').val(settings?.filter_by_quantity_to);
-					jQuery('#filter_by_product_tag').prop(
-						'checked',
-						settings?.filter_by_product_tag === 'true'
-					);
-					settings?.filter_by_product_tag === 'true' &&
-						removeDataAttribute('en_sr_product_tags_list');
-					jQuery('#en_sr_product_tags_list')
-						.html(data?.product_tags_markup)
-						.trigger('change');
+					enUpsSmallSRPopulateData(data);
 					jQuery('.content').animate({ scrollTop: 0 }, 0);
 
@@ -493,4 +470,5 @@
 			action: 'en_delete_shipping_rule',
 			delete_id: id,
+			wp_nonce: sr_script.nonce,
 		};
 
@@ -504,5 +482,5 @@
 				jQuery(elem).css(
 					'background',
-					`rgba(255, 255, 255, 1) url("${script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
 				);
 			},
@@ -535,4 +513,5 @@
 			rule_id,
 			is_active: Number(!Number(is_active)),
+			wp_nonce: sr_script.nonce,
 		};
 
@@ -546,5 +525,5 @@
 				jQuery(elem).css(
 					'background',
-					`rgba(255, 255, 255, 1) url("${script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
+					`rgba(255, 255, 255, 1) url("${sr_script.pluginsUrl}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/processing.gif") no-repeat scroll 50% 50%`
 				);
 			},
@@ -573,5 +552,4 @@
 				<td class="en_wd_warehouse_list_data">${rule?.name}</td>
 				<td class="en_wd_warehouse_list_data">${rule?.type}</td>
-				<td class="en_wd_warehouse_list_data">${rule?.settings?.filter_name}</td>
 				<td class="en_wd_warehouse_list_data"><a href="#" class='en_ups_sr_status_link' data-id='${
 					rule?.id
@@ -581,5 +559,5 @@
 					<a href="#" class="en_ups_sr_edit_link" data-id="${rule?.id}">
 						<img src="${
-							script.pluginsUrl
+							sr_script.pluginsUrl
 						}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png" title="Edit">
 					</a>
@@ -587,5 +565,5 @@
 					<a href="#" class="en_ups_sr_delete_link" data-id="${rule?.id}">
 						<img src="${
-							script.pluginsUrl
+							sr_script.pluginsUrl
 						}/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png" title="Delete">
 					</a>
@@ -601,39 +579,55 @@
 		jQuery('#en_ups_small_sr_content').css('height', '80vh');
 		enUpsSmallSetStatesValidation(false, true);
+		jQuery('.en_sr_hide_methods_by_origin_location, .en_ups_small_sr_large_cart_settings, .en_sr_min_shipping_charge, .en_sr_override_rates, .en_sr_restrict_to_state, #en_sr_apply_to_product').hide();
 
 		if (type === rule_types.override_rates) {
-			jQuery('.en_sr_override_rates, .en_ups_small_sr_apply_to, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section').show();
-			jQuery('#en_sr_apply_to_cart, .en_sr_restrict_to_state, .en_ups_small_sr_large_cart_settings, .en_sr_hide_methods_by_origin_location').hide();
+			jQuery('.en_sr_override_rates, .en_ups_small_sr_apply_to, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section, .en_or_sr_filters').show();
+			jQuery('#en_sr_apply_to_cart').hide();
 			jQuery('input[name="apply_to"]').val(['shipment']);
 			
 			setDataAttribute('en_sr_max_items', 'en_sr_max_weight_per_package');
-			removeDataAttribute('en_sr_service_name', 'en_sr_service_rate');
+			removeDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate');
 		} else if (type === rule_types.restrict_to_state) {
-			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, .en_sr_restrict_to_state').show();
+			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, .en_sr_restrict_to_state, .en_ups_small_sr_filters_section').show();
 			jQuery('input[name="apply_to"]').val(['cart']);
-			jQuery('.en_sr_override_rates, #en_sr_apply_to_shipment, .en_ups_small_sr_large_cart_settings, .en_sr_hide_methods_by_origin_location, .en_ups_small_sr_filters_section').hide();
-
-			setDataAttribute('en_sr_service', 'en_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			jQuery('#en_sr_apply_to_shipment, .en_or_sr_filters').hide();
+
+			setDataAttribute('en_sr_service', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
 			enUpsSmallSetStatesValidation();
 		} else if (type === rule_types.large_cart_settings) {
-			jQuery('.en_sr_override_rates, .en_ups_small_sr_apply_to, .en_sr_restrict_to_state, .en_sr_hide_methods_by_origin_location, .en_ups_small_sr_filters_section').hide();
+			jQuery('.en_ups_small_sr_apply_to, .en_ups_small_sr_filters_section, .en_or_sr_filters').hide();
 			jQuery('.en_ups_small_sr_large_cart_settings').show();
 			jQuery('input[name="apply_to"]').val(['cart']);
 
-			setDataAttribute('en_sr_service_name', 'en_sr_service_rate');
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate');
 			removeDataAttribute('en_sr_max_items', 'en_sr_max_weight_per_package');
 		} else if (type === rule_types.hide_methods_by_origin_location) {
 			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_shipment, .en_sr_hide_methods_by_origin_location').show();
-			jQuery('.en_sr_override_rates, #en_sr_apply_to_cart, .en_sr_restrict_to_state, .en_ups_small_sr_large_cart_settings, .en_ups_small_sr_filters_section').hide();
+			jQuery('#en_sr_apply_to_cart, .en_ups_small_sr_filters_section, .en_or_sr_filters').hide();
 			jQuery('input[name="apply_to"]').val(['shipment']);
 			
-			setDataAttribute('en_sr_service_name', 'en_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
 			removeDataAttribute('en_sr_locations_list, en_sr_services_list');
+		} else if (type === rule_types.minimum_shipping_charge) {
+			jQuery('.en_or_sr_filters').hide();
+			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, #en_sr_apply_to_shipment, .en_sr_min_shipping_charge, .en_ups_small_sr_filters_section').show();
+			jQuery('input[name="apply_to"]').val(['shipment']);
+
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			removeDataAttribute('en_sr_minimum_shipping_charge', 'en_msc_sr_services_list');
 		} else {
-			jQuery('.en_sr_override_rates, .en_sr_restrict_to_state, .en_ups_small_sr_large_cart_settings, .en_sr_hide_methods_by_origin_location').hide();
-			jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section').show();
-			jQuery('input[name="apply_to"]').val(['cart']);
-			
-			setDataAttribute('en_sr_service_name', 'en_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package');
+			jQuery('.en_or_sr_filters').hide();
+
+			if (type === rule_types.free_shipping) {
+				jQuery('#en_sr_apply_to_cart, #en_sr_apply_to_shipment').hide();
+				jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_product, .en_ups_small_sr_filters_section').show();
+				jQuery('input[name="apply_to"]').val(['product']);
+			} else {
+				jQuery('#en_sr_apply_to_product').hide();
+				jQuery('.en_ups_small_sr_apply_to, #en_sr_apply_to_cart, #en_sr_apply_to_shipment, .en_ups_small_sr_filters_section').show();
+				jQuery('input[name="apply_to"]').val(['cart']);
+			}
+
+			setDataAttribute('en_sr_service_name', 'en_ups_small_sr_service_rate', 'en_sr_max_items', 'en_sr_max_weight_per_package', 'en_sr_locations_list', 'en_sr_services_list', 'en_sr_minimum_shipping_charge', 'en_msc_sr_services_list');
 		}
 	}
@@ -657,5 +651,5 @@
 	}
 
-	// #region Toggle country states
+	// #region Toggle country states (Restrict to State rule)
 	function enUpsSmallToggleCountryStates() {
 		const selectedCountry = jQuery('#en_ups_small_sr_country').val();
@@ -664,4 +658,19 @@
 	}
 
+	// #region Toggle country states (Override rates rule)
+	function enUpsSmallORToggleCountryStates() {
+		const selectedCountry = jQuery('#en_ups_small_or_sr_country').val();
+
+		if (!selectedCountry) {
+			jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val([]);
+			jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val([]);
+		}
+
+		jQuery('.en_ups_small_or_empty_sr_states_list').css('display', !selectedCountry ? '' : 'none');
+		jQuery('.en_ups_small_or_sr_us_states_list').css('display', selectedCountry === 'US' ? '' : 'none');
+		jQuery('.en_ups_small_or_sr_ca_states_list').css('display', selectedCountry === 'CA' ? '' : 'none');
+	}
+
+	// #region: Hide Methods by Origin Location Validations
 	function enUpsSmallHMBLValidations() {
 		const ids = ['#en_sr_locations_list', '#en_sr_services_list'];
@@ -679,3 +688,136 @@
 		return is_valid;
 	}
+
+	// #region: Override Rates Validations
+	function enUpsSmallORValidations() {
+		let is_valid = true;
+
+		// Filter by country
+		if (jQuery('#filter_by_country_or').prop('checked') && !jQuery('#en_ups_small_or_sr_country').val()) {
+			jQuery('#en_ups_small_or_sr_country').parent().find('.en_sr_err').html('Country is required.');
+			is_valid = false;
+		}
+
+		// Filter by state
+		if (jQuery('#filter_by_state_or').prop('checked')) {
+			const selectedCountry = jQuery('#en_ups_small_or_sr_country').val(),
+						us_states_value = jQuery('.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').val(),
+						ca_states_value = jQuery('.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').val(),
+						parent_elem = '.en_ups_small_or_empty_sr_states_list, .en_ups_small_or_sr_us_states_list, .en_ups_small_or_sr_ca_states_list';
+
+			if (!selectedCountry || (selectedCountry === 'US' && !us_states_value?.length) || 
+					(selectedCountry === 'CA' && !ca_states_value?.length)) {
+				jQuery(parent_elem).find('.en_sr_err').html('State is required.');
+				is_valid = false;
+			}
+		}
+
+		return is_valid;
+	}
+
+	// #region: Populate Shipping Rule Data
+	function enUpsSmallSRPopulateData(data) {
+		jQuery('#edit_sr_form_id').val(data?.rule_data.id);
+		jQuery('#en_sr_rule_name').val(data?.rule_data?.name);
+		jQuery('#en_ups_small_rule_type').val(data?.rule_data?.type);
+		jQuery('#en_sr_avialable').prop(
+			'checked',
+			Number(data?.rule_data?.is_active)
+		);
+
+		enUpsSmalltoggleRuleTypeFields();
+
+		const settings = JSON.parse(data?.rule_data?.settings) ?? {};
+		
+		jQuery('input[name="apply_to"]').val([settings?.apply_to]);
+		// Override rates
+		jQuery('#en_sr_service_name').val(settings?.service);
+		jQuery('#en_ups_small_sr_service_rate').val(settings?.service_rate);
+		// Large cart settings
+		jQuery('#en_sr_max_items').val(settings?.max_items);
+		jQuery('#en_sr_max_weight_per_package').val(
+			settings?.max_weight_per_package
+		);
+
+		const rule_type = jQuery('#en_ups_small_rule_type').val();
+
+		// Hide methods by origin location
+		if (rule_type === rule_types.hide_methods_by_origin_location) {
+			jQuery('#filter_by_origin').prop('checked', settings?.filter_by_origin === 'true');
+			jQuery('.en_ups_small_sr_locations_list #en_sr_locations_list').html(data?.origins_markup).trigger('change');
+
+			jQuery("#filter_by_service").prop('checked', settings?.filter_by_service === 'true');
+			jQuery('.en_ups_small_sr_services_list #en_sr_services_list').html(data?.services_markup).trigger('change');
+		}
+
+		// Minimum shipping charge
+		if (rule_type === rule_types.minimum_shipping_charge) {
+			jQuery('#en_sr_minimum_shipping_charge').val(settings?.minimum_shipping_charge);
+			jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').html(data?.services_markup).trigger('change');
+		}
+
+		// Override rates
+		if (rule_type === rule_types.override_rates) {
+			jQuery('#filter_by_country_or').prop('checked', settings?.filter_by_country_or === 'true');
+			jQuery('#en_ups_small_or_sr_country').val(settings?.filter_by_country_value_or);
+			jQuery('#filter_by_state_or').prop('checked', settings?.filter_by_state_or === 'true');
+
+			if (data?.or_country_states_markup) {
+				const country = settings?.filter_by_country_value_or;
+				jQuery(!country && '.en_ups_small_or_empty_sr_states_list #en_or_empty_sr_states_list').html('').trigger('change');
+				jQuery(country === 'US' && '.en_ups_small_or_sr_us_states_list #en_or_sr_states_list').html(data?.or_country_states_markup).trigger('change');
+				jQuery(country === 'CA' && '.en_ups_small_or_sr_ca_states_list #en_or_sr_states_list').html(data?.or_country_states_markup).trigger('change');
+			}
+
+			enUpsSmallORToggleCountryStates();
+		}
+
+		// Restrict to state
+		if (rule_type === rule_types.restrict_to_state) {
+			jQuery('#en_ups_small_filter_by_country').prop('checked', settings?.filter_by_country === 'true');
+			jQuery('#en_ups_small_sr_country').val(settings?.filter_by_country_value || 'US');
+			jQuery('#en_ups_small_filter_by_state').prop('checked', settings?.filter_by_state === 'true');
+			enUpsSmallSetStatesValidation(true, false);
+			
+			if (data?.country_states_markup) {
+				const countryId = settings?.filter_by_country_value;
+				jQuery(countryId === 'US' ? '.en_ups_small_sr_us_states_list #en_sr_states_list' : '.en_ups_small_sr_ca_states_list #en_sr_states_list').html(data?.country_states_markup).trigger('change');
+			}
+			
+			enUpsSmallToggleCountryStates();
+		}
+
+		// Common filters settings
+		// Weight
+		jQuery('#filter_by_weight').prop('checked', settings?.filter_by_weight === 'true');
+		settings?.filter_by_weight === 'true' && removeDataAttribute('en_sr_weight_from');
+		jQuery('#en_sr_weight_from').val(settings?.filter_by_weight_from);
+		jQuery('#en_sr_weight_to').val(settings?.filter_by_weight_to);
+		// Price
+		jQuery('#en_sr_filter_price').prop('checked', settings?.filter_by_price === 'true');
+		settings?.filter_by_price === 'true' && removeDataAttribute('en_sr_price_from');
+		jQuery('#en_sr_price_from').val(settings?.filter_by_price_from);
+		jQuery('#en_sr_price_to').val(settings?.filter_by_price_to);
+		// Quantity
+		jQuery('#filter_by_quantity').prop('checked', settings?.filter_by_quantity === 'true');
+		settings?.filter_by_quantity === 'true' && removeDataAttribute('en_sr_quantity_from');
+		jQuery('#en_sr_quantity_from').val(settings?.filter_by_quantity_from);
+		jQuery('#en_sr_quantity_to').val(settings?.filter_by_quantity_to);
+		// Product tags
+		jQuery('#filter_by_product_tag').prop('checked', settings?.filter_by_product_tag === 'true');
+		settings?.filter_by_product_tag === 'true' && removeDataAttribute('en_sr_product_tags_list');
+		jQuery('#en_sr_product_tags_list').html(data?.product_tags_markup).trigger('change');
+	}
+
+	// #region: Minimum Shipping Charge Validations
+	function enUpsSmallMSCValidations() {
+		let is_valid = true;
+
+		if (!jQuery('.en_ups_small_msc_sr_services_list #en_msc_sr_services_list').val()?.length) {
+			jQuery('.en_ups_small_msc_sr_services_list').find('.en_sr_err').html('Services is required.');
+			is_valid = false;
+		}
+
+		return is_valid;
+	}
 });
Index: /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-save.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-save.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-save.php	(revision 3237693)
@@ -37,4 +37,9 @@
         function save_shipping_rule_ajax()
         {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
             global $wpdb;
 
@@ -42,10 +47,12 @@
             $error = false;
             $data = $_POST;
-            $get_shipping_rule_id = (isset($data['rule_id']) && intval($data['rule_id'])) ? $data['rule_id'] : "";
+            $data = $this->sanitize_request_data($data);
+            $get_shipping_rule_id = (isset($data['rule_id']) && intval($data['rule_id'])) ? intval($data['rule_id']) : "";
             $last_id = $get_shipping_rule_id;
             $get_shipping_rule = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules WHERE name = %s", $data['name']));
             unset($data['action']);
             unset($data['rule_id']);
-            
+            unset($data['wp_nonce']);
+
             if (!empty($get_shipping_rule_id)) {
                 $data['settings'] = wp_json_encode($data['settings']);
@@ -78,15 +85,24 @@
         function edit_shipping_rule_ajax()
         {
-            global $wpdb;
-            $get_shipping_rule_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? sanitize_text_field(wp_unslash($_POST['edit_id'])) : "";
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? intval($_POST['edit_id']) : "";
             $shipping_rules_list = $wpdb->get_results(
                 "SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules WHERE id=$get_shipping_rule_id"
             );
+            $shipping_rules_type = isset(reset($shipping_rules_list)->type) ? reset($shipping_rules_list)->type : '';
+
             $product_tags_markup = $this->get_product_tags_markup($shipping_rules_list);
             $states_markup = $this->get_country_states_markup($shipping_rules_list);
             $origins_markup = $this->get_origins_markup($shipping_rules_list);
-            $services_markup = $this->get_services_markup($shipping_rules_list);
-
-            $data = ['rule_data' => reset($shipping_rules_list), 'product_tags_markup' => $product_tags_markup, 'country_states_markup' => $states_markup, 'origins_markup' => $origins_markup, 'services_markup' => $services_markup];
+            $services_markup = $this->get_services_markup($shipping_rules_list, $shipping_rules_type);
+            // override rates rule
+            $or_states_markup = $shipping_rules_type == 'Override Rates' ? $this->get_country_states_markup($shipping_rules_list, true) : '';
+
+            $data = ['rule_data' => reset($shipping_rules_list), 'product_tags_markup' => $product_tags_markup, 'country_states_markup' => $states_markup, 'origins_markup' => $origins_markup, 'services_markup' => $services_markup, 'or_country_states_markup' => $or_states_markup,];
 
             echo wp_json_encode($data);
@@ -101,6 +117,11 @@
         function delete_shipping_rule_ajax()
         {
-            global $wpdb;
-            $get_shipping_rule_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? sanitize_text_field(wp_unslash($_POST['delete_id'])) : "";
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? intval($_POST['delete_id']) : "";
             $qry = $wpdb->delete($wpdb->prefix . 'eniture_ups_small_shipping_rules', array('id' => $get_shipping_rule_id));
 
@@ -116,9 +137,14 @@
         function update_shipping_rule_status_ajax()
         {
-            global $wpdb;
-            $get_shipping_rule_id = (isset($_POST['rule_id']) && intval($_POST['rule_id'])) ? sanitize_text_field(wp_unslash($_POST['rule_id'])) : "";
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_sr_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_shipping_rule_id = (isset($_POST['rule_id']) && intval($_POST['rule_id'])) ? intval($_POST['rule_id']) : "";
             $is_active = isset($_POST['is_active']) ? sanitize_text_field(wp_unslash($_POST['is_active'])) : "";
             $data = ['is_active' => $is_active];
-            
+
             $update_qry = $wpdb->update(
                 $wpdb->prefix . 'eniture_ups_small_shipping_rules', $data, array('id' => $get_shipping_rule_id)
@@ -199,10 +225,12 @@
          * @global $wpdb
          */
-        function get_country_states_markup($shipping_rules_list)
+        function get_country_states_markup($shipping_rules_list, $override_rates_rule = false)
         {
             $states_options = '';
             $shipping_rules_list = reset($shipping_rules_list);
             $settings = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
-            $selected_states_detials = $this->get_selected_states_details($settings);
+            $filter_by_state_val = $override_rates_rule ? 'filter_by_state_value_or' : 'filter_by_state_value';
+            $filter_by_country_val = $override_rates_rule ? 'filter_by_country_value_or' : 'filter_by_country_value';
+            $selected_states_detials = $this->get_selected_states_details($settings, $filter_by_state_val, $filter_by_country_val);
 
             if (!empty($selected_states_detials) && is_array($selected_states_detials)) {
@@ -212,15 +240,15 @@
             }
 
-            if (empty($settings['filter_by_state_value']) || !is_array($settings['filter_by_state_value'])) {
-                $settings['filter_by_state_value'] = [];
+            if (empty($settings[$filter_by_state_val]) || !is_array($settings[$filter_by_state_val])) {
+                $settings[$filter_by_state_val] = [];
             }
 
             $countries_obj = new WC_Countries();
-            $selected_country = isset($settings['filter_by_country_value']) ? $settings['filter_by_country_value'] : '';
+            $selected_country = isset($settings[$filter_by_country_val]) ? $settings[$filter_by_country_val] : '';
             $en_woo_states = $countries_obj->get_states($selected_country);
 
-            if (!empty($en_woo_states) && is_array($settings['filter_by_state_value'])) {
+            if (!empty($en_woo_states) && is_array($settings[$filter_by_state_val])) {
                 foreach ($en_woo_states as $s_code => $s_label) {
-                    if (!in_array($s_code, $settings['filter_by_state_value'])) {
+                    if (!in_array($s_code, $settings[$filter_by_state_val])) {
                         $states_options .= "<option value='" . esc_attr($s_code) . "'>" . esc_html($s_label) . "</option>";
                     }
@@ -236,7 +264,7 @@
          * @global $wpdb
          */
-        function get_selected_states_details($settings)
-        {
-            $states_arr = isset($settings['filter_by_state_value']) ? $settings['filter_by_state_value'] : [];
+        function get_selected_states_details($settings, $filter_by_state_val, $filter_by_country_val)
+        {
+            $states_arr = isset($settings[$filter_by_state_val]) ? $settings[$filter_by_state_val] : [];
             if (empty($states_arr) || !is_array($states_arr)) {
                 return [];
@@ -244,5 +272,5 @@
 
             $countries_obj = new WC_Countries();
-            $selected_country = isset($settings['filter_by_country_value']) ? $settings['filter_by_country_value'] : '';
+            $selected_country = isset($settings[$filter_by_country_val]) ? $settings[$filter_by_country_val] : '';
             $en_woo_states = $countries_obj->get_states($selected_country);
             $states_detail = [];
@@ -306,5 +334,5 @@
         }
 
-        function get_services_markup($shipping_rules_list)
+        function get_services_markup($shipping_rules_list, $type)
         {
             $services_options = '';
@@ -312,5 +340,5 @@
             $settings = isset($shipping_rules_list->settings) ? json_decode($shipping_rules_list->settings, true) : [];
             $services = $this->get_all_services();
-            $selected_services_detials = $this->get_selected_services_details($settings, $services);
+            $selected_services_detials = $this->get_selected_services_details($settings, $services, $type);
 
             if (!empty($selected_services_detials) && is_array($selected_services_detials)) {
@@ -320,10 +348,11 @@
             }
 
-            if (empty($settings['filter_by_service_value']) || !is_array($settings['filter_by_service_value'])) {
-                $settings['filter_by_service_value'] = [];
+            $filter_by_service = $type == 'Hide Methods By Origin' ? 'filter_by_service_value' : 'minimum_shipping_charge_services';
+            if (empty($settings[$filter_by_service]) || !is_array($settings[$filter_by_service])) {
+                $settings[$filter_by_service] = [];
             }
 
             foreach ($services as $key => $service) {
-                if (in_array($key, $settings['filter_by_service_value'])) continue;
+                if (in_array($key, $settings[$filter_by_service])) continue;
                 $services_options .= "<option value='" . esc_attr($key) . "'>" . esc_html($service) . "</option>";
             }
@@ -332,7 +361,8 @@
         }
 
-        function get_selected_services_details($settings, $services)
-        {
-            $services_arr = isset($settings['filter_by_service_value']) ? $settings['filter_by_service_value'] : [];
+        function get_selected_services_details($settings, $services, $type)
+        {
+            $filter_by_service = $type == 'Hide Methods By Origin' ? 'filter_by_service_value' : 'minimum_shipping_charge_services';
+            $services_arr = isset($settings[$filter_by_service]) ? $settings[$filter_by_service] : [];
             if (empty($services_arr) || !is_array($services_arr)) return [];
 
@@ -380,4 +410,173 @@
             return $response;
         }
+
+        function ups_small_get_service_rate($net_rate, $settings, $min_ship_charge)
+        {
+            $service_rate = $settings['service_rate'];
+            if ($min_ship_charge) {
+                $min_shipping_rate = isset($settings['minimum_shipping_charge']) ? $settings['minimum_shipping_charge'] : 0;
+
+                return $net_rate < $min_shipping_rate ? $min_shipping_rate : $net_rate;
+            }
+
+            if (strpos($service_rate, '%') === false) return $service_rate;
+
+            // Calculate the percentage of service rate based on net rate and add it to net rate
+            $service_rate = str_replace('%', '', $service_rate) / 100;
+            $service_rate = floatval($net_rate) * floatval($service_rate);
+            $net_rate = floatval($net_rate) + floatval($service_rate);
+
+            return $net_rate;
+        }
+
+        function apply_free_shipping_rule($ups_small_package)
+        {
+            if (empty($ups_small_package)) return [];
+
+            global $wpdb;
+            $rules = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"), ARRAY_A);
+            if (empty($rules)) return [];
+
+            $filtered_products_ids = [];
+
+            // check if free shipping rule exists
+            foreach ($rules as $rule) {
+                if (!$rule['is_active'] || $rule['type'] != 'Free Shipping') continue;
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Free Shipping Rule", $rule);
+
+                $products = [];
+                $product_tags = [];
+                foreach ($ups_small_package as $package) {
+                    if (!isset($package['items']) || empty($package['items'])) continue;
+
+                    $products = array_merge($products, $package['items']);
+                    $product_tags = isset($package['product_tags']) && !empty($package['product_tags']) ? array_merge($product_tags, $package['product_tags']) : $product_tags;
+                }
+
+                if (empty($products)) return [];
+
+                $settings = isset($rule['settings']) ? json_decode($rule['settings'], true) : [];
+                $filters_checks = ['filter_by_weight', 'filter_by_price', 'filter_by_quantity', 'filter_by_product_tag'];
+                $any_filter_checked = false;
+
+                foreach ($filters_checks as $check) {
+                    if (isset($settings[$check]) && filter_var($settings[$check], FILTER_VALIDATE_BOOLEAN)) {
+                        $any_filter_checked = true;
+                        break;
+                    }
+                }
+
+                if (!$any_filter_checked) {
+                    $rates = array(
+                        'id' => 'ups_small:' . 'free',
+                        'label' => 'Free Shipping',
+                        'cost' => 0,
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+
+                    return $rates;
+                }
+
+                $is_filter_applied = false;
+                $filters = ['weight', 'price', 'quantity', 'product_tag'];
+                $count = 0;
+
+                foreach ($products as $product) {
+                    $is_filter_applied = false;
+                    $qty = isset($product['productQty']) ? $product['productQty'] : 1;
+
+                    $product['quantity'] = $qty;
+                    $product['weight'] = isset($product['productWeight']) ? $product['productWeight'] * $qty : 1;
+                    $product['price'] = isset($product['productPrice']) ? $product['productPrice'] * $qty : 1;
+
+                    foreach ($filters as $filter) {
+                        if (isset($settings['filter_by_' . $filter]) && filter_var($settings['filter_by_' . $filter], FILTER_VALIDATE_BOOLEAN)) {
+                            if ($filter == 'product_tag') {
+                                $product_id = isset($product['variantId']) && $product['variantId'] > 0 ? $product['variantId'] : $product['productId'];
+                                $parent_id = wp_get_post_parent_id($product_id);
+                                $product_tags = get_the_terms($product_id, 'product_tag');
+                                $product_tags = empty($product_tags) ? get_the_terms($parent_id, 'product_tag') : $product_tags;
+                                $product_tag_ids = empty($product_tags) || !is_array($product_tags) ? [] : array_map(function($tag) { return $tag->term_id; }, $product_tags);
+
+                                if (isset($settings['filter_by_product_tag']) && filter_var($settings['filter_by_product_tag'], FILTER_VALIDATE_BOOLEAN)) {
+                                    $rule_tags = $settings['filter_by_product_tag_value'];
+                                    $tags_check = array_filter($rule_tags, function ($tag) use ($product_tag_ids) {
+                                        return in_array($tag, $product_tag_ids);
+                                    });
+                                    $is_filter_applied = count($tags_check) > 0;
+                                }
+                            } else {
+                                $is_filter_applied = $product[$filter] >= $settings['filter_by_' . $filter . '_from'];
+                                if ($is_filter_applied && !empty($settings['filter_by_' . $filter . '_to'])) {
+                                    $is_filter_applied = $product[$filter] < $settings['filter_by_' . $filter . '_to'];
+                                }
+                            }
+                        }
+
+                        if ($is_filter_applied) break;
+                    }
+
+                    if ($is_filter_applied) {
+                        $count++;
+                        $filtered_products_ids[] = $product['productId'];
+                    }
+                }
+
+                // If all products match the filter, return free shipping
+                if ($is_filter_applied && $count == count($products)) {
+                    $rates = array(
+                        'id' => 'ups_small:' . 'free',
+                        'label' => 'Free Shipping',
+                        'cost' => 0,
+                        'plugin_name' => 'upsSmall',
+                        'plugin_type' => 'small',
+                        'owned_by' => 'eniture'
+                    );
+
+                    return [
+                        'rates' => $rates,
+                        'package' => $ups_small_package
+                    ];
+                }
+            }
+
+            if (!empty($filtered_products_ids)) {
+                foreach ($ups_small_package as $key => $package) {
+                    foreach ($package['items'] as $ik => $item) {
+                        if (in_array($item['productId'], $filtered_products_ids)) {
+                            unset($ups_small_package[$key]['items'][$ik]);
+                        }
+                    }
+                }
+            }
+
+            return [
+                'rates' => [],
+                'package' => $ups_small_package 
+            ];
+        }
+
+        function sanitize_request_data($data)
+        {
+            if (empty($data)) return $data;
+
+            if (is_array($data)) {
+                foreach ($data as $key => $value) {
+                    if (is_array($value)) {
+                        $data[$key] = $this->sanitize_request_data($value);
+                    } else {
+                        $data[$key] =  isset($value) ? esc_attr(sanitize_text_field( wp_unslash($value) )) : '';
+                    }
+                }
+            } else {
+                $data = isset($data) ? esc_attr(sanitize_text_field( wp_unslash($data) )) : '';
+            }
+
+            return $data;
+        }
     }
 }
Index: /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-template.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-template.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/shipping-rules/shipping-rules-template.php	(revision 3237693)
@@ -16,4 +16,7 @@
           "SELECT * FROM " . $wpdb->prefix . "eniture_ups_small_shipping_rules"
       );
+
+      // Eniture debug mode
+      do_action("eniture_debug_mood", "UPS Small Shipping Rules", $shipping_rules_list);
 
       ?>
@@ -30,7 +33,4 @@
                       </th>
                       <th class="en_wd_warehouse_list_heading">
-                          Filters
-                      </th>
-                      <th class="en_wd_warehouse_list_heading">
                           Available
                       </th>
@@ -48,11 +48,11 @@
                   foreach ($shipping_rules_list as $rule) {
                     $rule->settings = !empty($rule->settings) ? json_decode($rule->settings) : [];
-                    $filter_name = in_array($rule->type, ['Hide Methods', 'Override Rates']) && isset($rule->settings->filter_name) ? $rule->settings->filter_name : '';
+                    $rule_type = isset($rule->type) ? $rule->type : '';
+                    $rule_type = $rule_type == 'Hide Methods By Origin' ? 'Hide Methods By Origin Location' : $rule_type;
 
                     ?>
                       <tr id="sr_row_<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>" class="en_ups_sr_row">
                         <td class="en_wd_warehouse_list_data"><?php echo esc_attr($rule->name); ?></td>
-                        <td class="en_wd_warehouse_list_data"><?php echo esc_attr($rule->type); ?></td>
-                        <td class="en_wd_warehouse_list_data"><?php echo esc_attr($filter_name); ?></td>
+                        <td class="en_wd_warehouse_list_data"><?php echo esc_attr($rule_type); ?></td>
                         <td class="en_wd_warehouse_list_data">
                           <a href="#" class="en_ups_sr_status_link" data-id="<?php echo (isset($rule->id)) ? esc_attr($rule->id) : ''; ?>" data-status="<?php echo esc_attr($rule->is_active); ?>"><?php echo esc_attr($rule->is_active) ? 'Yes' : 'No'; ?></a>
@@ -106,5 +106,5 @@
 
 <!-- Shipping rules html markup -->
-<div class="en_shipping_rules_setting_section">
+<div class="en_shipping_rules_setting_section ups_small_wrapper">
     <br />
     <!-- Add rule button -->
@@ -128,5 +128,5 @@
 
     <!-- Add popup for new rule -->
-    <div id="en_wd_add_warehouse_btn" class="en_wd_warehouse_overlay">
+    <div id="en_wd_add_warehouse_btn" class="en_wd_warehouse_overlay en_ups_small_sr_popup">
         <div class="en_wd_add_warehouse_popup">
             <h2 class="warehouse_heading">Add Rule</h2>
@@ -141,5 +141,5 @@
 
                 <!-- Add shipping rule form -->
-                <form id="add_shipping_rule" role="form">
+                <form id="add_shipping_rule" class="en_ups_small_sr_form" role="form">
                     <input type="hidden" name="edit_sr_form_id" value="" id="edit_sr_form_id">
                     <!-- Rule name -->
@@ -154,7 +154,9 @@
                         <label for="en_ups_small_rule_type">Type</label>
                         <select name="en_ups_small_rule_type" id="en_ups_small_rule_type" title="Type">
+                          <option value="Free Shipping">Free Shipping</option>
                           <option value="Hide Methods">Hide Methods</option>
                           <option value="Hide Methods By Origin">Hide Methods By Origin Location</option>
                           <option value="Large Cart Settings">Large Cart Settings</option>
+                          <option value="Minimum Shipping Charge">Minimum Shipping Charge</option>
                           <option value="Override Rates">Override Rates</option>
                           <option value="Restrict To State">Restrict To State</option>
@@ -174,7 +176,119 @@
                           <input type="radio" name="apply_to" value="shipment" title="Shipment"> <span>Shipment</span>
                         </div>
-                        <span class="en_sr_err"></span>
-                    </div>
-                    
+                        <div id="en_sr_apply_to_product">
+                          <div><p></p></div>
+                          <input type="radio" name="apply_to" value="product" title="Product"> <span>Product</span>
+                        </div>
+                        <span class="en_sr_err"></span>
+                    </div>
+
+                    <!-- Hide methods by origin location section -->
+                    <div class="en_sr_hide_methods_by_origin_location">
+                      <!-- Filter by Origins -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_origin" id="en_ups_small_filter_by_origin_label">
+                            Origins
+                        </label>
+                      </div>
+
+                      <!-- Origins list -->
+                      <div class="en_sr_form_control en_ups_small_sr_locations_list">
+                        <select name="en_sr_locations_list" id="en_sr_locations_list" multiple="multiple" data-attribute="en_location_list_value" data-optional="1" class="chosen_select en_location_list_value" style="width: 100% !important;" title="Origins">
+                          <?php 
+                            global $wpdb;
+                            $warehouse_table = $wpdb->prefix . "warehouse";
+                            $locations = $wpdb->get_results("SELECT * FROM $warehouse_table", ARRAY_A);
+
+                            if (isset($locations) && !empty($locations)) {
+                              foreach ($locations as $key => $value) {
+                                  $location = $value['city'] . ' ' . $value['state'] . ' ' . $value['zip'] . ', ' . $value['country'];
+                                  echo "<option value='" . esc_attr($value['zip']) . "'>" . esc_html($location) . "</option>";
+                              }
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                        <span class="descrption">
+                          Shipping methods for the services listed below will be hidden for customers from these origins.
+                        </span>
+                      </div>
+
+                      <!-- Filter by Services -->
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_filter_by_sevices" id="en_ups_small_filter_by_sevices_label">
+                            Services
+                        </label>
+                      </div>
+
+                      <!-- Services list -->
+                      <div class="en_sr_form_control en_ups_small_sr_services_list">
+                        <select name="en_sr_services_list" id="en_sr_services_list" multiple="multiple" data-attribute="en_service_list_value" data-optional="1" class="chosen_select en_service_list_value" style="width: 100% !important;" title="Services">
+                          <?php
+                            $services = eniture_shipping_rules_get_services_list();
+                            foreach ($services as $key => $value) {
+                              echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                      </div>
+                    </div>
+
+                    <!-- Large cart settings section -->
+                    <div class="en_ups_small_sr_large_cart_settings">
+                      <div class="en_sr_form_control">
+                        <p>
+                          The packaging algorithm identifies the ideal packaging solution via an iterative process. If the Cart contains a large number of items, the time the packaging algorithm requires to identify the ideal packaging solution can exceed the window of time WordPress allows for shipping quotes to be returned. In these cases, the packaging algorithm needs to be bypassed. Use the settings below to specify your preferences for when the packaging algorithm is to be bypassed. Test the results to make sure results (shipping quotes) are returned when a large number of items is in the Cart. The number of boxes you define and the diversity of the items in your product catalog will influence the time the packaging algorithm requires. Therefore, your settings will differ from those of other merchants.
+                        </p>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_sr_max_items">Max items <span style="color: red;">*</span></label>
+                        <input type="text" title="Max items" name="en_sr_max_items" id="en_sr_max_items" data-optional="1" maxlength="10">
+                        <span class="en_sr_err"></span>
+                        <p class="description">When the Cart contains more than this number of items, the packaging algorithm will be bypassed and rates will be calculated exclusively on the basis of weight.</p>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_sr_max_weight_per_package">Max weight per package <span style="color: red;">*</span></label>
+                        <input type="text" title="Max weight per package" name="en_sr_max_weight_per_package" id="en_sr_max_weight_per_package" data-optional="1" maxlength="10">
+                        <span class="en_sr_err"></span>
+                        <p class="description">Specify the maximum weight allowed per package when the packaging algorithm is bypassed. The maximum permitted value is 150 LB.</p>
+                      </div>
+                    </div>
+
+                    <!-- Minimum shipping charge section -->
+                     <div class="en_sr_min_shipping_charge">
+                      <!-- Minimum shipping charge -->
+                      <div class="en_sr_form_control">
+                          <label for="en_sr_minimum_shipping_charge">Minimum Shipping Rate</label>
+                          <input type="text" title="Minimum shipping charge" name="en_sr_minimum_shipping_charge" id="en_sr_minimum_shipping_charge" data-optional="1" maxlength="7">
+
+                          <span class="en_sr_err"></span>
+                          <span class="descrption">
+                            Enter the min. shipping rate to show on checkout.
+                        </span>
+                      </div>
+
+                      <div class="en_sr_form_control">
+                        <label for="en_ups_small_msc_filter_by_sevices" id="en_ups_small_msc_filter_by_sevices_label">
+                            Services
+                        </label>
+                      </div>
+
+                      <!-- Services list -->
+                      <div class="en_sr_form_control en_ups_small_msc_sr_services_list">
+                        <select name="en_msc_sr_services_list" id="en_msc_sr_services_list" multiple="multiple" data-attribute="en_service_list_value" data-optional="1" class="chosen_select en_service_list_value" style="width: 100% !important;" title="Services">
+                          <?php
+                            $services = eniture_shipping_rules_get_services_list();
+                            foreach ($services as $key => $value) {
+                              echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
+                            }
+                          ?>
+                        </select>
+                        <span class="en_sr_err"></span>
+                      </div>
+                     </div>
+
                     <!-- Override rates section -->
                     <div class="en_sr_override_rates">
@@ -197,6 +311,6 @@
                       <!-- Service rate -->
                       <div class="en_sr_form_control">
-                          <label for="en_sr_service_rate">Service rate (e.g. 5.25)</label>
-                          <input type="text" title="Service rate" name="en_sr_service_rate" id="en_sr_service_rate" data-optional="1" maxlength="10" data-optional="1">
+                          <label for="en_ups_small_sr_service_rate">Service rate</label>
+                          <input type="text" title="Service rate" name="en_ups_small_sr_service_rate" id="en_ups_small_sr_service_rate" data-optional="1" maxlength="10" data-optional="1" placeholder="Enter amount or percentage (e.g. 10, -5, 20%)">
                           <span class="en_sr_err"></span>
                       </div>
@@ -265,88 +379,6 @@
                     </div>
 
-                    <!-- Large cart settings section -->
-                    <div class="en_ups_small_sr_large_cart_settings">
-                      <div class="en_sr_form_control">
-                        <p>
-                          The packaging algorithm identifies the ideal packaging solution via an iterative process. If the Cart contains a large number of items, the time the packaging algorithm requires to identify the ideal packaging solution can exceed the window of time WordPress allows for shipping quotes to be returned. In these cases, the packaging algorithm needs to be bypassed. Use the settings below to specify your preferences for when the packaging algorithm is to be bypassed. Test the results to make sure results (shipping quotes) are returned when a large number of items is in the Cart. The number of boxes you define and the diversity of the items in your product catalog will influence the time the packaging algorithm requires. Therefore, your settings will differ from those of other merchants.
-                        </p>
-                      </div>
-
-                      <div class="en_sr_form_control">
-                        <label for="en_sr_max_items">Max items <span style="color: red;">*</span></label>
-                        <input type="text" title="Max items" name="en_sr_max_items" id="en_sr_max_items" data-optional="1" maxlength="10">
-                        <span class="en_sr_err"></span>
-                        <p class="description">When the Cart contains more than this number of items, the packaging algorithm will be bypassed and rates will be calculated exclusively on the basis of weight.</p>
-                      </div>
-
-                      <div class="en_sr_form_control">
-                        <label for="en_sr_max_weight_per_package">Max weight per package <span style="color: red;">*</span></label>
-                        <input type="text" title="Max weight per package" name="en_sr_max_weight_per_package" id="en_sr_max_weight_per_package" data-optional="1" maxlength="10">
-                        <span class="en_sr_err"></span>
-                        <p class="description">Specify the maximum weight allowed per package when the packaging algorithm is bypassed. The maximum permitted value is 150 LB.</p>
-                      </div>
-                    </div>
-
-                    <!-- Hide methods by origin location section -->
-                     <div class="en_sr_hide_methods_by_origin_location">
-                      <!-- Filter by Origins -->
-                      <div class="en_sr_form_control">
-                        <label for="en_ups_small_filter_by_origin" id="en_ups_small_filter_by_origin_label">
-                           Origins
-                        </label>
-                      </div>
-
-                      <!-- Origins list -->
-                      <div class="en_sr_form_control en_ups_small_sr_locations_list">
-                        <select name="en_sr_locations_list" id="en_sr_locations_list" multiple="multiple" data-attribute="en_location_list_value" data-optional="1" class="chosen_select en_location_list_value" style="width: 100% !important;" title="Origins">
-                          <?php 
-                            global $wpdb;
-                            $warehouse_table = $wpdb->prefix . "warehouse";
-                            $locations = $wpdb->get_results("SELECT * FROM $warehouse_table", ARRAY_A);
-
-                            if (isset($locations) && !empty($locations)) {
-                              foreach ($locations as $key => $value) {
-                                  $location = $value['city'] . ' ' . $value['state'] . ' ' . $value['zip'] . ', ' . $value['country'];
-                                  echo "<option value='" . esc_attr($value['zip']) . "'>" . esc_html($location) . "</option>";
-                              }
-                            }
-                          ?>
-                        </select>
-                        <span class="en_sr_err"></span>
-                        <span class="descrption">
-                          Shipping methods for the services listed below will be hidden for customers from these origins.
-                        </span>
-                      </div>
-
-                      <!-- Filter by Services -->
-                      <div class="en_sr_form_control">
-                        <label for="en_ups_small_filter_by_sevices" id="en_ups_small_filter_by_sevices_label">
-                           Services
-                        </label>
-                      </div>
-
-                      <!-- Services list -->
-                      <div class="en_sr_form_control en_ups_small_sr_services_list">
-                        <select name="en_sr_services_list" id="en_sr_services_list" multiple="multiple" data-attribute="en_service_list_value" data-optional="1" class="chosen_select en_service_list_value" style="width: 100% !important;" title="Services">
-                          <?php
-                            $services = eniture_shipping_rules_get_services_list();
-                            foreach ($services as $key => $value) {
-                              echo "<option value='" . esc_attr($key) . "'>" . esc_html('UPS ' . $value) . "</option>";
-                            }
-                          ?>
-                        </select>
-                        <span class="en_sr_err"></span>
-                      </div>
-                     </div>
-
                     <!-- Filters section -->
                     <div class="en_ups_small_sr_filters_section">
-                      <!-- Filter name -->
-                      <div class="en_sr_form_control">
-                          <label for="en_sr_filter_name">Filter Name</label>
-                          <input type="text" title="Filter Name" name="en_sr_filter_name" id="en_sr_filter_name" data-optional="1" maxlength="50">
-                          <span class="en_sr_err"></span>
-                      </div>
-
                       <!-- Filter by Weight -->
                       <div class="en_sr_form_control">
@@ -446,4 +478,92 @@
                     </div>
 
+                    <!-- Override Rates Filters -->
+                    <div class="en_or_sr_filters">
+                        <!-- Filter by Country -->
+                        <section>
+                          <div class="en_sr_form_control">
+                            <div>
+                              <label for="filter_by_country_or">
+                                <input type="checkbox" title="Filter by country" name="filter_by_country_or" id="filter_by_country_or"> Filter by country
+                              </label>
+                            </div>
+                          </div>
+                          <!-- Country list -->
+                          <div class="en_sr_form_control">
+                            <select name="en_ups_small_or_sr_country" id="en_ups_small_or_sr_country" title="Countries">
+                              <option value="">Select One</option>
+                              <option value="US">US</option>
+                              <option value="CA">CA</option>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                          </div>
+                        </section>
+
+                        <!-- Filter by State -->
+                        <section>
+                          <div class="en_sr_form_control">
+                            <div>
+                              <label for="filter_by_state_or">
+                                <input type="checkbox" title="Filter by state" name="filter_by_state_or" id="filter_by_state_or"> Filter by state
+                              </label>
+                            </div>
+                            <span class="en_sr_err"></span>
+                          </div>
+
+                          <!-- US States list -->
+                          <div class="en_sr_form_control en_ups_small_or_sr_us_states_list">
+                            <select name="en_or_sr_states_list" id="en_or_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                              <?php 
+                                global $woocommerce;
+                                $countries_obj = new WC_Countries();
+                                $us_states = $countries_obj->get_states('US');
+
+                                if (isset($us_states) && !empty($us_states)) {
+                                  foreach ($us_states as $key => $value) {
+                                      echo "<option class='or_us_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                                  }
+                              }
+                            ?>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                            <span class="descrption">
+                              Only customers from these states/provinces will be presented with shipping rates for this provider.
+                            </span>
+                          </div>
+
+                          <!-- CA States list -->
+                          <div class="en_sr_form_control en_ups_small_or_sr_ca_states_list">
+                            <select name="en_or_sr_states_list" id="en_or_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                              <?php 
+                                global $woocommerce;
+                                $countries_obj = new WC_Countries();
+                                $ca_states = $countries_obj->get_states('CA');
+
+                                if (isset($ca_states) && !empty($ca_states)) {
+                                    foreach ($ca_states as $key => $value) {
+                                        echo "<option class='or_ca_state' value='" . esc_attr($key) . "'>" . esc_html($value) . "</option>";
+                                    }
+                                }
+                            ?>
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                            <span class="descrption">
+                              Only customers from these states/provinces will be presented with shipping rates for this provider.
+                            </span>
+                          </div>
+
+                          <!-- Empty states list -->
+                          <div class="en_sr_form_control en_ups_small_or_empty_sr_states_list">
+                            <select name="en_or_empty_sr_states_list" id="en_or_empty_sr_states_list" multiple="multiple" data-attribute="en_state_list_value" data-optional="1" class="chosen_select en_state_list_value" style="width: 100% !important;" title="States/Provinces">
+                            </select>
+
+                            <span class="en_sr_err"></span>
+                          </div>
+                        </section>
+                    </div>
+
                     <!-- Available checkbox -->
                     <div class="en_sr_form_control">
Index: /small-package-quotes-ups-edition/trunk/small-package-quotes-ups-edition.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/small-package-quotes-ups-edition.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/small-package-quotes-ups-edition.php	(revision 3237693)
@@ -4,5 +4,5 @@
  * Plugin URI:     https://eniture.com/products/
  * Description:    Dynamically retrieves your negotiated shipping rates from UPS and displays the results in the WooCommerce shopping cart.
- * Version:        4.5.16
+ * Version:        4.5.17
  * Author:         Eniture Technology
  * Author URI:     http://eniture.com/
@@ -102,9 +102,10 @@
 
         // Shipping rules script and styles
-        wp_enqueue_script('en_woo_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0.5');
-        wp_localize_script('en_woo_sr_script', 'script', array(
+        wp_enqueue_script('en_woo_sr_script', plugin_dir_url(__FILE__) . '/shipping-rules/assets/js/shipping_rules.js', array(), '1.0.6');
+        wp_localize_script('en_woo_sr_script', 'sr_script', array(
             'pluginsUrl' => plugins_url(),
+            'nonce' => wp_create_nonce('en_woo_sr_nonce')
         ));
-        wp_register_style('shipping_rules_section', plugin_dir_url(__FILE__) . '/shipping-rules/assets/css/shipping_rules.css', false, '1.0.2');
+        wp_register_style('shipping_rules_section', plugin_dir_url(__FILE__) . '/shipping-rules/assets/css/shipping_rules.css', false, '1.0.3');
         wp_enqueue_style('shipping_rules_section');
     }
@@ -186,5 +187,5 @@
     {
 
-        wp_register_style('eniture_ups_small_style', plugin_dir_url(__FILE__) . '/css/ups-small-style.css', false, '1.1.7');
+        wp_register_style('eniture_ups_small_style', plugin_dir_url(__FILE__) . '/css/ups-small-style.css', false, '1.1.8');
         wp_enqueue_style('eniture_ups_small_style');
     }
@@ -223,5 +224,5 @@
     {
         wp_enqueue_script('jquery');
-        wp_enqueue_script('eniture_ups_small_script', plugin_dir_url(__FILE__) . 'js/en-ups-small.js', array(), '1.0.8');
+        wp_enqueue_script('eniture_ups_small_script', plugin_dir_url(__FILE__) . 'js/en-ups-small.js', array(), '1.0.9');
         wp_localize_script('eniture_ups_small_script', 'eniture_ups_small_admin_script', array(
             'plugins_url' => plugins_url(),
@@ -229,5 +230,6 @@
             'prevent_proceed_checkout_eniture' => trim(get_option("prevent_proceed_checkout_eniture")),
             'ups_small_order_cutoff_time' => get_option("ups_small_orderCutoffTime"),
-            'ups_small_packaging_type' => get_option("ups_small_packaging_type")
+            'ups_small_packaging_type' => get_option("ups_small_packaging_type"),
+            'nonce' => wp_create_nonce('eniture_ups_small_nonce')
         ));
     }
@@ -490,4 +492,9 @@
 function eniture_ups_s_fd_api()
 {
+    if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'eniture_ups_small_nonce')) {
+        echo wp_json_encode([]);
+        return;
+    }
+
     $store_name = eniture_ups_small_get_domain();
     $company_id = isset($_POST['company_id']) ? sanitize_text_field(wp_unslash($_POST['company_id'])) : '';
@@ -499,5 +506,5 @@
     ];
     if (is_array($data) && count($data) > 0) {
-        if(isset($_POST['disconnect']) && sanitize_text_field(wp_unslash($_POST['disconnect'])) != 'disconnect') {
+        if($_POST['disconnect'] != 'disconnect') {
             $url =  'https://freightdesk.online/validate-company';
         }else {
@@ -535,9 +542,14 @@
 /**
  * Update FDO coupon data
- * @param array $request
+ * @param array|WP_REST_Request $request
  * @return array|void
  */
 function eniture_ups_s_fdo_data_status(WP_REST_Request $request)
 {
+    $authenticated_user = fdo_update_status_authenticate($request);
+    if (is_wp_error($authenticated_user)) {
+        return $authenticated_user;
+    }
+
     $status_data = $request->get_body();
     $status_data_decoded = json_decode($status_data);
@@ -549,4 +561,39 @@
 }
 
+// fdo / va api calls authentication
+if (!function_exists('fdo_update_status_authenticate')) {
+    function fdo_update_status_authenticate($request) {
+        if ( !empty( $_SERVER['HTTP_CONSUMER_KEY'] ) && !empty( $_SERVER['HTTP_CONSUMER_SECRET'] ) ) {
+            $consumer_key    = $_SERVER['HTTP_CONSUMER_KEY'];
+            $consumer_secret = $_SERVER['HTTP_CONSUMER_SECRET'];
+        }else{
+            return new WP_Error('rest_authentication_error', __('Invalid Authorization header format.'), array('status' => 401));
+        }
+    
+        global $wpdb;
+        $consumer_key = wc_api_hash( sanitize_text_field( $consumer_key ) );
+        $user         = $wpdb->get_row(
+            $wpdb->prepare(
+                "
+            SELECT user_id, permissions
+            FROM {$wpdb->prefix}woocommerce_api_keys
+            WHERE consumer_key = %s
+        ",
+                $consumer_key
+            )
+        );
+    
+        if (!$user) {
+            return new WP_Error('invalid_keys', __('Invalid consumer key or secret.'), array('status' => 401));
+        }
+    
+        if (empty($user->permissions) || $user->permissions != 'read_write') {
+            return new WP_Error('rest_forbidden', __('User does not have write permissions.'), array('status' => 403));
+        }
+    
+        return $user;
+    }
+}
+
 /**
  * Filter to check ground transit status
Index: /small-package-quotes-ups-edition/trunk/template/connection-settings.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/template/connection-settings.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/template/connection-settings.php	(revision 3237693)
@@ -23,5 +23,5 @@
         $default_api = empty(get_option('ups_small_username')) ? 'ups_new_api' : 'ups_old_api';
         
-        echo '<div class="ups_small_connection_section">';
+        echo '<div class="ups_small_connection_section ups_small_wrapper">';
         $settings = array(
             'section_title_ups_small' => array(
Index: /small-package-quotes-ups-edition/trunk/template/csv-export.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/template/csv-export.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/template/csv-export.php	(revision 3237693)
@@ -5,7 +5,7 @@
 }
 
-if (!class_exists('Eniture_CsvExport')) {
-
-    class Eniture_CsvExport
+if (!class_exists('EnCsvExport')) {
+
+    class EnCsvExport
     {
         public function __construct()
@@ -50,4 +50,15 @@
             if (isset($columns['meta:_ltl_freight_variation'])) {
                 unset($columns['meta:_ltl_freight_variation']);
+            }
+
+            $nested_mat_cols = ['_nestedmaterials', '_nestedpercentage', '_nesteddimension', '_maxnesteditems', '_nestedstakingproperty'];
+            foreach ($nested_mat_cols as $nested_mat_col) {
+                if (isset($columns['meta:' . $nested_mat_col])) {
+                    unset($columns['meta:' . $nested_mat_col]);
+                }
+
+                if (isset($columns['Meta:' . $nested_mat_col])) {
+                    unset($columns['Meta:' . $nested_mat_col]);
+                }
             }
 
@@ -261,4 +272,4 @@
     }
 
-    new Eniture_CsvExport();
+    new EnCsvExport();
 }
Index: /small-package-quotes-ups-edition/trunk/template/guide.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/template/guide.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/template/guide.php	(revision 3237693)
@@ -14,5 +14,5 @@
  */
 ?>
-<div class="user_guide">
+<div class="user_guide ups_small_wrapper">
     <p>
         The User Guide for this application is maintained on the publisher's website. To view it click 
Index: /small-package-quotes-ups-edition/trunk/template/products-nested-options.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/template/products-nested-options.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/template/products-nested-options.php	(revision 3237693)
@@ -7,7 +7,7 @@
     exit;
 }
-if (!class_exists("Eniture_UpdateProductNestedOptions")) {
-
-    class Eniture_UpdateProductNestedOptions
+if (!class_exists("EnUpdateProductNestedOptions")) {
+
+    class EnUpdateProductNestedOptions
     {
 
@@ -221,4 +221,4 @@
 
     /* Initialize object */
-    new Eniture_UpdateProductNestedOptions('hooks');
+    new EnUpdateProductNestedOptions('hooks');
 }
Index: /small-package-quotes-ups-edition/trunk/template/quote-settings.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/template/quote-settings.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/template/quote-settings.php	(revision 3237693)
@@ -85,5 +85,5 @@
         //**End: Cut Off Time & Ship Date Offset
 
-        echo '<div class="ups_small_quote_section">';
+        echo '<div class="ups_small_quote_section ups_small_wrapper">';
 
         $settings = array(
Index: /small-package-quotes-ups-edition/trunk/update-plan.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/update-plan.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/update-plan.php	(revision 3237693)
@@ -16,4 +16,9 @@
 function eniture_ups_small_activate_hit_to_update_plan($network_wide = null)
 {
+    if (!current_user_can('manage_options')) {
+        echo json_encode([]);
+        return;
+    }
+
     if ( is_multisite() && $network_wide ) {
 
@@ -244,14 +249,14 @@
 
                 if (isset($plan_package['plan_number']) && $plan_package['plan_number'] == '0') {
-                    echo '<div class="notice notice-success is-dismissible">
+                    echo '<div class="notice notice-success is-dismissible ups_small_plan_notice">
                     <p> You are currently on the ' . esc_attr( $plan_package['plan_name'] ) . '. Your plan will be expire on ' .  esc_attr( $plan_package['expiry_date'] ) . ' <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan.</p>
                     </div>';
                 } else if (isset($plan_package['plan_number']) && ($plan_package['plan_number'] == '1' || $plan_package['plan_number'] == '2' || $plan_package['plan_number'] == '3')) {
 
-                    echo '<div class="notice notice-success is-dismissible">
+                    echo '<div class="notice notice-success is-dismissible ups_small_plan_notice">
                     <p> You are currently on the ' . esc_attr( $plan_package['plan_name'] ) . '. The plan renews on ' . esc_attr( $plan_package['expiry_date'] ) . ' <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan.</p>
                     </div>';
                 } else {
-                    echo '<div class="notice notice-warning is-dismissible">
+                    echo '<div class="notice notice-warning is-dismissible ups_small_plan_notice">
                     <p>Your currently plan subscription is inactive. <a href="javascript:void(0)" data-action="eniture_ups_small_activate_hit_to_update_plan" onclick="en_update_plan(this);">Click here</a> to refresh the plan to check the subscription status. If the subscription status remains inactive, log into eniture.com and update your license.</p>
                     </div>';
Index: /small-package-quotes-ups-edition/trunk/ups-small-admin-filter.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/ups-small-admin-filter.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/ups-small-admin-filter.php	(revision 3237693)
@@ -173,9 +173,9 @@
                         $metaValue[3] = $locations[3][$key];
                         $metaValue[4] = $locations[4][$key];
-                        $dsId[] = eniture_serialize_dropship($metaValue);
+                        $dsId[] = en_serialize_dropship($metaValue);
                     }
                 }
             } else {
-                $dsId[] = eniture_serialize_dropship($_dropship_location);
+                $dsId[] = en_serialize_dropship($_dropship_location);
             }
 
@@ -199,6 +199,6 @@
  */
 
-if (!function_exists('eniture_serialize_dropship')) {
-    function eniture_serialize_dropship($metaValue)
+if (!function_exists('en_serialize_dropship')) {
+    function en_serialize_dropship($metaValue)
     {
         global $wpdb;
@@ -215,5 +215,5 @@
 
         if (empty($dropship['id'])) {
-            $data = eniture_csv_import_dropship_data($metaValue);
+            $data = en_csv_import_dropship_data($metaValue);
             $wpdb->insert(
                 $wpdb->prefix . 'warehouse', $data
@@ -234,6 +234,6 @@
  * @return array
  */
-if (!function_exists('eniture_csv_import_dropship_data')) {
-    function eniture_csv_import_dropship_data($metaValue)
+if (!function_exists('en_csv_import_dropship_data')) {
+    function en_csv_import_dropship_data($metaValue)
     {
         return array(
Index: /small-package-quotes-ups-edition/trunk/ups-small-carrier-service.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/ups-small-carrier-service.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/ups-small-carrier-service.php	(revision 3237693)
@@ -479,4 +479,8 @@
         $response_json = $ups_Small_distance_request->ups_small_address($warehous_list, $accessLevel, $this->destinationAddressUpsSmall());
         $response_json = json_decode($response_json, TRUE);
+
+        // Eniture debug mood
+        do_action("eniture_debug_mood", "Multi Warehouse Distance Response (UPS Small)", $response_json);
+
         return $response_json['origin_with_min_dist'];
     }
Index: /small-package-quotes-ups-edition/trunk/ups-small-group-package.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/ups-small-group-package.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/ups-small-group-package.php	(revision 3237693)
@@ -27,4 +27,5 @@
     public $destination_Address_ups_small;
     public $origin = [];
+    public $shipping_rule_object;
     // Images for FDO
     public $en_fdo_image_urls = [];
@@ -156,5 +157,5 @@
                 $width = (strlen($width) > 0) ? $width : "0";
                 $length = (strlen($length) > 0) ? $length : "0";
-                
+
                 $product_weight = apply_filters('en_filter_product_weight', wc_get_weight($_product->get_weight(), 'lbs'), $item_id);
 
@@ -174,5 +175,5 @@
                     }
                 }
-                
+
                 $product_level_markup = $this->ups_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity']);
 
@@ -468,5 +469,5 @@
         if ($freight_enable_class == 'ltl_freight' || $freight_enable_class == 'ltl-freight') {
             $ptype = 'ltl';
-        } else if ($exceedWeight == 'yes' 
+        } else if ($exceedWeight == 'yes'
         && ( ($weight > $weight_threshold && $en_multiple_package != 'yes') || (!empty($only_show_ltl_rates) && $only_show_ltl_rates == 'yes' && $shipment_weight_sum > $weight_threshold) )) {
             $ptype = 'ltl';
@@ -475,4 +476,7 @@
         }
 
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "Quotes Product Type (UPS Small)", $ptype);
+
         return $ptype;
     }
@@ -481,5 +485,5 @@
      * Hazardous Material in Product Detail page
      * @param array $values
-     * @param array $_product
+     * @param array|object $_product
      * @return string
      */
@@ -493,5 +497,5 @@
      *
      * @param array $values
-     * @param array $_product
+     * @param array|object $_product
      * @return string
      */
@@ -520,5 +524,9 @@
                 // Micro Warehouse
                 $this->warehouse_products[] = $post_id;
-                return array('error' => 'wwe small dp location not found!');
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Quotes Dropship Location (UPS Small)", array('error' => 'UPS Small dropship location not found!'));
+
+                return array('error' => 'UPS Small dropship location not found!');
             }
 
@@ -536,4 +544,9 @@
                     "SELECT * FROM " . $wpdb->prefix . "warehouse WHERE id IN ('" . $get_loc . "')"
                 );
+            }
+
+            if (empty($locations_list)) {
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Quotes Dropship Location (UPS Small)", array('error' => 'UPS Small dropship location not found!'));
             }
 
@@ -658,5 +671,5 @@
     {
         $product_level_markup = 0;
-            
+
             if ($_product->get_type() == 'variation') {
                 $product_level_markup = get_post_meta($variation_id, '_en_product_markup_variation', true);
@@ -667,10 +680,10 @@
                 $product_level_markup = get_post_meta($_product->get_id(), '_en_product_markup', true);
             }
-            
+
             if (empty($product_level_markup)) {
                 $product_level_markup = get_post_meta($product_id, '_en_product_markup', true);
             }
 
-            if (!empty($product_level_markup) && strpos($product_level_markup, '%') === false 
+            if (!empty($product_level_markup) && strpos($product_level_markup, '%') === false
             && is_numeric($product_level_markup) && is_numeric($quantity))
             {
@@ -682,5 +695,5 @@
                 $percentage_value = $arr[0];
                 $product_price = $_product->get_price();
-    
+
                 if (!empty($product_price)) {
                     $product_level_markup = $percentage_value / 100 * ($product_price * $quantity);
@@ -689,5 +702,5 @@
                 }
             }
-    
+
             return $product_level_markup;
     }
@@ -696,5 +709,5 @@
      * Check except transit time restriction
      * @param array $values
-     * @param array $_product
+     * @param array|object $_product
      * @return string
      */
@@ -730,7 +743,7 @@
 
         if (empty($rules)) return $apply_on_rates ? $rates : false;
-       
+
         $is_rule_applied = false;
-        $rule_types = ['override_rates' => 'Override Rates', 'hide_methods' => 'Hide Methods', 'restrict_to_state' => 'Restrict To State', 'hide_methods_by_origin' => 'Hide Methods By Origin'];
+        $rule_types = ['override_rates' => 'Override Rates', 'hide_methods' => 'Hide Methods', 'restrict_to_state' => 'Restrict To State', 'hide_methods_by_origin' => 'Hide Methods By Origin', 'minimum_shipping_charge' => 'Minimum Shipping Charge'];
 
         foreach ($rules as $rule) {
@@ -741,7 +754,8 @@
 
             $rule_type = isset($rule['type']) ? $rule['type'] : '';
+            $rule_name = isset($rule['name']) ? $rule['name'] : '';
 
             if ($rule_type == $rule_types['override_rates'] && $apply_on_rates) {
-                $rates = $this->apply_override_rates_rule($ups_small_package, $settings, $rates);
+                $rates = $this->apply_override_rates_rule($ups_small_package, $settings, $rates, $rule_name);
             } else if ($rule_type == $rule_types['hide_methods']) {
                 $is_rule_applied = $this->apply_rule($settings, $ups_small_package);
@@ -749,6 +763,11 @@
             } else if ($rule_type == $rule_types['restrict_to_state'] && $apply_on_rates) {
                 $rates = $this->apply_restrict_to_state_rule($ups_small_package, $settings, $rates);
+
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Restrict To State Rule Updated Rates: {$rule_name}", wp_json_encode($rates));
             } else if ($rule_type == $rule_types['hide_methods_by_origin'] && $apply_on_rates) {
                 $rates = $this->apply_hide_methods_by_origin_rule($settings, $rates);
+            } else if ($rule_type == $rule_types['minimum_shipping_charge'] && $apply_on_rates) {
+                $rates = $this->apply_minimum_shipping_charge_rule($ups_small_package, $settings, $rates, $rule_name);
             }
         }
@@ -777,4 +796,7 @@
         }
 
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "UPS Small Hide Methods Rule Applied", $is_rule_applied ? 'Yes' : 'No');
+
         return $is_rule_applied;
     }
@@ -794,13 +816,13 @@
     }
 
-    function apply_rule_filters($settings, $formatted_values, $restict_service = false)
+    function apply_rule_filters($settings, $formatted_values, $restict_service = false, $override_rates = false)
     {
         $is_filter_applied = false;
         $filters = ['weight', 'price', 'quantity'];
         // Add restrict service filters in case of restrict to state rule
-        $filters = $restict_service ? array_merge(['country'], $filters) : $filters;
+        $filters = ($restict_service || $override_rates) ? array_merge(['country'], $filters) : $filters;
 
         // Check if any of the filter is checked
-        $filters_checks = ['filter_by_weight', 'filter_by_price', 'filter_by_quantity', 'filter_by_product_tag', 'filter_by_country', 'filter_by_state'];
+        $filters_checks = ['filter_by_weight', 'filter_by_price', 'filter_by_quantity', 'filter_by_product_tag', 'filter_by_country', 'filter_by_state', 'filter_by_country_or', 'filter_by_state_or'];
         $any_filter_checked = false;
         foreach ($filters_checks as $check) {
@@ -819,14 +841,20 @@
 
         foreach ($filters as $filter) {
-            if (filter_var($settings['filter_by_' . $filter], FILTER_VALIDATE_BOOLEAN)) {
+            $override_rate_filter = isset($settings['filter_by_' . $filter . '_or']) ? filter_var($settings['filter_by_' . $filter . '_or'], FILTER_VALIDATE_BOOLEAN) : false;
+
+            if (filter_var($settings['filter_by_' . $filter], FILTER_VALIDATE_BOOLEAN) || $override_rate_filter) {
                 if ($filter == 'country') {
                     $destination_country = isset($destination_address['country']) ? $destination_address['country'] : '';
-                    $this->is_dest_country_matched = $this->is_country_matched($settings['filter_by_country_value'],$destination_country);
+                    $filter_by_country = $override_rate_filter ? 'filter_by_country_value_or' : 'filter_by_country_value';
+                    $this->is_dest_country_matched = $this->is_country_matched($settings[$filter_by_country], $destination_country);
                     $is_filter_applied = $this->is_dest_country_matched;
                     $this->is_country_filter_applied = true;
 
-                    if ($is_filter_applied && filter_var($settings['filter_by_state'], FILTER_VALIDATE_BOOLEAN)) {
+                    $filter_by_state = $override_rate_filter ? 'filter_by_state_or' : 'filter_by_state';
+                    $filter_by_state_value = $override_rate_filter ? 'filter_by_state_value_or' : 'filter_by_state_value';
+
+                    if ($is_filter_applied && filter_var($settings[$filter_by_state], FILTER_VALIDATE_BOOLEAN)) {
                         $destination_state = isset($destination_address['state']) ? $destination_address['state'] : '';
-                        $states = isset($settings['filter_by_state_value']) ? $settings['filter_by_state_value'] : [];
+                        $states = isset($settings[$filter_by_state_value]) ? $settings[$filter_by_state_value] : [];
                         $is_filter_applied = $this->is_dest_country_matched = in_array($destination_state, $states);
                     }
@@ -853,5 +881,5 @@
     }
 
-    function apply_override_rates_rule($ups_small_package, $settings, $rates)
+    function apply_override_rates_rule($ups_small_package, $settings, $rates, $rule_name)
     {
         $updated_rates = $rates;
@@ -859,4 +887,6 @@
         foreach ($ups_small_package as $org_zip => $pkg) {
             $is_rule_applied = false;
+            $this->is_country_filter_applied = false;
+            $this->is_dest_country_matched = false;
             $shipments = [];
             $org_zip = isset($pkg['zip']) ? $pkg['zip'] : $org_zip;
@@ -864,29 +894,39 @@
 
             $formatted_values = $this->get_formatted_values($shipments);
-            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values, false, true);
 
             if ($is_rule_applied) {
-                $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, $org_zip);
+                $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, $org_zip, false);
             };
         }
 
+        // Eniture debug mode
+        $data = ['rule_name' => $rule_name, 'settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Override Rates Rule Applied: {$rule_name}", $data);
+
         return $updated_rates;
     }
 
-    function apply_restrict_to_state_rule($ups_small_package, $settings, $rates) 
-    {
+    function apply_restrict_to_state_rule($ups_small_package, $settings, $rates)
+    {
+        $this->is_country_filter_applied = false;
+        $this->is_dest_country_matched = false;
+
         $formatted_values = $this->get_formatted_values($ups_small_package);
         $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values, true);
         $this->is_restrict_service_rule_applied = $is_rule_applied;
 
-        return ($is_rule_applied || ($this->is_country_filter_applied && !$this->is_dest_country_matched)) ? $this->get_updated_rates($rates, $settings, true) : $rates;
-    }
-
-    function get_updated_rates($rates, $settings, $restict_service = false, $org_zip = '')
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "UPS Small Restrict To State Rule Applied", $is_rule_applied ? 'Yes' : 'No');
+
+        return ($is_rule_applied || ($this->is_country_filter_applied && !$this->is_dest_country_matched)) ? $this->get_updated_rates($rates, $settings, true, '', false) : $rates;
+    }
+
+    function get_updated_rates($rates, $settings, $restict_service = false, $org_zip = '', $min_shipping_charge = false)
     {
         if ($restict_service) {
             if ($this->is_country_filter_applied && !$this->is_dest_country_matched) {
                 $rates_keys = ['q', 'ups_rate', 'GFP', 'q_92', 'q_93', 'q_94', 'q_95', 'usrg', 'usr2', 'usr1', 'usr3'];
-                
+
                 foreach ($rates as $key => $value) {
                     foreach ($rates_keys as $rates_key) {
@@ -896,6 +936,8 @@
             }
         } else {
+            $this->shipping_rule_object = new Eniture_UpsSmallShippingRulesAjaxReq();
+
             foreach ($rates as $key => $result) {
-                if ($key != $org_zip) continue;
+                if ($key != $org_zip && !empty($org_zip)) continue;
 
                 $ups_quotes = (isset($result->q) && !empty($result->q)) ? $result->q : [];
@@ -904,64 +946,80 @@
                 $rates_key = isset($result->ups_rate) ? 'ups_rate' : $rates_key;
                 $simple_rate_services = ['usrg', 'usr2', 'usr1', 'usr3'];
-    
+
                 if (empty($ups_quotes)) continue;
-    
+
                 foreach ($ups_quotes as $service_key => $val) {
                     $rate_arr = $this->get_rate_arr($val);
                     $service_code = isset($settings['service']) ? $settings['service'] : '';
-                    
+
+                    // minimum shipping charge settings
+                    $msc_service_exists = false;
+                    if ($min_shipping_charge) {
+                        $services_codes = isset($settings['minimum_shipping_charge_services']) ? $settings['minimum_shipping_charge_services'] : [];
+                        $msc_service_exists = in_array($rate_arr->Service->Code, $services_codes) || in_array($service_key, $services_codes);
+                    }
+
                     // Replace service rate with new rate defined in the shipping rule
-                    if (isset($rate_arr->Service->Code) && $rate_arr->Service->Code == $service_code && $rates_key != '') {
+                    if (isset($rate_arr->Service->Code) && ($rate_arr->Service->Code == $service_code || $msc_service_exists) && $rates_key != '') {
                         if ($service_key == 'GFP') {
                             // Legacy API response
                             if (isset($val->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue)) {
-                                $rates[$key]->$rates_key->$service_key->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue = $settings['service_rate'];
+                                $net_rate = $val->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue;
+                                $rates[$key]->$rates_key->$service_key->soapenvBody->rateRateResponse->rateRatedShipment->rateTotalCharges->rateMonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                             }
-        
+
                             // New API response
                             if (isset($val->RateResponse->RatedShipment->TotalCharges->MonetaryValue)) {
-                                $rates[$key]->$rates_key->$service_key->RateResponse->RatedShipment->TotalCharges->MonetaryValue = $settings['service_rate'];
+                                $net_rate = $val->RateResponse->RatedShipment->TotalCharges->MonetaryValue;
+                                $rates[$key]->$rates_key->$service_key->RateResponse->RatedShipment->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                             }
-    
+
                             $rates[$key]->$rates_key->$service_key->overrideRate = true;
                         } else {
                             if (isset($rate_arr->TotalCharges->MonetaryValue)) {
                                 if (isset($rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
-    
+
                                 if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->TotalCharges->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
                             }
-        
+
                             if (isset($rate_arr->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
                                 if (isset($rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->NegotiatedRateCharges->TotalCharge->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
-    
+
                                 if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRateCharges->TotalCharge->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
                             }
-                            
+
                             if (isset($rate_arr->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
                                 if (isset($rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
-    
+
                                 if (isset($rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue)) {
-                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $settings['service_rate'];
+                                    $net_rate = $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
+                                    $rates[$key]->$rates_key->$service_key->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                                 }
                             }
-    
+
                             $rates[$key]->$rates_key->$service_key->overrideRate = true;
                         }
                     }
-    
+
                     // UPS simple rate services
-                    if (in_array($service_key, $simple_rate_services) && $service_key == $service_code && $rates_key != '' && isset($val->rate)) {
+                    if (in_array($service_key, $simple_rate_services) && ($service_key == $service_code || $msc_service_exists) && $rates_key != '' && isset($val->rate)) {
                         if ($rates[$key]->$rates_key->$service_key->rate) {
-                            $rates[$key]->$rates_key->$service_key->rate = $settings['service_rate'];
+                            $net_rate = $rates[$key]->$rates_key->$service_key->rate;
+                            $rates[$key]->$rates_key->$service_key->rate = $this->shipping_rule_object->ups_small_get_service_rate($net_rate, $settings, $msc_service_exists);
                             $rates[$key]->$rates_key->$service_key->overrideRate = true;
                         }
@@ -974,5 +1032,5 @@
     }
 
-    function is_country_matched($selected_country, $destination_country) 
+    function is_country_matched($selected_country, $destination_country)
     {
         $is_matched = false;
@@ -1021,4 +1079,8 @@
             }
         }
+
+        // Eniture debug mode
+        $data = ['settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Hide Methods By Origin Rule Applied", $data);
 
         return $updated_rates;
@@ -1047,3 +1109,38 @@
         return $rate_arr;
     }
+
+    function apply_minimum_shipping_charge_rule($ups_small_package, $settings, $rates, $rule_name)
+    {
+        $is_rule_applied = false;
+        $updated_rates = $rates;
+
+        if ($settings['apply_to'] == 'cart') {
+            $formatted_values = $this->get_formatted_values($ups_small_package);
+            $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+
+            if ($is_rule_applied) {
+                $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, '', true);
+            }
+        } else {
+            foreach ($ups_small_package as $org_zip => $pkg) {
+                $is_rule_applied = false;
+                $shipments = [];
+                $org_zip = isset($pkg['zip']) ? $pkg['zip'] : $org_zip;
+                $shipments[$org_zip] = $pkg;
+
+                $formatted_values = $this->get_formatted_values($shipments);
+                $is_rule_applied = $this->apply_rule_filters($settings, $formatted_values);
+
+                if ($is_rule_applied) {
+                    $updated_rates = $this->get_updated_rates($updated_rates, $settings, false, $org_zip, true);
+                }
+            }
+        }
+
+        // Eniture debug mode
+        $data = ['rule_name' => $rule_name, 'settings' => $settings, 'rates' => json_encode($rates), 'updated_rates' => json_encode($updated_rates)];
+        do_action("eniture_debug_mood", "UPS Small Minimum Shipping Charge Rule Applied", $data);
+
+        return $updated_rates;
+    }
 }
Index: /small-package-quotes-ups-edition/trunk/ups-small-shipping-class.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/ups-small-shipping-class.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/ups-small-shipping-class.php	(revision 3237693)
@@ -261,9 +261,22 @@
                     );
                     $this->add_rate($rates);
-                    
+
+                    // Eniture debug mode
+                    do_action("eniture_debug_mood", "Free Shipping (-100% Handling Fee) Applied (UPS Small)", $rates);
+
                     return [];
                 }
 
                 $ups_small_package = $get_packg_obj->group_ups_small_shipment($package, $ups_small_res_inst, $freight_zipcode);
+
+                // Apply free shipping rule
+                $free_shipping_rate = (new Eniture_UpsSmallShippingRulesAjaxReq())->apply_free_shipping_rule($ups_small_package);
+                if (isset($free_shipping_rate['rates']) && !empty($free_shipping_rate['rates']) && is_array($free_shipping_rate['rates'])) {
+                    $this->add_rate($free_shipping_rate['rates']);
+                    return [];
+                }
+
+                $ups_small_package = isset($free_shipping_rate['package']) ? $free_shipping_rate['package'] : $ups_small_package;
+
                 // Apply hide methods shipping rules
                 $shipping_rules_applied = $get_packg_obj->apply_shipping_rules($ups_small_package);
@@ -290,4 +303,7 @@
                             $ups_small_package[$org_id]['is_shipment'] = 'ltl';
                             $ups_small_package[$org_id]['origin']['ptype'] = 'ltl';
+
+                            // Eniture debug mode
+                            do_action("eniture_debug_mood", "Suppressing UPS Small Package Rates (Weight Threshold)", $ups_small_package[$org_id]);
                         }
                     }
@@ -352,4 +368,7 @@
                 $en_is_shipment = (count($quotes) > 1) || !empty($virtual_rate) ? 'en_multi_shipment' : 'en_single_shipment';
 
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "Shipment Type (UPS Small)", $en_is_shipment);
+
                 $this->quote_settings['shipment'] = $en_is_shipment;
                 $this->eniture_rates = [];
@@ -380,7 +399,12 @@
                     }
                 }
+
                 if ($this->en_not_returned_the_quotes) {
+                    // Eniture debug mode
+                    do_action("eniture_debug_mood", "UPS Small Quotes not returned", $this->en_not_returned_the_quotes ? 'Yes' : 'No');
+
                     return [];
                 }
+
                 if ($en_is_shipment == 'en_single_shipment') {
                     // In-store pickup and local delivery
Index: /small-package-quotes-ups-edition/trunk/ups-small-test-connection.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/ups-small-test-connection.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/ups-small-test-connection.php	(revision 3237693)
@@ -19,4 +19,9 @@
 function eniture_ups_test_submit()
 {
+    if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'eniture_ups_small_nonce')) {
+        echo json_encode([]);
+        exit;
+    }
+
     $iAcountNumber = (isset($_POST['ups_small_acc_number'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_acc_number'] )) : '';
     $sLicenseKey = (isset($_POST['ups_small_license'])) ? sanitize_text_field(wp_unslash( $_POST['ups_small_license'] )) : '';
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/get-distance-request.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/get-distance-request.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/get-distance-request.php	(revision 3237693)
@@ -41,4 +41,6 @@
         );
 
+        // Eniture debug mode
+        do_action("eniture_debug_mood", "Multi Warehouse Distance Request (UPS Small)", $postData);
 
         $Ups_Small_Curl_Request = new Eniture_UPS_Small_Curl_Request();
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild-delivery.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild-delivery.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild-delivery.php	(revision 3237693)
@@ -20,5 +20,5 @@
         ));
 
-        wp_enqueue_script('en_woo_wd_script', plugin_dir_url(__FILE__) . '/wild/assets/js/warehouse_section.js', array(), '1.0.5');
+        wp_enqueue_script('en_woo_wd_script', plugin_dir_url(__FILE__) . '/wild/assets/js/warehouse_section.js', array(), '1.0.6');
         wp_localize_script('en_woo_wd_script', 'script', array(
             'pluginsUrl' => plugins_url(),
@@ -27,4 +27,8 @@
         wp_register_style('warehouse_section', plugin_dir_url(__FILE__) . '/wild/assets/css/warehouse_section.css', false, '1.0.4');
         wp_enqueue_style('warehouse_section');
+        wp_localize_script('en_woo_wd_script', 'en_ups_small_wh_script', array(
+            'pluginsUrl' => plugins_url(),
+            'nonce' => wp_create_nonce("en_woo_wd_nonce"),
+        ));
     }
 
@@ -69,4 +73,10 @@
            class="en_wd_add_warehouse_btn <?php echo esc_attr($multi_warehouse_disabled);
            ?>" name="avc">Add</a>
+
+           <?php
+                echo "<br /> <br />";
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Warehouse List", $warehous_list);
+            ?>
 
         <div class="wild_warehouse pakage_notify heading_right">
@@ -132,9 +142,9 @@
                         <td class="en_wd_warehouse_list_data">
                             <a href="javascript(0)"
-                               onclick="return eniture_wd_edit_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                               onclick="return en_ups_small_wd_edit_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
                                         src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"
                                         title="Edit"></a>
                             <a href="javascript(0)"
-                               onclick="return en_wd_delete_current_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                               onclick="return en_ups_small_wd_delete_current_warehouse(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
                                         src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"
                                         title="Delete"></a>
@@ -196,4 +206,10 @@
            class="en_wd_add_dropship_btn hide_drop_val <?php echo esc_attr($multi_dropship_disabled); ?>">Add</a>
 
+           <?php
+                echo "<br /> <br />";
+                // Eniture debug mode
+                do_action("eniture_debug_mood", "UPS Small Dropship List", $dropship_list);
+            ?>
+
         <div class="wild_warehouse pakage_notify heading_right">
             <?php echo $multi_dropship_package_required; ?>
@@ -264,9 +280,9 @@
                         <td class="en_wd_dropship_list_data">
                             <a href="javascript(0)"
-                               onclick="return eniture_wd_edit_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                               onclick="return en_ups_small_wd_edit_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
                                         src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"
                                         title="Edit"></a>
                             <a href="javascript(0)"
-                               onclick="return en_wd_delete_current_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
+                               onclick="return en_ups_small_wd_delete_current_dropship(<?php echo (isset($list->id)) ? esc_attr($list->id) : ''; ?>);"><img
                                         src="<?php echo esc_url_raw(plugins_url()); ?>/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"
                                         title="Delete"></a>
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/assets/js/warehouse_section.js
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/assets/js/warehouse_section.js	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/assets/js/warehouse_section.js	(revision 3237693)
@@ -322,7 +322,7 @@
  * @returns {Boolean}
  */
-if (typeof en_wd_save_warehouse != 'function')
-{
-    function en_wd_save_warehouse()
+if (typeof en_ups_small_wd_save_warehouse != 'function')
+{
+    function en_ups_small_wd_save_warehouse()
     {
         var validate = enWdValidateInput("#add_warehouses");
@@ -342,5 +342,5 @@
 
         var postForm = {
-            'action': 'eniture_wd_save_warehouse',
+            'action': 'en_ups_small_wd_save_warehouse',
             'origin_id': jQuery('#edit_form_id').val(),
             'origin_city': city,
@@ -355,5 +355,6 @@
             // preferred origin
             'pref_loc_lfq': jQuery('#add_warehouses #pref_loc_lfq').val(),
-            'pref_loc_spq': jQuery('#add_warehouses #pref_loc_spq').val()
+            'pref_loc_spq': jQuery('#add_warehouses #pref_loc_spq').val(),
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
 
@@ -389,5 +390,5 @@
                 } else if (data.update_qry == 1) {
 
-                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_warehouse_list_data">' + data.origin_city + '</td><td class="en_wd_warehouse_list_data">' + data.origin_state + '</td><td class="en_wd_warehouse_list_data">' + data.origin_zip + '</td><td class="en_wd_warehouse_list_data">' + data.origin_country + '</td><td class="en_wd_warehouse_list_data"><a href="javascript(0)" title="Edit" onclick="return eniture_wd_edit_warehouse(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_wd_delete_current_warehouse(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
+                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_warehouse_list_data">' + data.origin_city + '</td><td class="en_wd_warehouse_list_data">' + data.origin_state + '</td><td class="en_wd_warehouse_list_data">' + data.origin_zip + '</td><td class="en_wd_warehouse_list_data">' + data.origin_country + '</td><td class="en_wd_warehouse_list_data"><a href="javascript(0)" title="Edit" onclick="return en_ups_small_wd_edit_warehouse(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_ups_small_wd_delete_current_warehouse(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
                     jQuery('.warehouse_updated').show('slow').delay(5000).hide('slow');
                     jQuery('.warehouse_deleted').css('display', 'none');
@@ -414,13 +415,14 @@
  * @returns {Boolean}
  */
-if (typeof en_wd_delete_current_warehouse != 'function')
-{
-    function en_wd_delete_current_warehouse(e)
+if (typeof en_ups_small_wd_delete_current_warehouse != 'function')
+{
+    function en_ups_small_wd_delete_current_warehouse(e)
     {
         var tab = get_parameter_by_name('tab');
         var postForm = {
-            'action': 'eniture_wd_delete_warehouse',
+            'action': 'en_ups_small_wd_delete_warehouse',
             'delete_id': e,
             'tab': tab,
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
 
@@ -456,11 +458,13 @@
  * @returns {Boolean}
  */
-if (typeof eniture_wd_edit_warehouse != 'function')
-{
-    function eniture_wd_edit_warehouse(e)
-    {
+if (typeof en_ups_small_wd_edit_warehouse != 'function')
+{
+    function en_ups_small_wd_edit_warehouse(e)
+    {
+        console.log('en_ups_small_wd_edit_warehouse');
         var postForm = {
-            'action': 'eniture_wd_edit_warehouse',
+            'action': 'en_ups_small_wd_edit_warehouse',
             'edit_id': e,
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
         jQuery.ajax({
@@ -512,7 +516,7 @@
  * @returns {Boolean}
  */
-if (typeof en_wd_save_dropship != 'function')
-{
-    function en_wd_save_dropship()
+if (typeof en_ups_small_wd_save_dropship != 'function')
+{
+    function en_ups_small_wd_save_dropship()
     {
 
@@ -533,5 +537,5 @@
 
         var postForm = {
-            'action': 'eniture_wd_save_dropship',
+            'action': 'en_ups_small_wd_save_dropship',
             'dropship_id': jQuery('#edit_dropship_form_id').val(),
             'dropship_city': city,
@@ -547,5 +551,6 @@
             // preferred origin
             'pref_loc_lfq': jQuery('#add_dropships #pref_loc_lfq').val(),
-            'pref_loc_spq': jQuery('#add_dropships #pref_loc_spq').val()
+            'pref_loc_spq': jQuery('#add_dropships #pref_loc_spq').val(),
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
 
@@ -581,5 +586,5 @@
 
                 } else if (data.update_qry == 1) {
-                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_dropship_list_data">' + data.nickname + '</td><td class="en_wd_dropship_list_data">' + data.origin_city + '</td><td class="en_wd_dropship_list_data">' + data.origin_state + '</td><td class="en_wd_dropship_list_data">' + data.origin_zip + '</td><td class="en_wd_dropship_list_data">' + data.origin_country + '</td><td class="en_wd_dropship_list_data"><a href="javascript(0)" title="Edit" onclick="return eniture_wd_edit_dropship(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_wd_delete_current_dropship(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
+                    jQuery('tr[id=row_' + WarehpuseDataId + ']').html('<td class="en_wd_dropship_list_data">' + data.nickname + '</td><td class="en_wd_dropship_list_data">' + data.origin_city + '</td><td class="en_wd_dropship_list_data">' + data.origin_state + '</td><td class="en_wd_dropship_list_data">' + data.origin_zip + '</td><td class="en_wd_dropship_list_data">' + data.origin_country + '</td><td class="en_wd_dropship_list_data"><a href="javascript(0)" title="Edit" onclick="return en_ups_small_wd_edit_dropship(' + WarehpuseDataId + ')"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/edit.png"></a><a href="javascript(0)" title="Delete" onclick="return en_ups_small_wd_delete_current_dropship(' + WarehpuseDataId + ');"><img src="' + script.pluginsUrl + '/small-package-quotes-ups-edition/warehouse-dropship/wild/assets/images/delete.png"></a></td>');
                     jQuery('.dropship_updated').show('slow').delay(5000).hide('slow');
                     jQuery('.dropship_created').css('display', 'none');
@@ -612,11 +617,12 @@
  * @returns {Boolean}
  */
-if (typeof eniture_wd_edit_dropship != 'function')
-{
-    function eniture_wd_edit_dropship(e)
+if (typeof en_ups_small_wd_edit_dropship != 'function')
+{
+    function en_ups_small_wd_edit_dropship(e)
     {
         var postForm = {
-            'action': 'eniture_wd_edit_dropship',
+            'action': 'en_ups_small_wd_edit_dropship',
             'dropship_edit_id': e,
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
         jQuery.ajax({
@@ -670,7 +676,7 @@
  * @returns {Boolean}
  */
-if (typeof en_wd_delete_current_dropship != 'function')
-{
-    function en_wd_delete_current_dropship(e)
+if (typeof en_ups_small_wd_delete_current_dropship != 'function')
+{
+    function en_ups_small_wd_delete_current_dropship(e)
     {
         var id = e;
@@ -701,7 +707,8 @@
         var tab = get_parameter_by_name('tab');
         var postForm = {
-            'action': 'eniture_wd_delete_dropship',
+            'action': 'en_ups_small_wd_delete_dropship',
             'dropship_delete_id': e,
             'tab': tab,
+            'wp_nonce': en_ups_small_wh_script.nonce
         };
         jQuery.ajax({
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/dropship/dropship_template.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/dropship/dropship_template.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/dropship/dropship_template.php	(revision 3237693)
@@ -170,5 +170,5 @@
 </script>
 
-<div class="en_wd_setting_section">
+<div class="en_wd_setting_section ups_small_wrapper">
     <a href="#delete_dropship_btn" class="delete_dropship_btn hide_drop_val"></a>
     <div id="delete_dropship_btn" class="en_wd_warehouse_overlay">
@@ -376,5 +376,5 @@
                     -->
                     <div class="form-btns">
-                        <input type="submit" name="en_wd_submit_dropship" value="Save" class="save_warehouse_form" onclick="return en_wd_save_dropship();">
+                        <input type="submit" name="en_wd_submit_dropship" value="Save" class="save_warehouse_form" onclick="return en_ups_small_wd_save_dropship();">
                     </div>
                 </form>
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/includes/wild-delivery-save.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/includes/wild-delivery-save.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/includes/wild-delivery-save.php	(revision 3237693)
@@ -25,22 +25,23 @@
             add_action('wp_ajax_eniture_wd_get_address', array($this, 'eniture_get_address_api_ajax'));
 
-            add_action('wp_ajax_nopriv_eniture_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
-            add_action('wp_ajax_eniture_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
-
-            add_action('wp_ajax_nopriv_eniture_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
-            add_action('wp_ajax_eniture_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
-
-            add_action('wp_ajax_nopriv_eniture_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
-            add_action('wp_ajax_eniture_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
-
-
-            add_action('wp_ajax_nopriv_eniture_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
-            add_action('wp_ajax_eniture_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
-
-            add_action('wp_ajax_nopriv_eniture_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
-            add_action('wp_ajax_eniture_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
-
-            add_action('wp_ajax_nopriv_eniture_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
-            add_action('wp_ajax_eniture_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
+            // Warehouse actions
+            add_action('wp_ajax_nopriv_en_ups_small_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_save_warehouse', array($this, 'eniture_save_warehouse_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_edit_warehouse', array($this, 'eniture_edit_warehouse_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_delete_warehouse', array($this, 'eniture_delete_warehouse_ajax'));
+
+            // Dropship actions
+            add_action('wp_ajax_nopriv_en_ups_small_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_save_dropship', array($this, 'eniture_save_dropship_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_edit_dropship', array($this, 'eniture_edit_dropship_ajax'));
+
+            add_action('wp_ajax_nopriv_en_ups_small_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
+            add_action('wp_ajax_en_ups_small_wd_delete_dropship', array($this, 'eniture_delete_dropship_ajax'));
         }
 
@@ -168,4 +169,9 @@
         function eniture_save_warehouse_ajax()
         {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
             global $wpdb;
             $html = "";
@@ -220,5 +226,5 @@
                 
                 if (isset($validateData["city"])) {
-                    $get_warehouse_id = (isset($_POST['origin_id']) && intval($_POST['origin_id'])) ? sanitize_text_field(wp_unslash($_POST['origin_id'])) : "";
+                    $get_warehouse_id = (isset($_POST['origin_id']) && intval($_POST['origin_id'])) ? intval($_POST['origin_id']) : "";
                     if ($get_warehouse_id && (empty($get_warehouse) || (!empty($get_warehouse) && reset($get_warehouse)->id == $get_warehouse_id))) {
                         $update_qry = $wpdb->update(
@@ -257,7 +263,12 @@
         function eniture_edit_warehouse_ajax()
         {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
             // Terminal phone number
             global $wpdb;
-            $get_warehouse_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? sanitize_text_field(wp_unslash($_POST['edit_id'])) : "";
+            $get_warehouse_id = (isset($_POST['edit_id']) && intval($_POST['edit_id'])) ? intval($_POST['edit_id']) : "";
             $warehous_list = $wpdb->get_results(
                 $wpdb->prepare(
@@ -278,6 +289,11 @@
         function eniture_delete_warehouse_ajax()
         {
-            global $wpdb;
-            $get_warehouse_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? sanitize_text_field(wp_unslash($_POST['delete_id'])) : "";
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+            $get_warehouse_id = (isset($_POST['delete_id']) && intval($_POST['delete_id'])) ? intval($_POST['delete_id']) : "";
             $qry = $wpdb->delete($wpdb->prefix . 'warehouse', array('id' => $get_warehouse_id, 'location' => 'warehouse'));
 
@@ -294,4 +310,9 @@
         function eniture_save_dropship_ajax()
         {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
             global $wpdb;
             $html = "";
@@ -348,5 +369,5 @@
 
                 if (isset($validateData["city"])) {
-                    $get_dropship_id = (isset($_POST['dropship_id']) && intval($_POST['dropship_id'])) ? sanitize_text_field(wp_unslash($_POST['dropship_id'])) : "";
+                    $get_dropship_id = (isset($_POST['dropship_id']) && intval($_POST['dropship_id'])) ? intval($_POST['dropship_id']) : "";
 
                     if ($get_dropship_id != '' && (empty($get_dropship) || (!empty($get_dropship) && reset($get_dropship)->id == $get_dropship_id))) {
@@ -386,7 +407,12 @@
         function eniture_edit_dropship_ajax()
         {
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
             // Terminal phone number
             global $wpdb;
-            $get_dropship_id = (isset($_POST['dropship_edit_id']) && intval($_POST['dropship_edit_id'])) ? sanitize_text_field(wp_unslash($_POST['dropship_edit_id'])) : "";
+            $get_dropship_id = (isset($_POST['dropship_edit_id']) && intval($_POST['dropship_edit_id'])) ? intval($_POST['dropship_edit_id']) : "";
             $warehous_list = $wpdb->get_results(
                 $wpdb->prepare(
@@ -406,8 +432,12 @@
         function eniture_delete_dropship_ajax()
         {
-
-            global $wpdb;
-
-            $get_dropship_id = (isset($_POST['dropship_delete_id']) && intval($_POST['dropship_delete_id'])) ? sanitize_text_field(wp_unslash($_POST['dropship_delete_id'])) : "";
+            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['wp_nonce'], 'en_woo_wd_nonce')) {
+                echo wp_json_encode([]);
+                return;
+            }
+
+            global $wpdb;
+
+            $get_dropship_id = (isset($_POST['dropship_delete_id']) && intval($_POST['dropship_delete_id'])) ? intval($_POST['dropship_delete_id']) : "";
             $dropship_id = isset($_POST['dropship_delete_id']) ? sanitize_text_field(wp_unslash($_POST['dropship_delete_id'])) : "";
             $get_dropship_array = array($dropship_id);
Index: /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/warehouse/warehouse_template.php
===================================================================
--- /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/warehouse/warehouse_template.php	(revision 3237692)
+++ /small-package-quotes-ups-edition/trunk/warehouse-dropship/wild/warehouse/warehouse_template.php	(revision 3237693)
@@ -167,5 +167,5 @@
     });
 </script>
-<div class="en_wd_setting_section">
+<div class="en_wd_setting_section ups_small_wrapper">
     <h1>Warehouses</h1><br>
 
@@ -357,5 +357,5 @@
                     -->
                     <div class="form-btns">
-                        <input type="submit" name="en_wd_submit_warehouse" value="Save" class="save_warehouse_form" onclick="return en_wd_save_warehouse();">
+                        <input type="submit" name="en_wd_submit_warehouse" value="Save" class="save_warehouse_form" onclick="return en_ups_small_wd_save_warehouse();">
                     </div>
                 </form>
