Changeset 3494315
- Timestamp:
- 03/30/2026 08:55:04 AM (41 hours ago)
- Location:
- ltl-freight-quotes-day-ross-edition
- Files:
-
- 12 added
- 2 deleted
- 38 edited
- 6 copied
-
tags/2.2.5 (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk)
-
tags/2.2.5/admin/assets/en-dayross-admin.css (modified) (6 diffs)
-
tags/2.2.5/admin/assets/en-dayross-admin.js (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk/admin/assets/en-dayross-admin.js) (4 diffs)
-
tags/2.2.5/admin/assets/wickedpicker.js (added)
-
tags/2.2.5/admin/assets/wickedpicker.min.css (added)
-
tags/2.2.5/admin/fonts (added)
-
tags/2.2.5/admin/fonts/fontello.eot (added)
-
tags/2.2.5/admin/fonts/fontello.ttf (added)
-
tags/2.2.5/admin/fonts/fontello.woff (added)
-
tags/2.2.5/admin/product/en-product-detail.php (modified) (4 diffs)
-
tags/2.2.5/admin/tab/connection-settings/en-connection-settings.php (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk/admin/tab/connection-settings/en-connection-settings.php)
-
tags/2.2.5/admin/tab/en-tab.php (modified) (2 diffs)
-
tags/2.2.5/admin/tab/location/assets/css/en-dayross-location.css (modified) (4 diffs)
-
tags/2.2.5/admin/tab/location/assets/js/en-dayross-location.js (modified) (4 diffs)
-
tags/2.2.5/admin/tab/location/dropship/en-dropship.php (modified) (1 diff)
-
tags/2.2.5/admin/tab/location/en-location.php (modified) (2 diffs)
-
tags/2.2.5/admin/tab/location/includes/en-location-ajax.php (modified) (4 diffs)
-
tags/2.2.5/admin/tab/location/warehouse/en-warehouse.php (modified) (1 diff)
-
tags/2.2.5/admin/tab/logs/en-logs.php (modified) (1 diff)
-
tags/2.2.5/admin/tab/quote-settings/en-quote-settings.php (modified) (2 diffs)
-
tags/2.2.5/common/en-plans.php (modified) (3 diffs)
-
tags/2.2.5/en-hit-to-update-plan.php (deleted)
-
tags/2.2.5/en-install.php (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk/en-install.php) (4 diffs)
-
tags/2.2.5/http/en-curl.php (modified) (2 diffs)
-
tags/2.2.5/ltl-freight-quotes-dayross-edition.php (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk/ltl-freight-quotes-dayross-edition.php) (1 diff)
-
tags/2.2.5/readme.txt (copied) (copied from ltl-freight-quotes-day-ross-edition/trunk/readme.txt) (2 diffs)
-
tags/2.2.5/server/api/en-response.php (modified) (2 diffs)
-
tags/2.2.5/server/common/en-quote-settings.php (modified) (1 diff)
-
tags/2.2.5/server/en-shipping-rates.php (modified) (1 diff)
-
tags/2.2.5/server/package/en-package.php (modified) (8 diffs)
-
trunk/admin/assets/en-dayross-admin.css (modified) (6 diffs)
-
trunk/admin/assets/en-dayross-admin.js (modified) (4 diffs)
-
trunk/admin/assets/wickedpicker.js (added)
-
trunk/admin/assets/wickedpicker.min.css (added)
-
trunk/admin/fonts (added)
-
trunk/admin/fonts/fontello.eot (added)
-
trunk/admin/fonts/fontello.ttf (added)
-
trunk/admin/fonts/fontello.woff (added)
-
trunk/admin/product/en-product-detail.php (modified) (4 diffs)
-
trunk/admin/tab/en-tab.php (modified) (2 diffs)
-
trunk/admin/tab/location/assets/css/en-dayross-location.css (modified) (4 diffs)
-
trunk/admin/tab/location/assets/js/en-dayross-location.js (modified) (4 diffs)
-
trunk/admin/tab/location/dropship/en-dropship.php (modified) (1 diff)
-
trunk/admin/tab/location/en-location.php (modified) (2 diffs)
-
trunk/admin/tab/location/includes/en-location-ajax.php (modified) (4 diffs)
-
trunk/admin/tab/location/warehouse/en-warehouse.php (modified) (1 diff)
-
trunk/admin/tab/logs/en-logs.php (modified) (1 diff)
-
trunk/admin/tab/quote-settings/en-quote-settings.php (modified) (2 diffs)
-
trunk/common/en-plans.php (modified) (3 diffs)
-
trunk/en-hit-to-update-plan.php (deleted)
-
trunk/en-install.php (modified) (4 diffs)
-
trunk/http/en-curl.php (modified) (2 diffs)
-
trunk/ltl-freight-quotes-dayross-edition.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/server/api/en-response.php (modified) (2 diffs)
-
trunk/server/common/en-quote-settings.php (modified) (1 diff)
-
trunk/server/en-shipping-rates.php (modified) (1 diff)
-
trunk/server/package/en-package.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/assets/en-dayross-admin.css
r3489974 r3494315 127 127 } 128 128 129 .en_quote_settings_sub_options th { 129 .en_quote_settings_sub_options th, 130 .dayross_cutt_off_time_ship_date_offset th, 131 .en_quote_settings_shipment_offset_days_dayross_tr th, 132 .en_quote_settings_all_shipment_days_dayross_tr th 133 { 130 134 padding: 0 0 10px 15px; 131 135 margin-left: 10px !important; … … 133 137 } 134 138 135 .en_quote_settings_sub_options td { 139 .dayross_cutt_off_time_ship_date_offset th, 140 .en_quote_settings_shipment_offset_days_dayross_tr th, 141 .en_quote_settings_all_shipment_days_dayross_tr th { 142 padding-top: 10px !important; 143 } 144 145 .en_quote_settings_sub_options td, 146 .dayross_cutt_off_time_ship_date_offset td, 147 .en_quote_settings_shipment_offset_days_dayross_tr td, 148 .en_quote_settings_all_shipment_days_dayross_tr td { 136 149 padding: 0 0 10px 15px; 137 150 } … … 364 377 .woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"], 365 378 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 379 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 366 380 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 367 381 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], … … 387 401 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], 388 402 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 403 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 389 404 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 390 405 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"], … … 396 411 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip, 397 412 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip, 413 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip, 398 414 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip, 399 415 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip, … … 468 484 background: none !important; 469 485 } 486 487 .en_quote_settings_all_shipment_days_dayross_tr td { 488 display: flex !important; 489 align-items: center; 490 gap: 16px; 491 flex-wrap: nowrap; 492 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/assets/en-dayross-admin.js
r3490815 r3494315 66 66 jQuery('#en_dayross_quote_settings').parents().find('.button-primary, .is-primary').on('click', function (event) { 67 67 68 jQuery(':checkbox:disabled').prop('disabled', false); 69 68 70 let en_validate_settings = {}; 69 71 let en_data_error = true; … … 179 181 } 180 182 183 // Validate fullfillment offset days 184 if (!dayrossValidateFullfillmentOffsetDays()) return false; 181 185 // backup rates validation 182 186 if (!dayrossBackupRatesValidations()) return false; … … 376 380 handleAPISelection(); 377 381 jQuery('#en_connection_settings_api_dayross').on('change', handleAPISelection); 382 383 // Cut-off time and shipment offset days settings 384 dayrossCutOffTimeAndShipDateSettings(); 378 385 }); 379 386 … … 801 808 } 802 809 } 810 811 if (typeof dayrossCutOffTimeAndShipDateSettings != 'function') { 812 function dayrossCutOffTimeAndShipDateSettings() { 813 jQuery("#en_quote_settings_shipment_offset_days_dayross").closest('tr').addClass("en_quote_settings_shipment_offset_days_dayross_tr"); 814 jQuery("#en_quote_settings_all_shipment_days_dayross").closest('tr').addClass("en_quote_settings_all_shipment_days_dayross_tr"); 815 jQuery(".dayross_shipment_day ").closest('tr').addClass("dayross_shipment_day_tr"); 816 jQuery("#en_quote_settings_order_cut_off_time_dayross").closest('tr').addClass("dayross_cutt_off_time_ship_date_offset"); 817 jQuery("#en_quote_settings_shipment_offset_days_dayross").attr('maxlength', '2'); 818 819 const dayross_current_time = en_dayross_admin_script.dayross_order_cut_off_time; 820 if (dayross_current_time == '') { 821 jQuery('#en_quote_settings_order_cut_off_time_dayross').wickedpicker({ 822 now: '', 823 title: 'Cut Off Time', 824 }); 825 } else { 826 jQuery('#en_quote_settings_order_cut_off_time_dayross').wickedpicker({ 827 now: dayross_current_time, 828 title: 'Cut Off Time' 829 }); 830 } 831 832 const show_delivery_estimate = jQuery('input[name=en_quote_settings_delivery_estimate_options_dayross]:checked').val(); 833 if (show_delivery_estimate === 'dont_show_estimates') { 834 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', true); 835 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', true); 836 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "not-allowed"); 837 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "not-allowed"); 838 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', true); 839 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "not-allowed"); 840 } else { 841 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', false); 842 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', false); 843 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", ""); 844 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', false); 845 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", ""); 846 } 847 848 jQuery("input[name=en_quote_settings_delivery_estimate_options_dayross]").change(function () { 849 const show_delivery_estimate = jQuery('input[name=en_quote_settings_delivery_estimate_options_dayross]:checked').val(); 850 851 if (show_delivery_estimate === 'dont_show_estimates') { 852 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', true); 853 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', true); 854 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "not-allowed"); 855 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "not-allowed"); 856 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', true); 857 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "not-allowed"); 858 } else { 859 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', false); 860 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', false); 861 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "auto"); 862 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "auto"); 863 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', false); 864 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "auto"); 865 } 866 }); 867 868 /* 869 * Uncheck Week days Select All Checkbox 870 */ 871 jQuery(".dayross_shipment_day").on('change load', function () { 872 873 const checkboxes = jQuery('.dayross_shipment_day:checked').length; 874 const un_checkboxes = jQuery('.dayross_shipment_day').length; 875 876 if (checkboxes === un_checkboxes) { 877 jQuery('.all_shipment_days_dayross_lfq').prop('checked', true); 878 } else { 879 jQuery('.all_shipment_days_dayross_lfq').prop('checked', false); 880 } 881 }); 882 883 /* 884 * Select All Shipment Week days 885 */ 886 887 const all_int_checkboxes = jQuery('.all_shipment_days_dayross_lfq'); 888 if (all_int_checkboxes.length === all_int_checkboxes.filter(":checked").length) { 889 jQuery('.all_shipment_days_dayross_lfq').prop('checked', true); 890 } 891 892 jQuery(".all_shipment_days_dayross_lfq").change(function () { 893 if (this.checked) { 894 jQuery(".dayross_shipment_day").each(function () { 895 this.checked = true; 896 }); 897 } else { 898 jQuery(".dayross_shipment_day").each(function () { 899 this.checked = false; 900 }); 901 } 902 }); 903 904 const main_td = jQuery('.en_quote_settings_all_shipment_days_dayross_tr td'); 905 const rows = jQuery('tr.dayross_shipment_day_tr'); 906 907 if (!main_td.length || !rows.length) return; 908 909 // Move all day checkboxes into main row 910 rows.each(function () { 911 const input_wrap = jQuery(this).find('td > *').first(); 912 if (input_wrap.length) main_td.append(input_wrap); 913 }); 914 915 // Hide original rows 916 rows.hide(); 917 918 // ---- Select All sync ---- 919 const select_all = main_td.find('input[type="checkbox"]').first(); 920 const days = main_td.find('input[type="checkbox"]').not(select_all); 921 922 // Select all → days 923 select_all.on('change', function () { 924 days.prop('checked', this.checked); 925 }); 926 // Days → select all 927 days.on('change', function () { 928 select_all.prop('checked', days.length === days.filter(':checked').length); 929 }); 930 } 931 } 932 933 if (typeof dayrossValidateFullfillmentOffsetDays !== 'function') { 934 function dayrossValidateFullfillmentOffsetDays() { 935 const offset_days = jQuery("#en_quote_settings_shipment_offset_days_dayross").val(); 936 const number_regex = /^[0-9]+$/; 937 let error_msg = ''; 938 939 if (offset_days != "" && offset_days < 1) error_msg = 'Fulfillment Offset Days must be greater than or equal to 1.'; 940 if (!error_msg && offset_days != "" && offset_days > 20) error_msg = 'Fulfillment Offset Days must be less than or equal to 20.'; 941 if (!error_msg && offset_days != "" && !number_regex.test(offset_days)) error_msg = 'Fulfillment Offset Days must be a number.'; 942 943 if (error_msg) { 944 jQuery('.en_dayross_ltl_plan_notice').after('<div class="notice notice-error en_settings_message"><p><strong>Error! </strong>' + error_msg + '</p></div>'); 945 jQuery('#en_settings_message').delay(200).animate({scrollTop: 0}, 1000); 946 jQuery('html, body').animate({scrollTop: 0}, 'slow'); 947 return false; 948 } 949 950 return true; 951 } 952 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/product/en-product-detail.php
r3284707 r3494315 81 81 $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : ''; 82 82 $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field($_POST[$custom_field][$postId]) : ''; 83 $en_updated_product = $custom_field == '_dropship_location' ? 84 (maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product)) : esc_attr($en_updated_product); 83 84 if ($custom_field == '_dropship_location') { 85 $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product); 86 } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') { 87 $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product); 88 } else { 89 $en_updated_product = esc_attr($en_updated_product); 90 } 91 85 92 update_post_meta($postId, $custom_field, $en_updated_product); 86 93 } 87 94 } 95 } 96 97 private function sanitize_fulfillment_offset_days($value) 98 { 99 $value = trim($value); 100 if ($value === '' || $value === null) return ''; 101 102 $value = preg_replace('/[^0-9.-]/', '', $value); 103 if (!is_numeric($value)) return ''; 104 105 $value = intval(floor(floatval($value))); 106 return $value < 0 ? '' : strval($value); 88 107 } 89 108 … … 181 200 '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% will cause 5 percent of the item's price to be added to the shipping quotes." 182 201 ], 202 [ 203 'type' => 'input_field', 204 'input_type' => 'number', 205 'id' => '_eniture_product_level_fulfillment_offset_days', 206 'class' => '_eniture_product_level_fulfillment_offset_days short', 207 'label' => __( 'Fulfillment Offset Days', 'woocommerce' ), 208 'placeholder' => 'Fulfillment offset days, e.g. 2', 209 'description' => "The number of days the ship date needs to be moved to allow for the processing of the order. If set, this will override the global Fulfillment Offset Days setting for this product.", 210 'custom_attributes' => [ 211 'min' => '1', 212 'max' => '20', 213 'step' => '1', 214 'title' => 'Value must be greater than or equal to 1 and less than or equal to 20', 215 'oninvalid' => "this.setCustomValidity(this.validity.rangeUnderflow ? 'Value must be greater than or equal to 1' : this.validity.rangeOverflow ? 'Value must be less than or equal to 20' : '')", 216 'oninput' => "this.setCustomValidity('')" 217 ] 218 ], 183 219 ]; 184 220 // Micro Warehouse … … 273 309 'label' => $custom_field['label'], 274 310 'class' => $custom_field['class'], 275 'placeholder' => $custom_field['label'],311 'placeholder' => isset($custom_field['placeholder']) ? $custom_field['placeholder'] : $custom_field['label'], 276 312 'value' => get_post_meta($postId, $custom_field['id'], true) 277 313 ]; … … 281 317 $custom_input_field['description'] = $custom_field['description']; 282 318 } 319 320 // Add input type if specified (e.g., 'number') 321 if (isset($custom_field['input_type'])) { 322 $custom_input_field['type'] = $custom_field['input_type']; 323 } 324 325 // Add custom attributes if specified (e.g., min, max, step) 326 if (isset($custom_field['custom_attributes'])) { 327 $custom_input_field['custom_attributes'] = $custom_field['custom_attributes']; 328 } 329 283 330 echo '<div>'; 284 331 woocommerce_wp_text_input($custom_input_field); -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/en-tab.php
r3428882 r3494315 157 157 $settings = $this->get_settings($current_section); 158 158 159 // Cuttoff Time 160 if (isset($_POST['en_quote_settings_order_cut_off_time_dayross']) && $_POST['en_quote_settings_order_cut_off_time_dayross'] != '') { 161 $time_24_format = $this->get_time_in_24_hours($_POST['en_quote_settings_order_cut_off_time_dayross']); 162 $_POST['en_quote_settings_order_cut_off_time_dayross'] = $time_24_format; 163 } 164 159 165 // backup rates 160 166 $backup_rates_fields = ['dayross_backup_rates_fixed_rate', 'dayross_backup_rates_cart_price_percentage', 'dayross_backup_rates_weight_function']; … … 165 171 WC_Admin_Settings::save_fields($settings); 166 172 } 173 174 /** 175 * Cuttoff Time 176 * @param $timeStr 177 * @return false|string 178 */ 179 public function get_time_in_24_hours($timeStr) 180 { 181 $cutOffTime = explode(' ', $timeStr); 182 $hours = $cutOffTime[0]; 183 $separator = $cutOffTime[1]; 184 $minutes = $cutOffTime[2]; 185 $meridiem = $cutOffTime[3]; 186 $cutOffTime = "{$hours}{$separator}{$minutes} $meridiem"; 187 188 return date("H:i", strtotime($cutOffTime)); 189 } 167 190 } 168 191 169 192 $en_tab = new EnDayrossTab(); 170 return $en_tab->en_load(); 193 $en_tab->en_load(); 194 return $en_tab; 171 195 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/assets/css/en-dayross-location.css
r3428882 r3494315 119 119 color: #ff0000; 120 120 font-size: 11px; 121 margin: 0 0 0 40.2%; 122 width: 100%; 121 width: 58.7%; 123 122 display: block; 124 } 125 126 .en_location_error_message { 123 float: right; 124 } 125 126 .en_location_error_message, 127 .en_dayross_warehouse_error_message, .en_dayross_dropship_error_message { 127 128 background: #f1f1f1 none repeat scroll 0 0; 128 129 border-left: 4px solid #dc3232; … … 134 135 } 135 136 136 .en_location_success_message { 137 .en_location_success_message, 138 .en_dayross_wh_location_success_message, .en_dayross_ds_location_success_message, 139 .en_dayross_warehouse_success_message, .en_dayross_dropship_success_message { 137 140 background: #fff none repeat scroll 0 0; 138 141 border-left: 4px solid #46b450; … … 144 147 } 145 148 149 .en_dayross_warehouse_success_message, .en_dayross_dropship_success_message { 150 margin: auto; 151 } 152 146 153 .spinner_disable { 147 154 color: #000000; … … 162 169 background: #fff none repeat scroll 0 0; 163 170 border-bottom: 1px solid #e1e1e1; 164 color: #0073aa ;171 color: #0073aa !important; 165 172 font-size: 14px; 166 173 font-weight: 400; -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/assets/js/en-dayross-location.js
r3428882 r3494315 169 169 } else if (en_is_var_exist('severity', data) && data['severity'] == 'error') { 170 170 jQuery('.en_popup_location_form').delay(200).animate({scrollTop: 0}, 300); 171 const location_type = data['location'] == 'warehouse' ? 'wh' : 'ds'; 172 jQuery(`.en_dayross_${location_type}_location_error_message span`).text(data['message']); 173 en_show_errors(`.en_dayross_${location_type}_location_error_message`); 171 174 jQuery('.en_location_error_message span').text(data['message']); 172 en_show_errors('.en_location_error_message');173 175 } 174 176 … … 377 379 function en_dayross_location_delete(e, data, en_location_type, en_location_id) { 378 380 e.preventDefault(); 381 382 // If warehouse location then directly delete 383 if (en_location_type) { 384 en_dayross_location_confirm_delete(data, en_location_type, en_location_id); 385 return; 386 } 387 379 388 en_popup_confirmation_location_delete_show(); 380 389 jQuery('.en_close_popup_location').on('click', function () { … … 423 432 if (data['message'].length > 0) { 424 433 jQuery('.en_popup_location_form').delay(200).animate({scrollTop: 0}, 300); 425 jQuery('.en_location_success_message span').text(data['message']); 426 en_show_errors('.en_location_success_message'); 434 const location_type = data['location'] == 'warehouse' ? 'wh' : 'ds'; 435 jQuery(`.en_dayross_${location_type}_location_success_message span`).text(data['message']); 436 en_show_errors(`.en_dayross_${location_type}_location_success_message`); 427 437 } 428 438 } … … 464 474 } 465 475 } 476 477 if (typeof en_dayross_select_bulk_locations != 'function') { 478 function en_dayross_select_bulk_locations(location_class, e) { 479 const checked = jQuery(e).is(':checked'); 480 jQuery(`.${location_class}`).prop('checked', checked); 481 } 482 } 483 484 if (typeof en_dayross_toggle_select_all_locations != 'function') { 485 function en_dayross_toggle_select_all_locations(location_class, select_all_locations) { 486 const allChecked = jQuery(`.${location_class}:checked`).length === jQuery(`.${location_class}`).length; 487 jQuery(`#${select_all_locations}`).prop('checked', allChecked); 488 } 489 } 490 491 if (typeof en_dayross_delete_bulk_locations != 'function') { 492 function en_dayross_delete_bulk_locations(e, location_class, location_type) { 493 e.preventDefault(); 494 const location_ids = jQuery(`.${location_class}:checked`).map(function () { 495 return this.value; 496 }).get(); 497 498 // Show error message if no locations are selected 499 if (location_ids.length === 0) { 500 const loc_error_class = `en_dayross_${location_type}_error_message`; 501 jQuery(`.${loc_error_class}`).show('slow').delay(3000).hide('slow'); 502 return; 503 } 504 505 const postForm = { 506 'action': 'en_dayross_wd_bulk_delete_locations', 507 'location_ids': location_ids, 508 'location_type': location_type, 509 'wp_nonce': en_dayross_location_script.nonce 510 } 511 const delete_locs_btn = `.en_dayross_bulk_delete_${location_type}`, 512 loc_success_class = `.en_dayross_${location_type}_success_message`, 513 loc_error_class = `.en_dayross_${location_type}_error_message`; 514 515 jQuery.ajax({ 516 type: 'POST', 517 url: ajaxurl, 518 data: postForm, 519 dataType: 'json', 520 beforeSend: function () { 521 jQuery(delete_locs_btn).addClass('spinner_disable'); 522 }, 523 success: function (data) { 524 if (data.error && data.message) { 525 jQuery(delete_locs_btn).removeClass('spinner_disable'); 526 jQuery(loc_error_class).show('slow').delay(3000).hide('slow'); 527 } else { 528 jQuery(delete_locs_btn).removeClass('spinner_disable'); 529 jQuery(data.target_location).replaceWith(data.html); 530 jQuery(loc_success_class).show('slow').delay(3000).hide('slow'); 531 jQuery('.warehouse_updated, .warehouse_created, .warehouse_deleted, .dropship_deleted, .dropship_updated, .dropship_created').css('display', 'none'); 532 } 533 }, 534 error: function (error) { 535 jQuery(delete_locs_btn).removeClass('spinner_disable'); 536 console.log(error); 537 } 538 }); 539 } 540 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/dropship/en-dropship.php
r3351760 r3494315 41 41 42 42 <h1><?php _e('Drop ships', 'eniture-technology'); ?></h1> 43 <button type="button" onclick="en_show_popup_location(false, event)" type="button" 44 class="button-primary"><?php _e('Add', 'eniture-technology'); ?></button> 45 <p><?php _e('Locations that inventory specific items that are drop shipped to the destination. Use the products settings 43 <div style="display: flex; gap: 3px; align-items: center; margin-top: 20px;"> 44 <button type="button" onclick="en_show_popup_location(false, event)" type="button" 45 class="button-primary"><?php _e('Add', 'eniture-technology'); ?></button> 46 <button type="button" class="en_dayross_bulk_delete_dropship en_wd_add_dropship_btn button-primary" title="Delete Drop Ships" onclick="return en_dayross_delete_bulk_locations(event, 'en_dayross_delete_dropship_item', 'dropship');"><?php _e('Delete', 'eniture-technology'); ?></button> 47 </div> 48 49 <p><?php _e("Locations that inventory specific items that are drop shipped to the destination. Use the product's settings 46 50 page to identify it as a drop shipped item and its associated drop ship location. Orders that include drop 47 51 shipped items will display a single figure for the shipping rate estimate that is equal to the sum of the 48 cheapest option of each shipment required to fulfill the order.', 'eniture-technology'); ?></p> 52 cheapest option of each shipment required to fulfill the order.", 'eniture-technology'); ?></p> 53 54 <div class="en_dayross_ds_location_success_message"><strong>Success! </strong><span></span></div> 55 <div class="en_dayross_dropship_success_message"><strong>Success!</strong> <span>Selected drop ships deleted successfully.</span></div> 56 <div class="en_dayross_dropship_error_message"><strong>Error!</strong> Please select at least one drop ship to delete.</div> 49 57 50 58 <table class="en_location_table en_location_dropship_table"> 51 59 <thead> 52 60 <tr> 61 <th class="en_wd_dropship_list_heading en_dayross_bulk_delete_col"> 62 <!-- Bulk delete --> 63 <input type="checkbox" name="en_dayross_bulk_delete_dropships" id="en_dayross_bulk_delete_dropships" onclick="return en_dayross_select_bulk_locations('en_dayross_delete_dropship_item', this);" /> 64 </th> 53 65 <?php echo force_balance_tags(\EnLocation::en_arrange_table_data('th', $en_heading)); ?> 54 66 <th><?php _e('Action', 'eniture-technology'); ?></th> -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/en-location.php
r3428882 r3494315 278 278 279 279 echo '<tr class="' . esc_attr($append_class) . '" id="en_location_row_id_' . esc_attr($en_location_id) . '">'; 280 281 $_type = ($loc_type === 'wh') ? 'warehouse' : 'dropship'; 282 echo '<td class="en_wd_' . esc_attr($_type) . '_list_data en_dayross_bulk_delete_col"> 283 <input 284 type="checkbox" 285 class="en_dayross_delete_' . esc_attr($_type) . '_item" 286 value="' . esc_attr($en_location_id) . '" 287 onclick="return en_dayross_toggle_select_all_locations( 288 \'en_dayross_delete_' . esc_attr($_type) . '_item\', 289 \'en_dayross_bulk_delete_' . esc_attr($_type) . 's\' 290 );" 291 > 292 </td>'; 280 293 echo self::en_arrange_table_data('td', $en_sorted_location); 281 294 … … 309 322 <?php _e('Warning!', 'eniture-technology'); ?> 310 323 </h2> 324 <hr> 311 325 <p class="en_confirmation_message"> 312 <?php _e('If you delete this location, then location settings will be disabled against products 313 (if any).', 'eniture-technology'); ?> 326 Warning! If you delete this location, Drop ship location settings will be disabled against products if any. 314 327 </p> 328 <hr> 315 329 <div class="en_confirmation_buttons"> 316 330 <a href="#" -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/includes/en-location-ajax.php
r3428882 r3494315 18 18 add_action('wp_ajax_en_dayross_get_location', [$this, 'en_dayross_get_location']); 19 19 add_action('wp_ajax_en_dayross_location_delete_row', [$this, 'en_dayross_location_delete_row']); 20 21 add_action('wp_ajax_nopriv_en_dayross_wd_bulk_delete_locations', array($this, 'en_dayross_bulk_delete_locations_ajax')); 22 add_action('wp_ajax_en_dayross_wd_bulk_delete_locations', array($this, 'en_dayross_bulk_delete_locations_ajax')); 20 23 } 21 24 … … 199 202 200 203 if ($location === 'warehouse') { 201 $location_step = ' Warehouse';204 $location_step = 'New warehouse'; 202 205 $en_location_template_obj = new EnDayrossWarehouseTemplate(); 203 206 $en_target_location = '.en_location_warehouse_main_div'; 204 207 $validate = ['zip', 'city', 'state', 'country', 'location']; 205 208 } else { 206 $location_step = ' Dropship';209 $location_step = 'New drop ship'; 207 210 $en_location_template_obj = new EnDayrossDropshipTemplate(); 208 211 $en_target_location = '.en_location_dropship_main_div'; … … 222 225 (!empty($en_location_data) && 223 226 reset($en_location_data)['id'] === $location_id))) { 227 $location_step = $location === 'warehouse' ? 'Warehouse' : 'Drop ship'; 224 228 $message = $location_step . ' updated successfully.'; 225 229 $action = 'update'; … … 250 254 } 251 255 256 public function en_dayross_bulk_delete_locations_ajax() 257 { 258 if (!(current_user_can('manage_options') || current_user_can('manage_woocommerce')) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wp_nonce'])), 'en_dayross_location_nonce')) { 259 echo wp_json_encode(array('error' => true, 'message' => 'Unauthorized Access.')); 260 exit; 261 } 262 263 $location_ids = isset($_POST['location_ids']) ? $_POST['location_ids'] : array(); 264 $loc_type = isset($_POST['location_type']) ? $_POST['location_type'] : ''; 265 if (empty($location_ids)) { 266 echo wp_json_encode(['error' => true, 'message' => "Please select at least one {$loc_type} to delete."]); 267 exit; 268 } 269 270 global $wpdb; 271 foreach ($location_ids as $location_id) { 272 if ($loc_type == 'dropship') { 273 $get_dropship_id = ''; 274 $dropship_id = intval($location_id); 275 $get_dropship_array = array($dropship_id); 276 $ser = maybe_serialize($get_dropship_id); 277 $get_dropship_val = array_map('intval', $get_dropship_array); 278 $get_post_id = $wpdb->get_results("SELECT group_concat(post_id) as post_ids_list FROM `" . $wpdb->prefix . "postmeta` WHERE `meta_key` = '_dropship_location' AND (`meta_value` LIKE '%" . $ser . "%' OR `meta_value` = '" . $dropship_id . "')"); 279 $post_id = reset($get_post_id)->post_ids_list; 280 281 if (isset($post_id)) { 282 $wpdb->query("UPDATE `" . $wpdb->prefix . "postmeta` SET `meta_value` = '' WHERE `meta_key` IN('_enable_dropship','_dropship_location') AND `post_id` IN ($post_id)"); 283 } 284 } 285 286 $wpdb->delete($wpdb->prefix . "warehouse", array('id' => intval($location_id), 'location' => $loc_type)); 287 } 288 289 if ($loc_type === 'warehouse') { 290 $en_location_template_obj = new EnDayrossWarehouseTemplate(); 291 $en_target_location = '.en_location_warehouse_main_div'; 292 } else { 293 $en_location_template_obj = new EnDayrossDropshipTemplate(); 294 $en_target_location = '.en_location_dropship_main_div'; 295 } 296 297 $html = $en_location_template_obj::en_load(); 298 299 echo wp_json_encode(['error' => false, 'message' => 'Locations deleted successfully.', 'target_location' => $en_target_location, 'html' => $html]); 300 exit; 301 } 302 252 303 } 253 304 -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/location/warehouse/en-warehouse.php
r3351760 r3494315 36 36 <div class="en_location_warehouse_main_div"> 37 37 38 <div class="en_location_success_message"> 39 <strong><?php _e('Success!', 'eniture-technology'); ?></strong> <span></span></div> 38 <h1><?php _e('Warehouses', 'eniture-technology'); ?></h1> 39 <div style="display: flex; gap: 3px; align-items: center; margin-top: 20px;"> 40 <button title="Add Warehouse" type="button" onclick="en_show_popup_location(true, event)" type="button" 41 class="button-primary <?php echo esc_attr(self::$disabled_plan); ?>"><?php _e('Add', 'eniture-technology'); ?> 42 </button> 43 <button type="button" class="en_dayross_bulk_delete_warehouse en_wd_add_warehouse_btn button-primary" title="Delete Warehouses" onclick="return en_dayross_delete_bulk_locations(event, 'en_dayross_delete_warehouse_item', 'warehouse');"><?php _e('Delete', 'eniture-technology'); ?> 44 </button> 40 45 41 <h1><?php _e('Warehouses', 'eniture-technology'); ?></h1> 42 <button type="button" onclick="en_show_popup_location(true, event)" type="button" 43 class="button-primary <?php echo esc_attr(self::$disabled_plan); ?>"><?php _e('Add', 'eniture-technology'); ?> 44 </button> 45 <?php echo force_balance_tags(self::$plan_required); ?> 46 <?php echo force_balance_tags(self::$plan_required); ?> 47 </div> 46 48 47 49 <p><?php _e('Warehouses that inventory all products not otherwise identified as drop shipped items. The warehouse with the 48 50 lowest shipping cost to the destination is used for quoting purposes.', 'eniture-technology'); ?></p> 51 52 <div class="en_dayross_wh_location_success_message"><strong>Success! </strong><span></span></div> 53 <div class="en_dayross_warehouse_success_message"><strong>Success! </strong> <span>Selected warehouses deleted successfully.</span></div> 54 <div class="en_dayross_warehouse_error_message"><strong>Error!</strong> <span>Please select at least one warehouse to delete.</span></div> 49 55 50 56 <table class="en_location_table en_location_warehouse_table"> 51 57 <thead> 52 58 <tr> 59 <th class="en_wd_warehouse_list_heading en_dayross_bulk_delete_col"> 60 <!-- Bulk delete --> 61 <input type="checkbox" name="en_dayross_bulk_delete_warehouses" id="en_dayross_bulk_delete_warehouses" onclick="return en_dayross_select_bulk_locations('en_dayross_delete_warehouse_item', this);" /> 62 </th> 53 63 <?php echo force_balance_tags(\EnLocation::en_arrange_table_data('th', $en_heading)); ?> 54 64 <th><?php _e('Action', 'eniture-technology'); ?></th> -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/logs/en-logs.php
r3462301 r3494315 48 48 49 49 $url = EN_DAYROSS_ROOT_URL_QUOTES . '/request-log/index.php'; 50 $logs = $obj_classs->en_dayross_sent_http_request($url, $data, 'POST' );50 $logs = $obj_classs->en_dayross_sent_http_request($url, $data, 'POST', 'Logs'); 51 51 $logs = (isset($logs) && is_string($logs) && strlen($logs) > 0) ? json_decode($logs, true) : []; 52 52 -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/admin/tab/quote-settings/en-quote-settings.php
r3428882 r3494315 26 26 } 27 27 28 if (get_option('en_quote_settings_show_delivery_estimate_dayross') == 'yes') { 29 update_option('en_quote_settings_delivery_estimate_options_dayross', 'delivery_date'); 30 delete_option('en_quote_settings_show_delivery_estimate_dayross'); 31 } 32 33 // Cuttoff Time 34 $dayross_disable_cutt_off_time_ship_date_offset = ""; 35 $dayross_cutt_off_time_package_required = ""; 36 37 // Check the cutt of time & offset days plans for disable input fields 38 $dayross_action_cutOffTime_shipDateOffset = apply_filters('dayross_plans_suscription_and_features', 'order_cutt_off_time'); 39 if (is_array($dayross_action_cutOffTime_shipDateOffset) && false) { 40 $dayross_disable_cutt_off_time_ship_date_offset = "disabled_me"; 41 $dayross_cutt_off_time_package_required = apply_filters('dayross_plans_notification_link', $dayross_action_cutOffTime_shipDateOffset); 42 } 43 28 44 $ltl_enable = get_option('en_plugins_return_LTL_quotes'); 29 45 $weight_threshold_class = $ltl_enable == 'yes' ? 'show_en_weight_threshold_lfq' : 'hide_en_weight_threshold_lfq'; … … 57 73 * ================================================================== 58 74 */ 59 'en_quote_settings_show_delivery_estimate_dayross' => [ 60 'name' => __('Show Delivery Estimate ', 'woocommerce-settings-dayross'), 61 'type' => 'checkbox', 62 'id' => 'en_quote_settings_show_delivery_estimate_dayross' 63 ], 75 76 //** Start Delivery Estimate Options - Cuttoff Time 77 'delivery_estimate_options_dayross' => array( 78 'name' => __('Delivery Estimate Options ', 'woocommerce-settings-dayross'), 79 'type' => 'text', 80 'class' => 'hidden', 81 'id' => 'delivery_estimate_options_dayross' 82 ), 83 'en_quote_settings_delivery_estimate_options_dayross' => array( 84 'name' => '', 85 'type' => 'radio', 86 'default' => 'dont_show_estimates', 87 'options' => array( 88 'dont_show_estimates' => __("Don't display delivery estimates.", 'woocommerce-settings-dayross'), 89 'delivery_days' => __("Display estimated number of days until delivery.", 'woocommerce-settings-dayross'), 90 'delivery_date' => __("Display estimated delivery date.", 'woocommerce-settings-dayross'), 91 ), 92 'id' => 'en_quote_settings_delivery_estimate_options_dayross', 93 'class' => 'dayross_lfq_dont_show_estimate_option', 94 ), 95 //** End Delivery Estimate Options 96 97 //**Start: Cut Off Time & Ship Date Offset 98 'en_quote_settings_cutt_off_time_ship_date_offset_dayross' => array( 99 'name' => __('Cut Off Time & Ship Date Offset ', 'woocommerce-settings-dayross'), 100 'type' => 'text', 101 'class' => 'hidden', 102 'desc' => $dayross_cutt_off_time_package_required, 103 'id' => 'en_quote_settings_cutt_off_time_ship_date_offset_dayross' 104 ), 105 'en_quote_settings_order_cut_off_time_dayross' => array( 106 'name' => __('Order Cut Off Time ', 'woocommerce-settings-dayross'), 107 'type' => 'text', 108 'placeholder' => '-- : -- --', 109 '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.', 110 'id' => 'en_quote_settings_order_cut_off_time_dayross', 111 'class' => $dayross_disable_cutt_off_time_ship_date_offset, 112 ), 113 'en_quote_settings_shipment_offset_days_dayross' => array( 114 'name' => __('Fulfillment Offset Days ', 'woocommerce-settings-dayross'), 115 'type' => 'text', 116 'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.', 117 'placeholder' => 'Fulfillment Offset Days, e.g. 2', 118 'id' => 'en_quote_settings_shipment_offset_days_dayross', 119 'class' => $dayross_disable_cutt_off_time_ship_date_offset, 120 ), 121 'en_quote_settings_all_shipment_days_dayross' => array( 122 'name' => __("What days do you ship orders?", 'woocommerce-settings-dayross'), 123 'type' => 'checkbox', 124 'desc' => 'Select All', 125 'class' => "all_shipment_days_dayross_lfq $dayross_disable_cutt_off_time_ship_date_offset", 126 'id' => 'en_quote_settings_all_shipment_days_dayross' 127 ), 128 'en_quote_settings_monday_shipment_day_dayross' => array( 129 'name' => __("", 'woocommerce-settings-dayross'), 130 'type' => 'checkbox', 131 'desc' => 'Monday', 132 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 133 'id' => 'en_quote_settings_monday_shipment_day_dayross' 134 ), 135 'en_quote_settings_tuesday_shipment_day_dayross' => array( 136 'name' => __("", 'woocommerce-settings-dayross'), 137 'type' => 'checkbox', 138 'desc' => 'Tuesday', 139 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 140 'id' => 'en_quote_settings_tuesday_shipment_day_dayross' 141 ), 142 'en_quote_settings_wednesday_shipment_day_dayross' => array( 143 'name' => __("", 'woocommerce-settings-dayross'), 144 'type' => 'checkbox', 145 'desc' => 'Wednesday', 146 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 147 'id' => 'en_quote_settings_wednesday_shipment_day_dayross' 148 ), 149 'en_quote_settings_thursday_shipment_day_dayross' => array( 150 'name' => __("", 'woocommerce-settings-dayross'), 151 'type' => 'checkbox', 152 'desc' => 'Thursday', 153 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 154 'id' => 'en_quote_settings_thursday_shipment_day_dayross' 155 ), 156 'en_quote_settings_friday_shipment_day_dayross' => array( 157 'name' => __("", 'woocommerce-settings-dayross'), 158 'type' => 'checkbox', 159 'desc' => 'Friday', 160 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 161 'id' => 'en_quote_settings_friday_shipment_day_dayross' 162 ), 163 'en_quote_settings_show_delivery_estimate_dayross' => array( 164 'title' => __('', 'woocommerce'), 165 'name' => __('', 'woocommerce-settings-dayross'), 166 'desc' => '', 167 'id' => 'dayross_lfq_show_delivery_estimates', 168 'css' => '', 169 'default' => '', 170 'type' => 'title', 171 ), 172 //**End: Cut Off Time & Ship Date Offset 173 64 174 'residential_delivery_options_label' => [ 65 175 'name' => __('Residential Delivery', 'woocommerce-settings-dayross'), -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/common/en-plans.php
r3304907 r3494315 48 48 $plugin_info = get_plugins(); 49 49 $plugin_version = (isset($plugin_info[$index]['Version'])) ? $plugin_info[$index]['Version'] : 0; 50 $plugin_dir_url = EN_DAYROSS_DIR_FILE . 'en-hit-to-update-plan.php';50 51 51 $post_data = array( 52 52 'platform' => 'wordpress', 53 53 'carrier' => '79', 54 54 'store_url' => EN_DAYROSS_SERVER_NAME, 55 'webhook_url' => $plugin_dir_url,55 'webhook_url' => '', 56 56 'plugin_version' => $plugin_version, 57 57 'license_key' => get_option('en_connection_settings_license_key_dayross'), … … 82 82 $plugin_info = get_plugins(); 83 83 $plugin_version = (isset($plugin_info[$index]['Version'])) ? $plugin_info[$index]['Version'] : 0; 84 $plugin_dir_url = EN_DAYROSS_DIR_FILE . 'en-hit-to-update-plan.php';84 85 85 $post_data = array( 86 86 'platform' => 'wordpress', 87 87 'carrier' => '79', 88 88 'store_url' => EN_DAYROSS_SERVER_NAME, 89 'webhook_url' => $plugin_dir_url,89 'webhook_url' => '', 90 90 'plugin_version' => $plugin_version, 91 91 'license_key' => get_option('en_connection_settings_license_key_dayross'), … … 152 152 'multi_warehouse' => ['2', '3'], 153 153 'nested_material' => ['3'], 154 'multi_dropships' => ['0', '1', '2', '3'] 154 'multi_dropships' => ['0', '1', '2', '3'], 155 'order_cutt_off_time' => ['2', '3'] 155 156 ]; 156 157 -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/en-install.php
r3490815 r3494315 67 67 'dayross_backup_rates_cart_price_percentage' => get_option("dayross_backup_rates_cart_price_percentage"), 68 68 'dayross_backup_rates_weight_function' => get_option("dayross_backup_rates_weight_function"), 69 // Cuttoff Time 70 'dayross_order_cut_off_time' => get_option("en_quote_settings_order_cut_off_time_dayross"), 69 71 ]); 70 72 71 wp_enqueue_script('EnDayrossLocationScript', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/js/en-dayross-location.js', [], '1.0. 6');73 wp_enqueue_script('EnDayrossLocationScript', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/js/en-dayross-location.js', [], '1.0.7'); 72 74 wp_localize_script('EnDayrossLocationScript', 'en_dayross_location_script', array( 73 75 'pluginsUrl' => EN_DAYROSS_PLUGIN_URL, … … 80 82 )); 81 83 82 wp_register_style('EnDayrossLocationStyle', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/css/en-dayross-location.css', false, '1.0. 3');84 wp_register_style('EnDayrossLocationStyle', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/css/en-dayross-location.css', false, '1.0.4'); 83 85 wp_enqueue_style('EnDayrossLocationStyle'); 84 86 … … 88 90 wp_register_style('EnDayrossProductCss', EN_DAYROSS_DIR_FILE . '/admin/product/assets/en-custom-fields-style.css', false, '1.0.2'); 89 91 wp_enqueue_style('EnDayrossProductCss'); 92 93 // Cuttoff Time 94 wp_register_style('EnDayrossWickedPickerStyle', EN_DAYROSS_DIR_FILE . '/admin/assets/wickedpicker.min.css', false, '1.0.0'); 95 wp_register_script('EnDayrossWickedPickerScript', EN_DAYROSS_DIR_FILE . '/admin/assets/wickedpicker.js', false, '1.0.0'); 96 97 wp_enqueue_style('EnDayrossWickedPickerStyle'); 98 wp_enqueue_script('EnDayrossWickedPickerScript'); 90 99 } 91 100 … … 118 127 function en_dayross_shipping_sections($settings) 119 128 { 120 $settings[] = include('admin/tab/en-tab.php'); 129 $en_tab = include('admin/tab/en-tab.php'); 130 if (is_object($en_tab)) { 131 $settings[] = $en_tab; 132 } 133 121 134 return $settings; 122 135 } -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/http/en-curl.php
r3428882 r3494315 25 25 static public function en_dayross_sent_http_request($url, $post_data, $method, $step_for = '') { 26 26 $curl_response = ''; 27 $en_time_start = 0; 28 27 29 if (strlen($url) > 0 && is_array($post_data) && !empty($post_data)) { 28 30 29 31 $post_data = self::remove_extra_request_data($post_data); 32 $cachable_data = self::create_cachable_data($post_data); 33 $cache_key = self::create_cache_key($cachable_data); 34 $cache_response = get_transient($cache_key); 35 $skip_cache = in_array($step_for, ['Plan', 'Logs', 'Address', 'Connection']); 30 36 31 // Eniture Execution Time 32 $en_time_start = microtime(true); 37 if ($skip_cache || false === $cache_response) { 38 // Eniture Execution Time 39 $en_time_start = microtime(true); 33 40 34 // Eniture Debug Mood35 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Request ", $post_data);41 // Eniture Debug Mood 42 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Request ", $post_data); 36 43 37 $method == 'POST' ? $post_data = http_build_query($post_data) : '';44 $method == 'POST' ? $post_data = http_build_query($post_data) : ''; 38 45 39 // Eniture Debug Mood40 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Build Query ", $post_data);46 // Eniture Debug Mood 47 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Build Query ", $post_data); 41 48 42 $response = wp_remote_post($url, [ 43 'method' => $method, 44 'timeout' => 60, 45 'redirection' => 5, 46 'blocking' => true, 47 'body' => $post_data, 48 ] 49 ); 50 $curl_response = wp_remote_retrieve_body($response); 51 $headers = wp_remote_retrieve_headers($response); 52 self::eniture_check_rate_limit_headers($headers); 49 $response = wp_remote_post($url, [ 50 'method' => $method, 51 'timeout' => 60, 52 'redirection' => 5, 53 'blocking' => true, 54 'body' => $post_data, 55 ] 56 ); 57 $headers = wp_remote_retrieve_headers($response); 58 self::eniture_check_rate_limit_headers($headers); 59 $curl_response = wp_remote_retrieve_body($response); 60 $resp = !empty($curl_response) && is_string($curl_response) ? json_decode($curl_response, true) : $curl_response; 61 62 if (!empty($resp) && (!isset($resp['severity']) || (isset($resp['severity']) && $resp['severity'] != 'ERROR'))) { 63 set_transient($cache_key, $curl_response, 12 * HOUR_IN_SECONDS); 64 } 65 66 // Eniture Debug Mood 67 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Response ", json_decode($curl_response)); 68 } else { 69 $curl_response = $cache_response; 70 71 // Eniture Debug Mood 72 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Cache Response ", $curl_response); 73 } 53 74 } 54 55 // Eniture Debug Mood56 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Response ", json_decode($curl_response));57 75 58 76 // Eniture Execution Time … … 98 116 } 99 117 118 static public function create_cachable_data($request_data) 119 { 120 $cache_keys = ['serverName', 'platform', 'carrierType', 'carrierName', 'carrierMode', 'requestVersion', 'clientId', 'clientSecret', 'requestForNewAPI', 'emailAddress', 'password', 'billToAccountNumber', 'licenseKey', 'dimWeightBaseAccount', 'shipment_type', 'LTL_FREIGHT', 'product_name', 'shipment_weight', 'commdityDetails', 'originAddress', 'receiverZip', 'receiverState', 'receiverCountryCode', 'receiverCity', 'addressLine', 'instorPickupLocalDelEnable', 'doNesting', 'modifyShipmentDateTime', 'OrderCutoffTime', 'shipmentOffsetDays', 'shipmentWeekDays', 'liftGateAsAnOption', 'accessorials', 'handlingUnitWeight', 'maxWeightPerHandlingUnit']; 121 $cachable_data = []; 122 123 // get the data from the request 124 foreach ($cache_keys as $key) { 125 if (isset($request_data[$key])) $cachable_data[$key] = $request_data[$key]; 126 } 127 128 if (isset($request_data['autoResidentials']) && $request_data['autoResidentials'] == 1) { 129 $cachable_data['autoResidentials'] = $request_data['autoResidentials']; 130 $cachable_data['addressLine'] = $request_data['addressLine']; 131 $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : ''; 132 $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType']; 133 $cachable_data['defaultRADWithoutStreetAddress'] = $request_data['defaultRADWithoutStreetAddress']; 134 $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation']; 135 } 136 137 if (isset($request_data['standardPackaging']) && $request_data['standardPackaging'] == 1) { 138 $cachable_data['standardPackaging'] = $request_data['standardPackaging']; 139 $cachable_data['pallet'] = $request_data['pallet']; 140 } 141 142 return $cachable_data; 143 } 144 145 static public function create_cache_key($request_data) 146 { 147 $request_build_query = http_build_query($request_data); 148 return md5('eniture_dayross_' . $request_build_query); 149 } 100 150 } 101 151 -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/ltl-freight-quotes-dayross-edition.php
r3490815 r3494315 4 4 * Plugin URI: https://eniture.com/products/ 5 5 * Description: Dynamically retrieves your negotiated shipping rates from Day & Ross and displays the results in the WooCommerce shopping cart. 6 * Version: 2.2. 46 * Version: 2.2.5 7 7 * Author: Eniture Technology 8 8 * Author URI: http://eniture.com/ -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/readme.txt
r3490815 r3494315 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 2.2. 46 Stable tag: 2.2.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 149 149 == Changelog == 150 150 151 = 2.2.5 - 2026-03-30 = 152 * Update: Added cache support to handle duplicate simultaneous quote requests efficiently. 153 * Update: Added delivery estimate options and order cutoff time functionality to the quote settings. 154 * Update: Added bulk delete support for warehouse and drop ship locations. 155 * Update: Added product-level offset days functionality. 156 * Fix: Resolved Broken Access Control vulnerability to improve overall plugin security. 157 151 158 = 2.2.4 - 2026-03-25 = 152 159 * Update: Updated labels text in the connection settings for improved clarity and consistency. -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/server/api/en-response.php
r3462301 r3494315 318 318 } 319 319 320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $ enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = '';320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $delivery_estimate_option = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 321 321 $overlength_fees = []; 322 322 self::$en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); … … 374 374 $label = isset($is_valid_label) && $is_valid_label ? $en_settings_label : 'Freight'; 375 375 $calculated_transit_date = self::en_sanitize_rate('deliveryTimestamp', ''); 376 $calculated_transit_days = self::en_sanitize_rate('totalTransitTimeInDays', ''); 376 377 $append_transit = ''; 377 378 378 if ($rating_method != "average_rate" && is_string($calculated_transit_date) && self::$en_is_shipment == 'en_single_shipment' && strlen($calculated_transit_date) > 0 && $transit_days == "yes") { 379 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 379 if ($rating_method != "average_rate" && isset($delivery_estimate_option) && !empty($delivery_estimate_option) && $delivery_estimate_option != 'dont_show_estimates' && self::$en_is_shipment != 'multi_shipment') { 380 381 if ($delivery_estimate_option == 'delivery_date' && is_string($calculated_transit_date) && strlen($calculated_transit_date) > 0) { 382 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 383 } else if ($delivery_estimate_option == 'delivery_days' && is_numeric($calculated_transit_days)) { 384 $append_transit = ' (Intransit days: ' . $calculated_transit_days . ')'; 385 } 380 386 } 381 387 -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/server/common/en-quote-settings.php
r3462301 r3494315 70 70 $range_5 = isset($range_5) && strlen($range_5) > 0 ? $range_5 : 770; 71 71 72 $dayross_shipment_days = ['all', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday']; 73 $shipment_days = []; 74 foreach ($dayross_shipment_days as $key => $day) { 75 get_option('en_quote_settings_' . $day . '_shipment_day_dayross') == 'yes' ? $shipment_days[] = $key : ''; 76 } 77 72 78 $quote_settings = [ 79 // Cut Off Time & Ship Date Offset 80 'delivery_estimate_option' => get_option('en_quote_settings_delivery_estimate_options_dayross'), 81 'cutt_off_time' => get_option('en_quote_settings_order_cut_off_time_dayross'), 82 'fulfilment_offset_days' => get_option('en_quote_settings_shipment_offset_days_dayross'), 83 'shipment_days' => $shipment_days, 73 84 'transit_days' => get_option('en_quote_settings_show_delivery_estimate_dayross'), 74 85 'own_freight' => get_option('en_quote_settings_own_arrangment_dayross'), -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/server/en-shipping-rates.php
r3462301 r3494315 221 221 $rate['label'] .= (!empty($label_sufex)) ? ' with ' . implode(' and ', $label_sufex) : ''; 222 222 $rate['label'] .= !empty($rate['append_transit']) ? $rate['append_transit'] : ''; 223 224 // Update rate label in FDO meta data 225 if (isset($rate['meta_data']['en_fdo_meta_data']['rate']['label'])) { 226 $rate['meta_data']['en_fdo_meta_data']['rate']['label'] = $rate['label']; 227 } 228 223 229 isset($rate['cost']) && $en_small_package_charges > 0 ? 224 230 $rate['cost'] = $rate['cost'] + $en_small_package_charges : 0; -
ltl-freight-quotes-day-ross-edition/tags/2.2.5/server/package/en-package.php
r3462301 r3494315 182 182 // Get product level markup value 183 183 $product_level_markup = self::en_get_product_level_markup($product_data, $product['variation_id'], $product['product_id'], $product['quantity']); 184 $product_level_fulfillment_offset = self::en_get_product_level_fulfillment_offset_days($product_data, $product['variation_id'], $product['product_id']); 184 185 $get_freight = self::en_dayross_get_freight_class($product, $product_data); 185 186 $freightClass_ltl_gross = ($get_freight['freight_class'] == 0) ? $get_freight['freight_class'] = "" : $get_freight['freight_class']; … … 214 215 'markup' => $product_level_markup, 215 216 'lineItemClass' => $freightClass_ltl_gross, 217 'fulfillment_offset_days' => $product_level_fulfillment_offset, 216 218 ]; 217 219 … … 330 332 self::$en_request['commdityDetails'][$origin_zip_code][$is_line_item] = $product_item; 331 333 self::$en_request['originAddress'][$origin_zip_code] = $origin_address; 334 335 // Track maximum fulfillment offset days 336 if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) { 337 if (!isset(self::$en_request['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > self::$en_request['max_fulfillment_offset_days']) { 338 self::$en_request['max_fulfillment_offset_days'] = $product_level_fulfillment_offset; 339 } 340 } 332 341 } 333 342 } … … 405 414 // Configure standard plugin with pallet packaging addon 406 415 self::$en_request = apply_filters('en_pallet_identify', array_merge(EnDayrossConnectionSettings::en_static_request_detail(), self::$en_request)); 416 417 // Add the settings from quote page 418 self::en_dayross_quote_settings_detail(); 407 419 408 420 return self::$en_request; … … 631 643 switch (self::$product_key_name) { 632 644 case '_dropship_location': 645 $_post_id = self::$post_id; 633 646 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 647 634 648 // check for parent id 635 649 if (empty($enable_dropship) && self::$parent_id > 0 && self::$parent_id != self::$post_id) { 636 self::$post_id = self::$parent_id;637 $enable_dropship = get_post_meta( self::$post_id, '_enable_dropship', true);650 $_post_id = self::$parent_id; 651 $enable_dropship = get_post_meta($_post_id, '_enable_dropship', true); 638 652 } 639 653 … … 643 657 $all_plugins = apply_filters('active_plugins', get_option('active_plugins')); 644 658 if (stripos(implode($all_plugins), 'micro-warehouse-shipping.php') || is_plugin_active_for_network('micro-warehouse-shipping-for-woocommerce/micro-warehouse-shipping.php')) { 645 $locations_dropship = maybe_unserialize(get_post_meta( self::$post_id, '_dropship_location', true));659 $locations_dropship = maybe_unserialize(get_post_meta($_post_id, '_dropship_location', true)); 646 660 647 661 if(!empty($locations_dropship)) { … … 651 665 } 652 666 653 $en_dayross_get_location = self::en_dayross_get_location(get_post_meta( self::$post_id, self::$product_key_name, true));667 $en_dayross_get_location = self::en_dayross_get_location(get_post_meta($_post_id, self::$product_key_name, true)); 654 668 655 669 if (empty($en_dayross_get_location)) { … … 762 776 } 763 777 778 static public function en_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id) 779 { 780 $fulfillment_offset_days = ''; 781 $field_name = '_eniture_product_level_fulfillment_offset_days'; 782 783 if ($_product->get_type() == 'variation' && $variation_id > 0) { 784 $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true); 785 786 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 787 $parent_id = $_product->get_parent_id(); 788 if ($parent_id > 0) { 789 $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true); 790 } 791 } 792 } else { 793 $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true); 794 } 795 796 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 797 $fulfillment_offset_days = get_post_meta($product_id, $field_name, true); 798 } 799 800 // Validate and sanitize the value before returning 801 if (is_numeric($fulfillment_offset_days)) { 802 $value = intval($fulfillment_offset_days); 803 return $value; 804 } 805 806 // Return empty string if invalid 807 return ''; 808 } 809 810 /** 811 * Quote settings 812 * @param array $location 813 * @return array|false 814 */ 815 static public function en_dayross_quote_settings_detail() { 816 $delivery_estimate_option = $cutt_off_time = $fulfilment_offset_days = ''; 817 $settings = $shipment_days = []; 818 $feature_option = apply_filters("dayross_plans_suscription_and_features", 'order_cutt_off_time'); 819 $en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 820 extract($en_settings); 821 822 // Use product-level fulfillment offset days if available, otherwise use global setting 823 if (isset(self::$en_request['max_fulfillment_offset_days']) && is_numeric(self::$en_request['max_fulfillment_offset_days']) && self::$en_request['max_fulfillment_offset_days'] > 0) { 824 $fulfilment_offset_days = self::$en_request['max_fulfillment_offset_days']; 825 } 826 827 if (!is_array($feature_option) && ($delivery_estimate_option == 'delivery_days' || $delivery_estimate_option == 'delivery_date')) { 828 $settings = [ 829 'modifyShipmentDateTime' => strlen($cutt_off_time) > 0 || strlen($fulfilment_offset_days) > 0 || !empty($shipment_days) ? true : false, 830 'OrderCutoffTime' => $cutt_off_time, 831 'shipmentOffsetDays' => $fulfilment_offset_days, 832 'storeDateTime' => gmdate('Y-m-d H:i:s'), 833 'shipmentWeekDays' => $shipment_days, 834 ]; 835 } 836 837 self::$en_request = array_merge(self::$en_request, $settings); 838 } 839 764 840 } 765 841 -
ltl-freight-quotes-day-ross-edition/trunk/admin/assets/en-dayross-admin.css
r3489974 r3494315 127 127 } 128 128 129 .en_quote_settings_sub_options th { 129 .en_quote_settings_sub_options th, 130 .dayross_cutt_off_time_ship_date_offset th, 131 .en_quote_settings_shipment_offset_days_dayross_tr th, 132 .en_quote_settings_all_shipment_days_dayross_tr th 133 { 130 134 padding: 0 0 10px 15px; 131 135 margin-left: 10px !important; … … 133 137 } 134 138 135 .en_quote_settings_sub_options td { 139 .dayross_cutt_off_time_ship_date_offset th, 140 .en_quote_settings_shipment_offset_days_dayross_tr th, 141 .en_quote_settings_all_shipment_days_dayross_tr th { 142 padding-top: 10px !important; 143 } 144 145 .en_quote_settings_sub_options td, 146 .dayross_cutt_off_time_ship_date_offset td, 147 .en_quote_settings_shipment_offset_days_dayross_tr td, 148 .en_quote_settings_all_shipment_days_dayross_tr td { 136 149 padding: 0 0 10px 15px; 137 150 } … … 364 377 .woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"], 365 378 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 379 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 366 380 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 367 381 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], … … 387 401 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], 388 402 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 403 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 389 404 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 390 405 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"], … … 396 411 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip, 397 412 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip, 413 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip, 398 414 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip, 399 415 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip, … … 468 484 background: none !important; 469 485 } 486 487 .en_quote_settings_all_shipment_days_dayross_tr td { 488 display: flex !important; 489 align-items: center; 490 gap: 16px; 491 flex-wrap: nowrap; 492 } -
ltl-freight-quotes-day-ross-edition/trunk/admin/assets/en-dayross-admin.js
r3490815 r3494315 66 66 jQuery('#en_dayross_quote_settings').parents().find('.button-primary, .is-primary').on('click', function (event) { 67 67 68 jQuery(':checkbox:disabled').prop('disabled', false); 69 68 70 let en_validate_settings = {}; 69 71 let en_data_error = true; … … 179 181 } 180 182 183 // Validate fullfillment offset days 184 if (!dayrossValidateFullfillmentOffsetDays()) return false; 181 185 // backup rates validation 182 186 if (!dayrossBackupRatesValidations()) return false; … … 376 380 handleAPISelection(); 377 381 jQuery('#en_connection_settings_api_dayross').on('change', handleAPISelection); 382 383 // Cut-off time and shipment offset days settings 384 dayrossCutOffTimeAndShipDateSettings(); 378 385 }); 379 386 … … 801 808 } 802 809 } 810 811 if (typeof dayrossCutOffTimeAndShipDateSettings != 'function') { 812 function dayrossCutOffTimeAndShipDateSettings() { 813 jQuery("#en_quote_settings_shipment_offset_days_dayross").closest('tr').addClass("en_quote_settings_shipment_offset_days_dayross_tr"); 814 jQuery("#en_quote_settings_all_shipment_days_dayross").closest('tr').addClass("en_quote_settings_all_shipment_days_dayross_tr"); 815 jQuery(".dayross_shipment_day ").closest('tr').addClass("dayross_shipment_day_tr"); 816 jQuery("#en_quote_settings_order_cut_off_time_dayross").closest('tr').addClass("dayross_cutt_off_time_ship_date_offset"); 817 jQuery("#en_quote_settings_shipment_offset_days_dayross").attr('maxlength', '2'); 818 819 const dayross_current_time = en_dayross_admin_script.dayross_order_cut_off_time; 820 if (dayross_current_time == '') { 821 jQuery('#en_quote_settings_order_cut_off_time_dayross').wickedpicker({ 822 now: '', 823 title: 'Cut Off Time', 824 }); 825 } else { 826 jQuery('#en_quote_settings_order_cut_off_time_dayross').wickedpicker({ 827 now: dayross_current_time, 828 title: 'Cut Off Time' 829 }); 830 } 831 832 const show_delivery_estimate = jQuery('input[name=en_quote_settings_delivery_estimate_options_dayross]:checked').val(); 833 if (show_delivery_estimate === 'dont_show_estimates') { 834 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', true); 835 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', true); 836 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "not-allowed"); 837 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "not-allowed"); 838 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', true); 839 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "not-allowed"); 840 } else { 841 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', false); 842 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', false); 843 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", ""); 844 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', false); 845 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", ""); 846 } 847 848 jQuery("input[name=en_quote_settings_delivery_estimate_options_dayross]").change(function () { 849 const show_delivery_estimate = jQuery('input[name=en_quote_settings_delivery_estimate_options_dayross]:checked').val(); 850 851 if (show_delivery_estimate === 'dont_show_estimates') { 852 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', true); 853 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', true); 854 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "not-allowed"); 855 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "not-allowed"); 856 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', true); 857 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "not-allowed"); 858 } else { 859 jQuery("#en_quote_settings_order_cut_off_time_dayross").prop('disabled', false); 860 jQuery("#en_quote_settings_shipment_offset_days_dayross").prop('disabled', false); 861 jQuery("#en_quote_settings_order_cut_off_time_dayross").css("cursor", "auto"); 862 jQuery("#en_quote_settings_shipment_offset_days_dayross").css("cursor", "auto"); 863 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').prop('disabled', false); 864 jQuery('.all_shipment_days_dayross_lfq, .dayross_shipment_day').css("cursor", "auto"); 865 } 866 }); 867 868 /* 869 * Uncheck Week days Select All Checkbox 870 */ 871 jQuery(".dayross_shipment_day").on('change load', function () { 872 873 const checkboxes = jQuery('.dayross_shipment_day:checked').length; 874 const un_checkboxes = jQuery('.dayross_shipment_day').length; 875 876 if (checkboxes === un_checkboxes) { 877 jQuery('.all_shipment_days_dayross_lfq').prop('checked', true); 878 } else { 879 jQuery('.all_shipment_days_dayross_lfq').prop('checked', false); 880 } 881 }); 882 883 /* 884 * Select All Shipment Week days 885 */ 886 887 const all_int_checkboxes = jQuery('.all_shipment_days_dayross_lfq'); 888 if (all_int_checkboxes.length === all_int_checkboxes.filter(":checked").length) { 889 jQuery('.all_shipment_days_dayross_lfq').prop('checked', true); 890 } 891 892 jQuery(".all_shipment_days_dayross_lfq").change(function () { 893 if (this.checked) { 894 jQuery(".dayross_shipment_day").each(function () { 895 this.checked = true; 896 }); 897 } else { 898 jQuery(".dayross_shipment_day").each(function () { 899 this.checked = false; 900 }); 901 } 902 }); 903 904 const main_td = jQuery('.en_quote_settings_all_shipment_days_dayross_tr td'); 905 const rows = jQuery('tr.dayross_shipment_day_tr'); 906 907 if (!main_td.length || !rows.length) return; 908 909 // Move all day checkboxes into main row 910 rows.each(function () { 911 const input_wrap = jQuery(this).find('td > *').first(); 912 if (input_wrap.length) main_td.append(input_wrap); 913 }); 914 915 // Hide original rows 916 rows.hide(); 917 918 // ---- Select All sync ---- 919 const select_all = main_td.find('input[type="checkbox"]').first(); 920 const days = main_td.find('input[type="checkbox"]').not(select_all); 921 922 // Select all → days 923 select_all.on('change', function () { 924 days.prop('checked', this.checked); 925 }); 926 // Days → select all 927 days.on('change', function () { 928 select_all.prop('checked', days.length === days.filter(':checked').length); 929 }); 930 } 931 } 932 933 if (typeof dayrossValidateFullfillmentOffsetDays !== 'function') { 934 function dayrossValidateFullfillmentOffsetDays() { 935 const offset_days = jQuery("#en_quote_settings_shipment_offset_days_dayross").val(); 936 const number_regex = /^[0-9]+$/; 937 let error_msg = ''; 938 939 if (offset_days != "" && offset_days < 1) error_msg = 'Fulfillment Offset Days must be greater than or equal to 1.'; 940 if (!error_msg && offset_days != "" && offset_days > 20) error_msg = 'Fulfillment Offset Days must be less than or equal to 20.'; 941 if (!error_msg && offset_days != "" && !number_regex.test(offset_days)) error_msg = 'Fulfillment Offset Days must be a number.'; 942 943 if (error_msg) { 944 jQuery('.en_dayross_ltl_plan_notice').after('<div class="notice notice-error en_settings_message"><p><strong>Error! </strong>' + error_msg + '</p></div>'); 945 jQuery('#en_settings_message').delay(200).animate({scrollTop: 0}, 1000); 946 jQuery('html, body').animate({scrollTop: 0}, 'slow'); 947 return false; 948 } 949 950 return true; 951 } 952 } -
ltl-freight-quotes-day-ross-edition/trunk/admin/product/en-product-detail.php
r3284707 r3494315 81 81 $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : ''; 82 82 $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field($_POST[$custom_field][$postId]) : ''; 83 $en_updated_product = $custom_field == '_dropship_location' ? 84 (maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product)) : esc_attr($en_updated_product); 83 84 if ($custom_field == '_dropship_location') { 85 $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product); 86 } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') { 87 $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product); 88 } else { 89 $en_updated_product = esc_attr($en_updated_product); 90 } 91 85 92 update_post_meta($postId, $custom_field, $en_updated_product); 86 93 } 87 94 } 95 } 96 97 private function sanitize_fulfillment_offset_days($value) 98 { 99 $value = trim($value); 100 if ($value === '' || $value === null) return ''; 101 102 $value = preg_replace('/[^0-9.-]/', '', $value); 103 if (!is_numeric($value)) return ''; 104 105 $value = intval(floor(floatval($value))); 106 return $value < 0 ? '' : strval($value); 88 107 } 89 108 … … 181 200 '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% will cause 5 percent of the item's price to be added to the shipping quotes." 182 201 ], 202 [ 203 'type' => 'input_field', 204 'input_type' => 'number', 205 'id' => '_eniture_product_level_fulfillment_offset_days', 206 'class' => '_eniture_product_level_fulfillment_offset_days short', 207 'label' => __( 'Fulfillment Offset Days', 'woocommerce' ), 208 'placeholder' => 'Fulfillment offset days, e.g. 2', 209 'description' => "The number of days the ship date needs to be moved to allow for the processing of the order. If set, this will override the global Fulfillment Offset Days setting for this product.", 210 'custom_attributes' => [ 211 'min' => '1', 212 'max' => '20', 213 'step' => '1', 214 'title' => 'Value must be greater than or equal to 1 and less than or equal to 20', 215 'oninvalid' => "this.setCustomValidity(this.validity.rangeUnderflow ? 'Value must be greater than or equal to 1' : this.validity.rangeOverflow ? 'Value must be less than or equal to 20' : '')", 216 'oninput' => "this.setCustomValidity('')" 217 ] 218 ], 183 219 ]; 184 220 // Micro Warehouse … … 273 309 'label' => $custom_field['label'], 274 310 'class' => $custom_field['class'], 275 'placeholder' => $custom_field['label'],311 'placeholder' => isset($custom_field['placeholder']) ? $custom_field['placeholder'] : $custom_field['label'], 276 312 'value' => get_post_meta($postId, $custom_field['id'], true) 277 313 ]; … … 281 317 $custom_input_field['description'] = $custom_field['description']; 282 318 } 319 320 // Add input type if specified (e.g., 'number') 321 if (isset($custom_field['input_type'])) { 322 $custom_input_field['type'] = $custom_field['input_type']; 323 } 324 325 // Add custom attributes if specified (e.g., min, max, step) 326 if (isset($custom_field['custom_attributes'])) { 327 $custom_input_field['custom_attributes'] = $custom_field['custom_attributes']; 328 } 329 283 330 echo '<div>'; 284 331 woocommerce_wp_text_input($custom_input_field); -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/en-tab.php
r3428882 r3494315 157 157 $settings = $this->get_settings($current_section); 158 158 159 // Cuttoff Time 160 if (isset($_POST['en_quote_settings_order_cut_off_time_dayross']) && $_POST['en_quote_settings_order_cut_off_time_dayross'] != '') { 161 $time_24_format = $this->get_time_in_24_hours($_POST['en_quote_settings_order_cut_off_time_dayross']); 162 $_POST['en_quote_settings_order_cut_off_time_dayross'] = $time_24_format; 163 } 164 159 165 // backup rates 160 166 $backup_rates_fields = ['dayross_backup_rates_fixed_rate', 'dayross_backup_rates_cart_price_percentage', 'dayross_backup_rates_weight_function']; … … 165 171 WC_Admin_Settings::save_fields($settings); 166 172 } 173 174 /** 175 * Cuttoff Time 176 * @param $timeStr 177 * @return false|string 178 */ 179 public function get_time_in_24_hours($timeStr) 180 { 181 $cutOffTime = explode(' ', $timeStr); 182 $hours = $cutOffTime[0]; 183 $separator = $cutOffTime[1]; 184 $minutes = $cutOffTime[2]; 185 $meridiem = $cutOffTime[3]; 186 $cutOffTime = "{$hours}{$separator}{$minutes} $meridiem"; 187 188 return date("H:i", strtotime($cutOffTime)); 189 } 167 190 } 168 191 169 192 $en_tab = new EnDayrossTab(); 170 return $en_tab->en_load(); 193 $en_tab->en_load(); 194 return $en_tab; 171 195 } -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/assets/css/en-dayross-location.css
r3428882 r3494315 119 119 color: #ff0000; 120 120 font-size: 11px; 121 margin: 0 0 0 40.2%; 122 width: 100%; 121 width: 58.7%; 123 122 display: block; 124 } 125 126 .en_location_error_message { 123 float: right; 124 } 125 126 .en_location_error_message, 127 .en_dayross_warehouse_error_message, .en_dayross_dropship_error_message { 127 128 background: #f1f1f1 none repeat scroll 0 0; 128 129 border-left: 4px solid #dc3232; … … 134 135 } 135 136 136 .en_location_success_message { 137 .en_location_success_message, 138 .en_dayross_wh_location_success_message, .en_dayross_ds_location_success_message, 139 .en_dayross_warehouse_success_message, .en_dayross_dropship_success_message { 137 140 background: #fff none repeat scroll 0 0; 138 141 border-left: 4px solid #46b450; … … 144 147 } 145 148 149 .en_dayross_warehouse_success_message, .en_dayross_dropship_success_message { 150 margin: auto; 151 } 152 146 153 .spinner_disable { 147 154 color: #000000; … … 162 169 background: #fff none repeat scroll 0 0; 163 170 border-bottom: 1px solid #e1e1e1; 164 color: #0073aa ;171 color: #0073aa !important; 165 172 font-size: 14px; 166 173 font-weight: 400; -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/assets/js/en-dayross-location.js
r3428882 r3494315 169 169 } else if (en_is_var_exist('severity', data) && data['severity'] == 'error') { 170 170 jQuery('.en_popup_location_form').delay(200).animate({scrollTop: 0}, 300); 171 const location_type = data['location'] == 'warehouse' ? 'wh' : 'ds'; 172 jQuery(`.en_dayross_${location_type}_location_error_message span`).text(data['message']); 173 en_show_errors(`.en_dayross_${location_type}_location_error_message`); 171 174 jQuery('.en_location_error_message span').text(data['message']); 172 en_show_errors('.en_location_error_message');173 175 } 174 176 … … 377 379 function en_dayross_location_delete(e, data, en_location_type, en_location_id) { 378 380 e.preventDefault(); 381 382 // If warehouse location then directly delete 383 if (en_location_type) { 384 en_dayross_location_confirm_delete(data, en_location_type, en_location_id); 385 return; 386 } 387 379 388 en_popup_confirmation_location_delete_show(); 380 389 jQuery('.en_close_popup_location').on('click', function () { … … 423 432 if (data['message'].length > 0) { 424 433 jQuery('.en_popup_location_form').delay(200).animate({scrollTop: 0}, 300); 425 jQuery('.en_location_success_message span').text(data['message']); 426 en_show_errors('.en_location_success_message'); 434 const location_type = data['location'] == 'warehouse' ? 'wh' : 'ds'; 435 jQuery(`.en_dayross_${location_type}_location_success_message span`).text(data['message']); 436 en_show_errors(`.en_dayross_${location_type}_location_success_message`); 427 437 } 428 438 } … … 464 474 } 465 475 } 476 477 if (typeof en_dayross_select_bulk_locations != 'function') { 478 function en_dayross_select_bulk_locations(location_class, e) { 479 const checked = jQuery(e).is(':checked'); 480 jQuery(`.${location_class}`).prop('checked', checked); 481 } 482 } 483 484 if (typeof en_dayross_toggle_select_all_locations != 'function') { 485 function en_dayross_toggle_select_all_locations(location_class, select_all_locations) { 486 const allChecked = jQuery(`.${location_class}:checked`).length === jQuery(`.${location_class}`).length; 487 jQuery(`#${select_all_locations}`).prop('checked', allChecked); 488 } 489 } 490 491 if (typeof en_dayross_delete_bulk_locations != 'function') { 492 function en_dayross_delete_bulk_locations(e, location_class, location_type) { 493 e.preventDefault(); 494 const location_ids = jQuery(`.${location_class}:checked`).map(function () { 495 return this.value; 496 }).get(); 497 498 // Show error message if no locations are selected 499 if (location_ids.length === 0) { 500 const loc_error_class = `en_dayross_${location_type}_error_message`; 501 jQuery(`.${loc_error_class}`).show('slow').delay(3000).hide('slow'); 502 return; 503 } 504 505 const postForm = { 506 'action': 'en_dayross_wd_bulk_delete_locations', 507 'location_ids': location_ids, 508 'location_type': location_type, 509 'wp_nonce': en_dayross_location_script.nonce 510 } 511 const delete_locs_btn = `.en_dayross_bulk_delete_${location_type}`, 512 loc_success_class = `.en_dayross_${location_type}_success_message`, 513 loc_error_class = `.en_dayross_${location_type}_error_message`; 514 515 jQuery.ajax({ 516 type: 'POST', 517 url: ajaxurl, 518 data: postForm, 519 dataType: 'json', 520 beforeSend: function () { 521 jQuery(delete_locs_btn).addClass('spinner_disable'); 522 }, 523 success: function (data) { 524 if (data.error && data.message) { 525 jQuery(delete_locs_btn).removeClass('spinner_disable'); 526 jQuery(loc_error_class).show('slow').delay(3000).hide('slow'); 527 } else { 528 jQuery(delete_locs_btn).removeClass('spinner_disable'); 529 jQuery(data.target_location).replaceWith(data.html); 530 jQuery(loc_success_class).show('slow').delay(3000).hide('slow'); 531 jQuery('.warehouse_updated, .warehouse_created, .warehouse_deleted, .dropship_deleted, .dropship_updated, .dropship_created').css('display', 'none'); 532 } 533 }, 534 error: function (error) { 535 jQuery(delete_locs_btn).removeClass('spinner_disable'); 536 console.log(error); 537 } 538 }); 539 } 540 } -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/dropship/en-dropship.php
r3351760 r3494315 41 41 42 42 <h1><?php _e('Drop ships', 'eniture-technology'); ?></h1> 43 <button type="button" onclick="en_show_popup_location(false, event)" type="button" 44 class="button-primary"><?php _e('Add', 'eniture-technology'); ?></button> 45 <p><?php _e('Locations that inventory specific items that are drop shipped to the destination. Use the products settings 43 <div style="display: flex; gap: 3px; align-items: center; margin-top: 20px;"> 44 <button type="button" onclick="en_show_popup_location(false, event)" type="button" 45 class="button-primary"><?php _e('Add', 'eniture-technology'); ?></button> 46 <button type="button" class="en_dayross_bulk_delete_dropship en_wd_add_dropship_btn button-primary" title="Delete Drop Ships" onclick="return en_dayross_delete_bulk_locations(event, 'en_dayross_delete_dropship_item', 'dropship');"><?php _e('Delete', 'eniture-technology'); ?></button> 47 </div> 48 49 <p><?php _e("Locations that inventory specific items that are drop shipped to the destination. Use the product's settings 46 50 page to identify it as a drop shipped item and its associated drop ship location. Orders that include drop 47 51 shipped items will display a single figure for the shipping rate estimate that is equal to the sum of the 48 cheapest option of each shipment required to fulfill the order.', 'eniture-technology'); ?></p> 52 cheapest option of each shipment required to fulfill the order.", 'eniture-technology'); ?></p> 53 54 <div class="en_dayross_ds_location_success_message"><strong>Success! </strong><span></span></div> 55 <div class="en_dayross_dropship_success_message"><strong>Success!</strong> <span>Selected drop ships deleted successfully.</span></div> 56 <div class="en_dayross_dropship_error_message"><strong>Error!</strong> Please select at least one drop ship to delete.</div> 49 57 50 58 <table class="en_location_table en_location_dropship_table"> 51 59 <thead> 52 60 <tr> 61 <th class="en_wd_dropship_list_heading en_dayross_bulk_delete_col"> 62 <!-- Bulk delete --> 63 <input type="checkbox" name="en_dayross_bulk_delete_dropships" id="en_dayross_bulk_delete_dropships" onclick="return en_dayross_select_bulk_locations('en_dayross_delete_dropship_item', this);" /> 64 </th> 53 65 <?php echo force_balance_tags(\EnLocation::en_arrange_table_data('th', $en_heading)); ?> 54 66 <th><?php _e('Action', 'eniture-technology'); ?></th> -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/en-location.php
r3428882 r3494315 278 278 279 279 echo '<tr class="' . esc_attr($append_class) . '" id="en_location_row_id_' . esc_attr($en_location_id) . '">'; 280 281 $_type = ($loc_type === 'wh') ? 'warehouse' : 'dropship'; 282 echo '<td class="en_wd_' . esc_attr($_type) . '_list_data en_dayross_bulk_delete_col"> 283 <input 284 type="checkbox" 285 class="en_dayross_delete_' . esc_attr($_type) . '_item" 286 value="' . esc_attr($en_location_id) . '" 287 onclick="return en_dayross_toggle_select_all_locations( 288 \'en_dayross_delete_' . esc_attr($_type) . '_item\', 289 \'en_dayross_bulk_delete_' . esc_attr($_type) . 's\' 290 );" 291 > 292 </td>'; 280 293 echo self::en_arrange_table_data('td', $en_sorted_location); 281 294 … … 309 322 <?php _e('Warning!', 'eniture-technology'); ?> 310 323 </h2> 324 <hr> 311 325 <p class="en_confirmation_message"> 312 <?php _e('If you delete this location, then location settings will be disabled against products 313 (if any).', 'eniture-technology'); ?> 326 Warning! If you delete this location, Drop ship location settings will be disabled against products if any. 314 327 </p> 328 <hr> 315 329 <div class="en_confirmation_buttons"> 316 330 <a href="#" -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/includes/en-location-ajax.php
r3428882 r3494315 18 18 add_action('wp_ajax_en_dayross_get_location', [$this, 'en_dayross_get_location']); 19 19 add_action('wp_ajax_en_dayross_location_delete_row', [$this, 'en_dayross_location_delete_row']); 20 21 add_action('wp_ajax_nopriv_en_dayross_wd_bulk_delete_locations', array($this, 'en_dayross_bulk_delete_locations_ajax')); 22 add_action('wp_ajax_en_dayross_wd_bulk_delete_locations', array($this, 'en_dayross_bulk_delete_locations_ajax')); 20 23 } 21 24 … … 199 202 200 203 if ($location === 'warehouse') { 201 $location_step = ' Warehouse';204 $location_step = 'New warehouse'; 202 205 $en_location_template_obj = new EnDayrossWarehouseTemplate(); 203 206 $en_target_location = '.en_location_warehouse_main_div'; 204 207 $validate = ['zip', 'city', 'state', 'country', 'location']; 205 208 } else { 206 $location_step = ' Dropship';209 $location_step = 'New drop ship'; 207 210 $en_location_template_obj = new EnDayrossDropshipTemplate(); 208 211 $en_target_location = '.en_location_dropship_main_div'; … … 222 225 (!empty($en_location_data) && 223 226 reset($en_location_data)['id'] === $location_id))) { 227 $location_step = $location === 'warehouse' ? 'Warehouse' : 'Drop ship'; 224 228 $message = $location_step . ' updated successfully.'; 225 229 $action = 'update'; … … 250 254 } 251 255 256 public function en_dayross_bulk_delete_locations_ajax() 257 { 258 if (!(current_user_can('manage_options') || current_user_can('manage_woocommerce')) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wp_nonce'])), 'en_dayross_location_nonce')) { 259 echo wp_json_encode(array('error' => true, 'message' => 'Unauthorized Access.')); 260 exit; 261 } 262 263 $location_ids = isset($_POST['location_ids']) ? $_POST['location_ids'] : array(); 264 $loc_type = isset($_POST['location_type']) ? $_POST['location_type'] : ''; 265 if (empty($location_ids)) { 266 echo wp_json_encode(['error' => true, 'message' => "Please select at least one {$loc_type} to delete."]); 267 exit; 268 } 269 270 global $wpdb; 271 foreach ($location_ids as $location_id) { 272 if ($loc_type == 'dropship') { 273 $get_dropship_id = ''; 274 $dropship_id = intval($location_id); 275 $get_dropship_array = array($dropship_id); 276 $ser = maybe_serialize($get_dropship_id); 277 $get_dropship_val = array_map('intval', $get_dropship_array); 278 $get_post_id = $wpdb->get_results("SELECT group_concat(post_id) as post_ids_list FROM `" . $wpdb->prefix . "postmeta` WHERE `meta_key` = '_dropship_location' AND (`meta_value` LIKE '%" . $ser . "%' OR `meta_value` = '" . $dropship_id . "')"); 279 $post_id = reset($get_post_id)->post_ids_list; 280 281 if (isset($post_id)) { 282 $wpdb->query("UPDATE `" . $wpdb->prefix . "postmeta` SET `meta_value` = '' WHERE `meta_key` IN('_enable_dropship','_dropship_location') AND `post_id` IN ($post_id)"); 283 } 284 } 285 286 $wpdb->delete($wpdb->prefix . "warehouse", array('id' => intval($location_id), 'location' => $loc_type)); 287 } 288 289 if ($loc_type === 'warehouse') { 290 $en_location_template_obj = new EnDayrossWarehouseTemplate(); 291 $en_target_location = '.en_location_warehouse_main_div'; 292 } else { 293 $en_location_template_obj = new EnDayrossDropshipTemplate(); 294 $en_target_location = '.en_location_dropship_main_div'; 295 } 296 297 $html = $en_location_template_obj::en_load(); 298 299 echo wp_json_encode(['error' => false, 'message' => 'Locations deleted successfully.', 'target_location' => $en_target_location, 'html' => $html]); 300 exit; 301 } 302 252 303 } 253 304 -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/location/warehouse/en-warehouse.php
r3351760 r3494315 36 36 <div class="en_location_warehouse_main_div"> 37 37 38 <div class="en_location_success_message"> 39 <strong><?php _e('Success!', 'eniture-technology'); ?></strong> <span></span></div> 38 <h1><?php _e('Warehouses', 'eniture-technology'); ?></h1> 39 <div style="display: flex; gap: 3px; align-items: center; margin-top: 20px;"> 40 <button title="Add Warehouse" type="button" onclick="en_show_popup_location(true, event)" type="button" 41 class="button-primary <?php echo esc_attr(self::$disabled_plan); ?>"><?php _e('Add', 'eniture-technology'); ?> 42 </button> 43 <button type="button" class="en_dayross_bulk_delete_warehouse en_wd_add_warehouse_btn button-primary" title="Delete Warehouses" onclick="return en_dayross_delete_bulk_locations(event, 'en_dayross_delete_warehouse_item', 'warehouse');"><?php _e('Delete', 'eniture-technology'); ?> 44 </button> 40 45 41 <h1><?php _e('Warehouses', 'eniture-technology'); ?></h1> 42 <button type="button" onclick="en_show_popup_location(true, event)" type="button" 43 class="button-primary <?php echo esc_attr(self::$disabled_plan); ?>"><?php _e('Add', 'eniture-technology'); ?> 44 </button> 45 <?php echo force_balance_tags(self::$plan_required); ?> 46 <?php echo force_balance_tags(self::$plan_required); ?> 47 </div> 46 48 47 49 <p><?php _e('Warehouses that inventory all products not otherwise identified as drop shipped items. The warehouse with the 48 50 lowest shipping cost to the destination is used for quoting purposes.', 'eniture-technology'); ?></p> 51 52 <div class="en_dayross_wh_location_success_message"><strong>Success! </strong><span></span></div> 53 <div class="en_dayross_warehouse_success_message"><strong>Success! </strong> <span>Selected warehouses deleted successfully.</span></div> 54 <div class="en_dayross_warehouse_error_message"><strong>Error!</strong> <span>Please select at least one warehouse to delete.</span></div> 49 55 50 56 <table class="en_location_table en_location_warehouse_table"> 51 57 <thead> 52 58 <tr> 59 <th class="en_wd_warehouse_list_heading en_dayross_bulk_delete_col"> 60 <!-- Bulk delete --> 61 <input type="checkbox" name="en_dayross_bulk_delete_warehouses" id="en_dayross_bulk_delete_warehouses" onclick="return en_dayross_select_bulk_locations('en_dayross_delete_warehouse_item', this);" /> 62 </th> 53 63 <?php echo force_balance_tags(\EnLocation::en_arrange_table_data('th', $en_heading)); ?> 54 64 <th><?php _e('Action', 'eniture-technology'); ?></th> -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/logs/en-logs.php
r3462301 r3494315 48 48 49 49 $url = EN_DAYROSS_ROOT_URL_QUOTES . '/request-log/index.php'; 50 $logs = $obj_classs->en_dayross_sent_http_request($url, $data, 'POST' );50 $logs = $obj_classs->en_dayross_sent_http_request($url, $data, 'POST', 'Logs'); 51 51 $logs = (isset($logs) && is_string($logs) && strlen($logs) > 0) ? json_decode($logs, true) : []; 52 52 -
ltl-freight-quotes-day-ross-edition/trunk/admin/tab/quote-settings/en-quote-settings.php
r3428882 r3494315 26 26 } 27 27 28 if (get_option('en_quote_settings_show_delivery_estimate_dayross') == 'yes') { 29 update_option('en_quote_settings_delivery_estimate_options_dayross', 'delivery_date'); 30 delete_option('en_quote_settings_show_delivery_estimate_dayross'); 31 } 32 33 // Cuttoff Time 34 $dayross_disable_cutt_off_time_ship_date_offset = ""; 35 $dayross_cutt_off_time_package_required = ""; 36 37 // Check the cutt of time & offset days plans for disable input fields 38 $dayross_action_cutOffTime_shipDateOffset = apply_filters('dayross_plans_suscription_and_features', 'order_cutt_off_time'); 39 if (is_array($dayross_action_cutOffTime_shipDateOffset) && false) { 40 $dayross_disable_cutt_off_time_ship_date_offset = "disabled_me"; 41 $dayross_cutt_off_time_package_required = apply_filters('dayross_plans_notification_link', $dayross_action_cutOffTime_shipDateOffset); 42 } 43 28 44 $ltl_enable = get_option('en_plugins_return_LTL_quotes'); 29 45 $weight_threshold_class = $ltl_enable == 'yes' ? 'show_en_weight_threshold_lfq' : 'hide_en_weight_threshold_lfq'; … … 57 73 * ================================================================== 58 74 */ 59 'en_quote_settings_show_delivery_estimate_dayross' => [ 60 'name' => __('Show Delivery Estimate ', 'woocommerce-settings-dayross'), 61 'type' => 'checkbox', 62 'id' => 'en_quote_settings_show_delivery_estimate_dayross' 63 ], 75 76 //** Start Delivery Estimate Options - Cuttoff Time 77 'delivery_estimate_options_dayross' => array( 78 'name' => __('Delivery Estimate Options ', 'woocommerce-settings-dayross'), 79 'type' => 'text', 80 'class' => 'hidden', 81 'id' => 'delivery_estimate_options_dayross' 82 ), 83 'en_quote_settings_delivery_estimate_options_dayross' => array( 84 'name' => '', 85 'type' => 'radio', 86 'default' => 'dont_show_estimates', 87 'options' => array( 88 'dont_show_estimates' => __("Don't display delivery estimates.", 'woocommerce-settings-dayross'), 89 'delivery_days' => __("Display estimated number of days until delivery.", 'woocommerce-settings-dayross'), 90 'delivery_date' => __("Display estimated delivery date.", 'woocommerce-settings-dayross'), 91 ), 92 'id' => 'en_quote_settings_delivery_estimate_options_dayross', 93 'class' => 'dayross_lfq_dont_show_estimate_option', 94 ), 95 //** End Delivery Estimate Options 96 97 //**Start: Cut Off Time & Ship Date Offset 98 'en_quote_settings_cutt_off_time_ship_date_offset_dayross' => array( 99 'name' => __('Cut Off Time & Ship Date Offset ', 'woocommerce-settings-dayross'), 100 'type' => 'text', 101 'class' => 'hidden', 102 'desc' => $dayross_cutt_off_time_package_required, 103 'id' => 'en_quote_settings_cutt_off_time_ship_date_offset_dayross' 104 ), 105 'en_quote_settings_order_cut_off_time_dayross' => array( 106 'name' => __('Order Cut Off Time ', 'woocommerce-settings-dayross'), 107 'type' => 'text', 108 'placeholder' => '-- : -- --', 109 '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.', 110 'id' => 'en_quote_settings_order_cut_off_time_dayross', 111 'class' => $dayross_disable_cutt_off_time_ship_date_offset, 112 ), 113 'en_quote_settings_shipment_offset_days_dayross' => array( 114 'name' => __('Fulfillment Offset Days ', 'woocommerce-settings-dayross'), 115 'type' => 'text', 116 'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.', 117 'placeholder' => 'Fulfillment Offset Days, e.g. 2', 118 'id' => 'en_quote_settings_shipment_offset_days_dayross', 119 'class' => $dayross_disable_cutt_off_time_ship_date_offset, 120 ), 121 'en_quote_settings_all_shipment_days_dayross' => array( 122 'name' => __("What days do you ship orders?", 'woocommerce-settings-dayross'), 123 'type' => 'checkbox', 124 'desc' => 'Select All', 125 'class' => "all_shipment_days_dayross_lfq $dayross_disable_cutt_off_time_ship_date_offset", 126 'id' => 'en_quote_settings_all_shipment_days_dayross' 127 ), 128 'en_quote_settings_monday_shipment_day_dayross' => array( 129 'name' => __("", 'woocommerce-settings-dayross'), 130 'type' => 'checkbox', 131 'desc' => 'Monday', 132 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 133 'id' => 'en_quote_settings_monday_shipment_day_dayross' 134 ), 135 'en_quote_settings_tuesday_shipment_day_dayross' => array( 136 'name' => __("", 'woocommerce-settings-dayross'), 137 'type' => 'checkbox', 138 'desc' => 'Tuesday', 139 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 140 'id' => 'en_quote_settings_tuesday_shipment_day_dayross' 141 ), 142 'en_quote_settings_wednesday_shipment_day_dayross' => array( 143 'name' => __("", 'woocommerce-settings-dayross'), 144 'type' => 'checkbox', 145 'desc' => 'Wednesday', 146 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 147 'id' => 'en_quote_settings_wednesday_shipment_day_dayross' 148 ), 149 'en_quote_settings_thursday_shipment_day_dayross' => array( 150 'name' => __("", 'woocommerce-settings-dayross'), 151 'type' => 'checkbox', 152 'desc' => 'Thursday', 153 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 154 'id' => 'en_quote_settings_thursday_shipment_day_dayross' 155 ), 156 'en_quote_settings_friday_shipment_day_dayross' => array( 157 'name' => __("", 'woocommerce-settings-dayross'), 158 'type' => 'checkbox', 159 'desc' => 'Friday', 160 'class' => "dayross_shipment_day $dayross_disable_cutt_off_time_ship_date_offset", 161 'id' => 'en_quote_settings_friday_shipment_day_dayross' 162 ), 163 'en_quote_settings_show_delivery_estimate_dayross' => array( 164 'title' => __('', 'woocommerce'), 165 'name' => __('', 'woocommerce-settings-dayross'), 166 'desc' => '', 167 'id' => 'dayross_lfq_show_delivery_estimates', 168 'css' => '', 169 'default' => '', 170 'type' => 'title', 171 ), 172 //**End: Cut Off Time & Ship Date Offset 173 64 174 'residential_delivery_options_label' => [ 65 175 'name' => __('Residential Delivery', 'woocommerce-settings-dayross'), -
ltl-freight-quotes-day-ross-edition/trunk/common/en-plans.php
r3304907 r3494315 48 48 $plugin_info = get_plugins(); 49 49 $plugin_version = (isset($plugin_info[$index]['Version'])) ? $plugin_info[$index]['Version'] : 0; 50 $plugin_dir_url = EN_DAYROSS_DIR_FILE . 'en-hit-to-update-plan.php';50 51 51 $post_data = array( 52 52 'platform' => 'wordpress', 53 53 'carrier' => '79', 54 54 'store_url' => EN_DAYROSS_SERVER_NAME, 55 'webhook_url' => $plugin_dir_url,55 'webhook_url' => '', 56 56 'plugin_version' => $plugin_version, 57 57 'license_key' => get_option('en_connection_settings_license_key_dayross'), … … 82 82 $plugin_info = get_plugins(); 83 83 $plugin_version = (isset($plugin_info[$index]['Version'])) ? $plugin_info[$index]['Version'] : 0; 84 $plugin_dir_url = EN_DAYROSS_DIR_FILE . 'en-hit-to-update-plan.php';84 85 85 $post_data = array( 86 86 'platform' => 'wordpress', 87 87 'carrier' => '79', 88 88 'store_url' => EN_DAYROSS_SERVER_NAME, 89 'webhook_url' => $plugin_dir_url,89 'webhook_url' => '', 90 90 'plugin_version' => $plugin_version, 91 91 'license_key' => get_option('en_connection_settings_license_key_dayross'), … … 152 152 'multi_warehouse' => ['2', '3'], 153 153 'nested_material' => ['3'], 154 'multi_dropships' => ['0', '1', '2', '3'] 154 'multi_dropships' => ['0', '1', '2', '3'], 155 'order_cutt_off_time' => ['2', '3'] 155 156 ]; 156 157 -
ltl-freight-quotes-day-ross-edition/trunk/en-install.php
r3490815 r3494315 67 67 'dayross_backup_rates_cart_price_percentage' => get_option("dayross_backup_rates_cart_price_percentage"), 68 68 'dayross_backup_rates_weight_function' => get_option("dayross_backup_rates_weight_function"), 69 // Cuttoff Time 70 'dayross_order_cut_off_time' => get_option("en_quote_settings_order_cut_off_time_dayross"), 69 71 ]); 70 72 71 wp_enqueue_script('EnDayrossLocationScript', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/js/en-dayross-location.js', [], '1.0. 6');73 wp_enqueue_script('EnDayrossLocationScript', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/js/en-dayross-location.js', [], '1.0.7'); 72 74 wp_localize_script('EnDayrossLocationScript', 'en_dayross_location_script', array( 73 75 'pluginsUrl' => EN_DAYROSS_PLUGIN_URL, … … 80 82 )); 81 83 82 wp_register_style('EnDayrossLocationStyle', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/css/en-dayross-location.css', false, '1.0. 3');84 wp_register_style('EnDayrossLocationStyle', EN_DAYROSS_DIR_FILE . '/admin/tab/location/assets/css/en-dayross-location.css', false, '1.0.4'); 83 85 wp_enqueue_style('EnDayrossLocationStyle'); 84 86 … … 88 90 wp_register_style('EnDayrossProductCss', EN_DAYROSS_DIR_FILE . '/admin/product/assets/en-custom-fields-style.css', false, '1.0.2'); 89 91 wp_enqueue_style('EnDayrossProductCss'); 92 93 // Cuttoff Time 94 wp_register_style('EnDayrossWickedPickerStyle', EN_DAYROSS_DIR_FILE . '/admin/assets/wickedpicker.min.css', false, '1.0.0'); 95 wp_register_script('EnDayrossWickedPickerScript', EN_DAYROSS_DIR_FILE . '/admin/assets/wickedpicker.js', false, '1.0.0'); 96 97 wp_enqueue_style('EnDayrossWickedPickerStyle'); 98 wp_enqueue_script('EnDayrossWickedPickerScript'); 90 99 } 91 100 … … 118 127 function en_dayross_shipping_sections($settings) 119 128 { 120 $settings[] = include('admin/tab/en-tab.php'); 129 $en_tab = include('admin/tab/en-tab.php'); 130 if (is_object($en_tab)) { 131 $settings[] = $en_tab; 132 } 133 121 134 return $settings; 122 135 } -
ltl-freight-quotes-day-ross-edition/trunk/http/en-curl.php
r3428882 r3494315 25 25 static public function en_dayross_sent_http_request($url, $post_data, $method, $step_for = '') { 26 26 $curl_response = ''; 27 $en_time_start = 0; 28 27 29 if (strlen($url) > 0 && is_array($post_data) && !empty($post_data)) { 28 30 29 31 $post_data = self::remove_extra_request_data($post_data); 32 $cachable_data = self::create_cachable_data($post_data); 33 $cache_key = self::create_cache_key($cachable_data); 34 $cache_response = get_transient($cache_key); 35 $skip_cache = in_array($step_for, ['Plan', 'Logs', 'Address', 'Connection']); 30 36 31 // Eniture Execution Time 32 $en_time_start = microtime(true); 37 if ($skip_cache || false === $cache_response) { 38 // Eniture Execution Time 39 $en_time_start = microtime(true); 33 40 34 // Eniture Debug Mood35 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Request ", $post_data);41 // Eniture Debug Mood 42 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Request ", $post_data); 36 43 37 $method == 'POST' ? $post_data = http_build_query($post_data) : '';44 $method == 'POST' ? $post_data = http_build_query($post_data) : ''; 38 45 39 // Eniture Debug Mood40 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Build Query ", $post_data);46 // Eniture Debug Mood 47 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Build Query ", $post_data); 41 48 42 $response = wp_remote_post($url, [ 43 'method' => $method, 44 'timeout' => 60, 45 'redirection' => 5, 46 'blocking' => true, 47 'body' => $post_data, 48 ] 49 ); 50 $curl_response = wp_remote_retrieve_body($response); 51 $headers = wp_remote_retrieve_headers($response); 52 self::eniture_check_rate_limit_headers($headers); 49 $response = wp_remote_post($url, [ 50 'method' => $method, 51 'timeout' => 60, 52 'redirection' => 5, 53 'blocking' => true, 54 'body' => $post_data, 55 ] 56 ); 57 $headers = wp_remote_retrieve_headers($response); 58 self::eniture_check_rate_limit_headers($headers); 59 $curl_response = wp_remote_retrieve_body($response); 60 $resp = !empty($curl_response) && is_string($curl_response) ? json_decode($curl_response, true) : $curl_response; 61 62 if (!empty($resp) && (!isset($resp['severity']) || (isset($resp['severity']) && $resp['severity'] != 'ERROR'))) { 63 set_transient($cache_key, $curl_response, 12 * HOUR_IN_SECONDS); 64 } 65 66 // Eniture Debug Mood 67 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Response ", json_decode($curl_response)); 68 } else { 69 $curl_response = $cache_response; 70 71 // Eniture Debug Mood 72 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Cache Response ", $curl_response); 73 } 53 74 } 54 55 // Eniture Debug Mood56 do_action("eniture_debug_mood", EN_DAYROSS_NAME . " $step_for Response ", json_decode($curl_response));57 75 58 76 // Eniture Execution Time … … 98 116 } 99 117 118 static public function create_cachable_data($request_data) 119 { 120 $cache_keys = ['serverName', 'platform', 'carrierType', 'carrierName', 'carrierMode', 'requestVersion', 'clientId', 'clientSecret', 'requestForNewAPI', 'emailAddress', 'password', 'billToAccountNumber', 'licenseKey', 'dimWeightBaseAccount', 'shipment_type', 'LTL_FREIGHT', 'product_name', 'shipment_weight', 'commdityDetails', 'originAddress', 'receiverZip', 'receiverState', 'receiverCountryCode', 'receiverCity', 'addressLine', 'instorPickupLocalDelEnable', 'doNesting', 'modifyShipmentDateTime', 'OrderCutoffTime', 'shipmentOffsetDays', 'shipmentWeekDays', 'liftGateAsAnOption', 'accessorials', 'handlingUnitWeight', 'maxWeightPerHandlingUnit']; 121 $cachable_data = []; 122 123 // get the data from the request 124 foreach ($cache_keys as $key) { 125 if (isset($request_data[$key])) $cachable_data[$key] = $request_data[$key]; 126 } 127 128 if (isset($request_data['autoResidentials']) && $request_data['autoResidentials'] == 1) { 129 $cachable_data['autoResidentials'] = $request_data['autoResidentials']; 130 $cachable_data['addressLine'] = $request_data['addressLine']; 131 $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : ''; 132 $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType']; 133 $cachable_data['defaultRADWithoutStreetAddress'] = $request_data['defaultRADWithoutStreetAddress']; 134 $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation']; 135 } 136 137 if (isset($request_data['standardPackaging']) && $request_data['standardPackaging'] == 1) { 138 $cachable_data['standardPackaging'] = $request_data['standardPackaging']; 139 $cachable_data['pallet'] = $request_data['pallet']; 140 } 141 142 return $cachable_data; 143 } 144 145 static public function create_cache_key($request_data) 146 { 147 $request_build_query = http_build_query($request_data); 148 return md5('eniture_dayross_' . $request_build_query); 149 } 100 150 } 101 151 -
ltl-freight-quotes-day-ross-edition/trunk/ltl-freight-quotes-dayross-edition.php
r3490815 r3494315 4 4 * Plugin URI: https://eniture.com/products/ 5 5 * Description: Dynamically retrieves your negotiated shipping rates from Day & Ross and displays the results in the WooCommerce shopping cart. 6 * Version: 2.2. 46 * Version: 2.2.5 7 7 * Author: Eniture Technology 8 8 * Author URI: http://eniture.com/ -
ltl-freight-quotes-day-ross-edition/trunk/readme.txt
r3490815 r3494315 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 2.2. 46 Stable tag: 2.2.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 149 149 == Changelog == 150 150 151 = 2.2.5 - 2026-03-30 = 152 * Update: Added cache support to handle duplicate simultaneous quote requests efficiently. 153 * Update: Added delivery estimate options and order cutoff time functionality to the quote settings. 154 * Update: Added bulk delete support for warehouse and drop ship locations. 155 * Update: Added product-level offset days functionality. 156 * Fix: Resolved Broken Access Control vulnerability to improve overall plugin security. 157 151 158 = 2.2.4 - 2026-03-25 = 152 159 * Update: Updated labels text in the connection settings for improved clarity and consistency. -
ltl-freight-quotes-day-ross-edition/trunk/server/api/en-response.php
r3462301 r3494315 318 318 } 319 319 320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $ enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = '';320 $handling_fee = $en_settings_label = $rating_method = $transit_days = $delivery_estimate_option = $enable_carriers = $liftgate_resid_delivery = $liftgate_delivery_option = ''; 321 321 $overlength_fees = []; 322 322 self::$en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); … … 374 374 $label = isset($is_valid_label) && $is_valid_label ? $en_settings_label : 'Freight'; 375 375 $calculated_transit_date = self::en_sanitize_rate('deliveryTimestamp', ''); 376 $calculated_transit_days = self::en_sanitize_rate('totalTransitTimeInDays', ''); 376 377 $append_transit = ''; 377 378 378 if ($rating_method != "average_rate" && is_string($calculated_transit_date) && self::$en_is_shipment == 'en_single_shipment' && strlen($calculated_transit_date) > 0 && $transit_days == "yes") { 379 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 379 if ($rating_method != "average_rate" && isset($delivery_estimate_option) && !empty($delivery_estimate_option) && $delivery_estimate_option != 'dont_show_estimates' && self::$en_is_shipment != 'multi_shipment') { 380 381 if ($delivery_estimate_option == 'delivery_date' && is_string($calculated_transit_date) && strlen($calculated_transit_date) > 0) { 382 $append_transit = ' (Expected delivery by ' . date('m-d-Y', strtotime($calculated_transit_date)) . ')'; 383 } else if ($delivery_estimate_option == 'delivery_days' && is_numeric($calculated_transit_days)) { 384 $append_transit = ' (Intransit days: ' . $calculated_transit_days . ')'; 385 } 380 386 } 381 387 -
ltl-freight-quotes-day-ross-edition/trunk/server/common/en-quote-settings.php
r3462301 r3494315 70 70 $range_5 = isset($range_5) && strlen($range_5) > 0 ? $range_5 : 770; 71 71 72 $dayross_shipment_days = ['all', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday']; 73 $shipment_days = []; 74 foreach ($dayross_shipment_days as $key => $day) { 75 get_option('en_quote_settings_' . $day . '_shipment_day_dayross') == 'yes' ? $shipment_days[] = $key : ''; 76 } 77 72 78 $quote_settings = [ 79 // Cut Off Time & Ship Date Offset 80 'delivery_estimate_option' => get_option('en_quote_settings_delivery_estimate_options_dayross'), 81 'cutt_off_time' => get_option('en_quote_settings_order_cut_off_time_dayross'), 82 'fulfilment_offset_days' => get_option('en_quote_settings_shipment_offset_days_dayross'), 83 'shipment_days' => $shipment_days, 73 84 'transit_days' => get_option('en_quote_settings_show_delivery_estimate_dayross'), 74 85 'own_freight' => get_option('en_quote_settings_own_arrangment_dayross'), -
ltl-freight-quotes-day-ross-edition/trunk/server/en-shipping-rates.php
r3462301 r3494315 221 221 $rate['label'] .= (!empty($label_sufex)) ? ' with ' . implode(' and ', $label_sufex) : ''; 222 222 $rate['label'] .= !empty($rate['append_transit']) ? $rate['append_transit'] : ''; 223 224 // Update rate label in FDO meta data 225 if (isset($rate['meta_data']['en_fdo_meta_data']['rate']['label'])) { 226 $rate['meta_data']['en_fdo_meta_data']['rate']['label'] = $rate['label']; 227 } 228 223 229 isset($rate['cost']) && $en_small_package_charges > 0 ? 224 230 $rate['cost'] = $rate['cost'] + $en_small_package_charges : 0; -
ltl-freight-quotes-day-ross-edition/trunk/server/package/en-package.php
r3462301 r3494315 182 182 // Get product level markup value 183 183 $product_level_markup = self::en_get_product_level_markup($product_data, $product['variation_id'], $product['product_id'], $product['quantity']); 184 $product_level_fulfillment_offset = self::en_get_product_level_fulfillment_offset_days($product_data, $product['variation_id'], $product['product_id']); 184 185 $get_freight = self::en_dayross_get_freight_class($product, $product_data); 185 186 $freightClass_ltl_gross = ($get_freight['freight_class'] == 0) ? $get_freight['freight_class'] = "" : $get_freight['freight_class']; … … 214 215 'markup' => $product_level_markup, 215 216 'lineItemClass' => $freightClass_ltl_gross, 217 'fulfillment_offset_days' => $product_level_fulfillment_offset, 216 218 ]; 217 219 … … 330 332 self::$en_request['commdityDetails'][$origin_zip_code][$is_line_item] = $product_item; 331 333 self::$en_request['originAddress'][$origin_zip_code] = $origin_address; 334 335 // Track maximum fulfillment offset days 336 if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) { 337 if (!isset(self::$en_request['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > self::$en_request['max_fulfillment_offset_days']) { 338 self::$en_request['max_fulfillment_offset_days'] = $product_level_fulfillment_offset; 339 } 340 } 332 341 } 333 342 } … … 405 414 // Configure standard plugin with pallet packaging addon 406 415 self::$en_request = apply_filters('en_pallet_identify', array_merge(EnDayrossConnectionSettings::en_static_request_detail(), self::$en_request)); 416 417 // Add the settings from quote page 418 self::en_dayross_quote_settings_detail(); 407 419 408 420 return self::$en_request; … … 631 643 switch (self::$product_key_name) { 632 644 case '_dropship_location': 645 $_post_id = self::$post_id; 633 646 $enable_dropship = get_post_meta(self::$post_id, '_enable_dropship', true); 647 634 648 // check for parent id 635 649 if (empty($enable_dropship) && self::$parent_id > 0 && self::$parent_id != self::$post_id) { 636 self::$post_id = self::$parent_id;637 $enable_dropship = get_post_meta( self::$post_id, '_enable_dropship', true);650 $_post_id = self::$parent_id; 651 $enable_dropship = get_post_meta($_post_id, '_enable_dropship', true); 638 652 } 639 653 … … 643 657 $all_plugins = apply_filters('active_plugins', get_option('active_plugins')); 644 658 if (stripos(implode($all_plugins), 'micro-warehouse-shipping.php') || is_plugin_active_for_network('micro-warehouse-shipping-for-woocommerce/micro-warehouse-shipping.php')) { 645 $locations_dropship = maybe_unserialize(get_post_meta( self::$post_id, '_dropship_location', true));659 $locations_dropship = maybe_unserialize(get_post_meta($_post_id, '_dropship_location', true)); 646 660 647 661 if(!empty($locations_dropship)) { … … 651 665 } 652 666 653 $en_dayross_get_location = self::en_dayross_get_location(get_post_meta( self::$post_id, self::$product_key_name, true));667 $en_dayross_get_location = self::en_dayross_get_location(get_post_meta($_post_id, self::$product_key_name, true)); 654 668 655 669 if (empty($en_dayross_get_location)) { … … 762 776 } 763 777 778 static public function en_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id) 779 { 780 $fulfillment_offset_days = ''; 781 $field_name = '_eniture_product_level_fulfillment_offset_days'; 782 783 if ($_product->get_type() == 'variation' && $variation_id > 0) { 784 $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true); 785 786 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 787 $parent_id = $_product->get_parent_id(); 788 if ($parent_id > 0) { 789 $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true); 790 } 791 } 792 } else { 793 $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true); 794 } 795 796 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 797 $fulfillment_offset_days = get_post_meta($product_id, $field_name, true); 798 } 799 800 // Validate and sanitize the value before returning 801 if (is_numeric($fulfillment_offset_days)) { 802 $value = intval($fulfillment_offset_days); 803 return $value; 804 } 805 806 // Return empty string if invalid 807 return ''; 808 } 809 810 /** 811 * Quote settings 812 * @param array $location 813 * @return array|false 814 */ 815 static public function en_dayross_quote_settings_detail() { 816 $delivery_estimate_option = $cutt_off_time = $fulfilment_offset_days = ''; 817 $settings = $shipment_days = []; 818 $feature_option = apply_filters("dayross_plans_suscription_and_features", 'order_cutt_off_time'); 819 $en_settings = json_decode(EN_DAYROSS_SET_QUOTE_SETTINGS, true); 820 extract($en_settings); 821 822 // Use product-level fulfillment offset days if available, otherwise use global setting 823 if (isset(self::$en_request['max_fulfillment_offset_days']) && is_numeric(self::$en_request['max_fulfillment_offset_days']) && self::$en_request['max_fulfillment_offset_days'] > 0) { 824 $fulfilment_offset_days = self::$en_request['max_fulfillment_offset_days']; 825 } 826 827 if (!is_array($feature_option) && ($delivery_estimate_option == 'delivery_days' || $delivery_estimate_option == 'delivery_date')) { 828 $settings = [ 829 'modifyShipmentDateTime' => strlen($cutt_off_time) > 0 || strlen($fulfilment_offset_days) > 0 || !empty($shipment_days) ? true : false, 830 'OrderCutoffTime' => $cutt_off_time, 831 'shipmentOffsetDays' => $fulfilment_offset_days, 832 'storeDateTime' => gmdate('Y-m-d H:i:s'), 833 'shipmentWeekDays' => $shipment_days, 834 ]; 835 } 836 837 self::$en_request = array_merge(self::$en_request, $settings); 838 } 839 764 840 } 765 841
Note: See TracChangeset
for help on using the changeset viewer.