Changeset 3479759
- Timestamp:
- 03/11/2026 07:03:12 AM (3 weeks ago)
- Location:
- small-package-quotes-wwe-edition
- Files:
-
- 6 deleted
- 20 edited
- 1 copied
-
tags/5.3.8 (copied) (copied from small-package-quotes-wwe-edition/trunk)
-
tags/5.3.8/carrier_service.php (modified) (3 diffs)
-
tags/5.3.8/css/small_packges_style.css (modified) (3 diffs)
-
tags/5.3.8/en-hit-to-update-plan.php (deleted)
-
tags/5.3.8/fdo/en-va.php (deleted)
-
tags/5.3.8/group_small_shipment.php (modified) (11 diffs)
-
tags/5.3.8/js/en-speedship.js (modified) (3 diffs)
-
tags/5.3.8/product/en-product-detail.php (modified) (3 diffs)
-
tags/5.3.8/readme.txt (modified) (2 diffs)
-
tags/5.3.8/small_packages_shipping_class.php (modified) (2 diffs)
-
tags/5.3.8/small_packages_tab_class_woocommrece.php (modified) (2 diffs)
-
tags/5.3.8/template/en-wwe-small-compare-rates.php (deleted)
-
tags/5.3.8/update-plan.php (modified) (4 diffs)
-
tags/5.3.8/woocommerceShip.php (modified) (3 diffs)
-
trunk/carrier_service.php (modified) (3 diffs)
-
trunk/css/small_packges_style.css (modified) (3 diffs)
-
trunk/en-hit-to-update-plan.php (deleted)
-
trunk/fdo/en-va.php (deleted)
-
trunk/group_small_shipment.php (modified) (11 diffs)
-
trunk/js/en-speedship.js (modified) (3 diffs)
-
trunk/product/en-product-detail.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/small_packages_shipping_class.php (modified) (2 diffs)
-
trunk/small_packages_tab_class_woocommrece.php (modified) (2 diffs)
-
trunk/template/en-wwe-small-compare-rates.php (deleted)
-
trunk/update-plan.php (modified) (4 diffs)
-
trunk/woocommerceShip.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
small-package-quotes-wwe-edition/tags/5.3.8/carrier_service.php
r3390867 r3479759 127 127 if ($wwe_small_delivery_estimates == 'delivery_days' || $wwe_small_delivery_estimates == 'delivery_date') { 128 128 $orderCutoffTime = get_option('wwe_small_orderCutoffTime'); 129 $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays'); 129 130 // Use product-level fulfillment offset days if available, otherwise use global setting 131 if (isset($package['max_fulfillment_offset_days']) && is_numeric($package['max_fulfillment_offset_days']) && $package['max_fulfillment_offset_days'] > 0) { 132 $shipmentOffsetDays = $package['max_fulfillment_offset_days']; 133 } else { 134 $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays'); 135 } 136 130 137 $modifyShipmentDateTime = ($orderCutoffTime != '' || $shipmentOffsetDays != '' || (is_array($shipmentWeekDays) && count($shipmentWeekDays) > 0)) ? 1 : 0; 131 138 $storeDateTime = gmdate('Y-m-d H:i:s', current_time('timestamp')); … … 1006 1013 1007 1014 $cachable_data['modifyShipmentDateTime'] = $request_data['modifyShipmentDateTime']; 1015 $cachable_data['OrderCutoffTime'] = $request_data['OrderCutoffTime']; 1016 $cachable_data['shipmentOffsetDays'] = $request_data['shipmentOffsetDays']; 1017 $cachable_data['shipmentWeekDays'] = $request_data['shipmentWeekDays']; 1008 1018 $cachable_data['residentials_delivery'] = $request_data['residentials_delivery']; 1009 1019 $cachable_data['residentials_pickup'] = $request_data['residentials_pickup']; … … 1019 1029 $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : ''; 1020 1030 $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType']; 1031 $cachable_data['defaultRADWithoutStreetAddress'] = isset($request_data['defaultRADWithoutStreetAddress']) ? $request_data['defaultRADWithoutStreetAddress'] : ''; 1021 1032 $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation']; 1022 1033 } -
small-package-quotes-wwe-edition/tags/5.3.8/css/small_packges_style.css
r3430551 r3479759 725 725 .woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"], 726 726 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 727 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 727 728 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 728 729 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], … … 748 749 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], 749 750 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 751 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 750 752 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 751 753 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"], … … 757 759 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip, 758 760 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip, 761 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip, 759 762 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip, 760 763 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip, -
small-package-quotes-wwe-edition/tags/5.3.8/group_small_shipment.php
r3430551 r3479759 33 33 public $destination_Address_wwe_spq; 34 34 public $origin = []; 35 private $parent_nesting_enabled = false; 35 36 36 37 /** … … 189 190 $ptype = $this->wwe_small_check_product_type($freight_enable_class, $exceedWeight, $product_weight, $en_multiple_package); 190 191 $insurance = $this->en_insurance_checked($values, $_product); 191 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity'], $product_price); 192 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $values['product_id'], $values['quantity'], $product_price); 193 $product_level_fulfillment_offset = $this->wwe_small_get_product_level_fulfillment_offset_days($_product, $values['variation_id'], $values['product_id']); 192 194 $locationId = (isset($origin_address['locationId'])) ? $origin_address['locationId'] : 0; 193 195 $locationZip = (isset($origin_address['zip'])) ? $origin_address['zip'] : ''; … … 227 229 if (!empty($origin_address) && ($product_weight <= $weight_threshold || $en_multiple_package == 'yes')) { 228 230 // Nested Material 231 $this->parent_nesting_enabled = false; 229 232 $nested_material = $this->en_nested_material($values, $_product); 230 233 if ($nested_material == "yes") { … … 241 244 $hm_status = (!is_array($hm_plan) && $hazardous_material == 'yes') ? TRUE : FALSE; 242 245 243 $product_title = str_replace(array("'", '"', '’'), '', $_product->get_ title());246 $product_title = str_replace(array("'", '"', '’'), '', $_product->get_name()); 244 247 245 248 // Shippable handling units … … 291 294 'product_quantity' => $product_quantity, 292 295 'product_price' => $product_price, 296 'fulfillment_offset_days' => $product_level_fulfillment_offset, 293 297 ); 294 298 … … 340 344 $sm_package[$locationId]['product_prices'] = (floatval($_product->get_price()) * floatval($values['quantity'])); 341 345 } 346 347 // Track maximum fulfillment offset days 348 if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) { 349 if (!isset($sm_package[$locationId]['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > $sm_package[$locationId]['max_fulfillment_offset_days']) { 350 $sm_package[$locationId]['max_fulfillment_offset_days'] = $product_level_fulfillment_offset; 351 } 352 } 342 353 } 343 354 … … 401 412 402 413 // Micro Warehouse 403 $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes'); 404 $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small'); 414 if (!empty($this->dropship_location_array)) { 415 $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes'); 416 $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small'); 417 } 418 405 419 do_action("eniture_debug_mood", "Product Detail (s)", $sm_package); 406 420 return $sm_package; 407 421 } 422 408 423 return false; 409 424 } … … 563 578 $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id(); 564 579 $nested_material = get_post_meta($post_id, '_nestedMaterials', true); 580 $this->parent_nesting_enabled = true; 565 581 } 566 582 … … 664 680 $post_id = isset($values['product_id']) ? $values['product_id'] : $post_id; 665 681 $enable_dropship = get_post_meta($post_id, '_enable_dropship', true); 682 $post_id = empty($enable_dropship) ? $values['variation_id'] : $post_id; 666 683 } 667 684 … … 923 940 924 941 // check property in parent 925 if ( isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled)) {942 if ($this->parent_nesting_enabled || (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled))) { 926 943 $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id(); 927 944 $property_enabled = get_post_meta($post_id, $property_key, true); … … 930 947 return $property_enabled; 931 948 } 949 950 function wwe_small_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id) 951 { 952 $fulfillment_offset_days = ''; 953 $field_name = '_eniture_product_level_fulfillment_offset_days'; 954 955 if ($_product->get_type() == 'variation' && $variation_id > 0) { 956 $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true); 957 958 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 959 $parent_id = $_product->get_parent_id(); 960 if ($parent_id > 0) { 961 $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true); 962 } 963 } 964 } else { 965 $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true); 966 } 967 968 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 969 $fulfillment_offset_days = get_post_meta($product_id, $field_name, true); 970 } 971 972 // Validate and sanitize the value before returning 973 if (is_numeric($fulfillment_offset_days)) { 974 $value = intval($fulfillment_offset_days); 975 return $value; 976 } 977 978 // Return empty string if invalid 979 return ''; 980 } 932 981 } -
small-package-quotes-wwe-edition/tags/5.3.8/js/en-speedship.js
r3393484 r3479759 439 439 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays < 1) { 440 440 441 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Days should not be less than1.</p></div>');441 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be greater than or equal to 1.</p></div>'); 442 442 jQuery('html, body').animate({ 443 443 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top … … 446 446 return false 447 447 } 448 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 8) {449 450 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Days should be less than or equal to 8.</p></div>');448 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 20) { 449 450 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be less than or equal to 20.</p></div>'); 451 451 jQuery('html, body').animate({ 452 452 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top … … 456 456 } 457 457 458 var numberOnlyRegex = /^[0-9]+$/; 459 458 const numberOnlyRegex = /^[0-9]+$/; 460 459 if (wwe_small_shipmentOffsetDays != "" && !numberOnlyRegex.test(wwe_small_shipmentOffsetDays)) { 461 460 462 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Entered Days are not valid.</p></div>');461 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be a number.</p></div>'); 463 462 jQuery('html, body').animate({ 464 463 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top -
small-package-quotes-wwe-edition/tags/5.3.8/product/en-product-detail.php
r3244589 r3479759 191 191 ], 192 192 [ 193 'type' => 'input_field', 194 'input_type' => 'number', 195 'id' => '_eniture_product_level_fulfillment_offset_days', 196 'class' => '_eniture_product_level_fulfillment_offset_days short', 197 'label' => __( 'Fulfillment Offset Days', 'woocommerce' ), 198 'placeholder' => 'Fulfillment offset days, e.g. 2', 199 '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.", 200 'custom_attributes' => [ 201 'min' => '1', 202 'max' => '20', 203 'step' => '1', 204 'title' => 'Value must be greater than or equal to 1 and less than or equal to 20', 205 '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' : '')", 206 'oninput' => "this.setCustomValidity('')" 207 ] 208 ], 209 [ 193 210 'type' => 'checkbox', 194 211 'id' => '_hazardousmaterials', … … 309 326 } 310 327 328 // Add input type if specified (e.g., 'number') 329 if (isset($custom_field['input_type'])) { 330 $custom_input_field['type'] = $custom_field['input_type']; 331 } 332 333 // Add custom attributes if specified (e.g., min, max, step) 334 if (isset($custom_field['custom_attributes'])) { 335 $custom_input_field['custom_attributes'] = $custom_field['custom_attributes']; 336 } 337 311 338 woocommerce_wp_text_input($custom_input_field); 312 339 } … … 377 404 $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : ''; 378 405 $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash($_POST[$custom_field][$postId])) : ''; 406 407 if ($custom_field == '_dropship_location') { 408 $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product); 409 } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') { 410 $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product); 411 } else { 412 $en_updated_product = esc_attr($en_updated_product); 413 } 414 379 415 update_post_meta($postId, $custom_field, $en_updated_product); 380 416 } 381 417 } 418 } 419 420 private function sanitize_fulfillment_offset_days($value) 421 { 422 $value = trim($value); 423 if ($value === '' || $value === null) return ''; 424 425 $value = preg_replace('/[^0-9.-]/', '', $value); 426 if (!is_numeric($value)) return ''; 427 428 $value = intval(floor(floatval($value))); 429 return $value < 0 ? '' : strval($value); 382 430 } 383 431 -
small-package-quotes-wwe-edition/tags/5.3.8/readme.txt
r3472383 r3479759 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 5.3. 76 Stable tag: 5.3.8 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 142 142 == Changelog == 143 143 144 = 5.3.7 - 2026-03-02 = 145 * Fix: Resolved JS files minification conflict with the WP Rocket plugin to ensure compatibility with asset optimization. 144 = 5.3.8 - 2026-03-11 = 145 * Update: Added product-level offset days functionality to allow more granular shipment timing control. 146 * Update: Added Quote Information Preference setting to control whether quote information is recorded and displayed in the Additional Order Details widget. 147 * Fix: Resolved Broken Access Control vulnerability to improve overall plugin security. 146 148 147 149 = 5.3.6 - 2026-01-01 = -
small-package-quotes-wwe-edition/tags/5.3.8/small_packages_shipping_class.php
r3430551 r3479759 563 563 // apply minimum shipping charge shipping rules (Cart level) and get updated rates 564 564 $en_rates = $this->get_updated_rates($sm_package, $en_rates, $en_is_shipment); 565 $save_order_meta_data = get_option('wwe_small_quote_information_preference'); 566 $save_packaging_data = get_option('box_sizing_packaging_solution_preference'); 565 567 566 568 foreach ($en_rates as $accessorial => $rate) { … … 597 599 // Images for FDO 598 600 $rate['meta_data']['en_fdo_image_urls'] = wp_json_encode($image_urls); 601 602 // Remove meta data and packaging data if not required 603 if ($save_order_meta_data == 'no') unset($rate['meta_data']['en_fdo_meta_data']); 604 if ($save_packaging_data == 'no') unset($rate['meta_data']['bin_packaging']); 599 605 } 600 606 -
small-package-quotes-wwe-edition/tags/5.3.8/small_packages_tab_class_woocommrece.php
r3393484 r3479759 464 464 'id' => 'shipping_methods_do_not_sort_by_price' 465 465 ), 466 'wwe_small_quote_information_preference' => array( 467 'name' => __('Quote Information Preference', 'woocommerce-settings-fedex_small_quotes'), 468 'type' => 'radio', 469 'default' => 'yes', 470 'id' => 'wwe_small_quote_information_preference', 471 'options' => array( 472 'yes' => __('Record it in the Additional Order Details widget. (Default)', 'woocommerce-settings-fedex_small_quotes'), 473 'no' => __('Don\'t record it in the Additional Order Details widget.', 'woocommerce-settings-fedex_small_quotes'), 474 ), 475 ), 466 476 467 477 // Package rating method when Standard Box Sizes isn't in use … … 516 526 ), 517 527 'shipmentOffsetDays_wwe_small' => array( 518 'name' => __('Fulfil ment Offset Days ', 'small-package-quotes-wwe-edition'),519 'type' => 'text', 520 'desc' => 'The number of days the ship date needs to be moved to allow the processing of the order.',521 'placeholder' => 'Fulfil ment Offset Days, e.g. 2',528 'name' => __('Fulfillment Offset Days ', 'small-package-quotes-wwe-edition'), 529 'type' => 'text', 530 'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.', 531 'placeholder' => 'Fulfillment Offset Days, e.g. 2', 522 532 'id' => 'wwe_small_shipmentOffsetDays', 523 533 'class' => $disable_cot_sdo, -
small-package-quotes-wwe-edition/tags/5.3.8/update-plan.php
r3313674 r3479759 27 27 $plugin_info = get_plugins(); 28 28 $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : ''; 29 30 29 $domain = eniture_wwe_small_get_domain(); 31 $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';32 30 33 31 $post_data = array( … … 35 33 'carrier' => '2', 36 34 'store_url' => $domain, 37 'webhook_url' => $plugin_dir_url,35 'webhook_url' => '', 38 36 'plugin_version' => $plugin_version, 39 37 ); … … 78 76 $plugin_info = get_plugins(); 79 77 $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : ''; 80 81 78 $domain = eniture_wwe_small_get_domain(); 82 $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';83 79 84 80 $post_data = array( … … 86 82 'carrier' => '2', 87 83 'store_url' => $domain, 88 'webhook_url' => $plugin_dir_url,84 'webhook_url' => '', 89 85 'plugin_version' => $plugin_version, 90 86 ); -
small-package-quotes-wwe-edition/tags/5.3.8/woocommerceShip.php
r3472383 r3479759 6 6 Author: Eniture Technology 7 7 Author URI: https://eniture.com/ 8 Version: 5.3. 78 Version: 5.3.8 9 9 Text Domain: small-package-quotes-wwe-edition 10 License: GPLv2 or later 11 Requires Plugins: woocommerce 10 License: GPL-2.0-or-later 12 11 */ 13 12 /* … … 161 160 { 162 161 wp_enqueue_script('jquery'); 163 wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1. 7');162 wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.8'); 164 163 wp_localize_script('en_speedship_script', 'en_speedship_admin_script', array( 165 164 'plugins_url' => plugins_url(), … … 231 230 function eniture_wwe_smpkg_admin_script() 232 231 { 233 wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2. 7');232 wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.8'); 234 233 wp_enqueue_style('small_packges_style'); 235 234 -
small-package-quotes-wwe-edition/trunk/carrier_service.php
r3390867 r3479759 127 127 if ($wwe_small_delivery_estimates == 'delivery_days' || $wwe_small_delivery_estimates == 'delivery_date') { 128 128 $orderCutoffTime = get_option('wwe_small_orderCutoffTime'); 129 $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays'); 129 130 // Use product-level fulfillment offset days if available, otherwise use global setting 131 if (isset($package['max_fulfillment_offset_days']) && is_numeric($package['max_fulfillment_offset_days']) && $package['max_fulfillment_offset_days'] > 0) { 132 $shipmentOffsetDays = $package['max_fulfillment_offset_days']; 133 } else { 134 $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays'); 135 } 136 130 137 $modifyShipmentDateTime = ($orderCutoffTime != '' || $shipmentOffsetDays != '' || (is_array($shipmentWeekDays) && count($shipmentWeekDays) > 0)) ? 1 : 0; 131 138 $storeDateTime = gmdate('Y-m-d H:i:s', current_time('timestamp')); … … 1006 1013 1007 1014 $cachable_data['modifyShipmentDateTime'] = $request_data['modifyShipmentDateTime']; 1015 $cachable_data['OrderCutoffTime'] = $request_data['OrderCutoffTime']; 1016 $cachable_data['shipmentOffsetDays'] = $request_data['shipmentOffsetDays']; 1017 $cachable_data['shipmentWeekDays'] = $request_data['shipmentWeekDays']; 1008 1018 $cachable_data['residentials_delivery'] = $request_data['residentials_delivery']; 1009 1019 $cachable_data['residentials_pickup'] = $request_data['residentials_pickup']; … … 1019 1029 $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : ''; 1020 1030 $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType']; 1031 $cachable_data['defaultRADWithoutStreetAddress'] = isset($request_data['defaultRADWithoutStreetAddress']) ? $request_data['defaultRADWithoutStreetAddress'] : ''; 1021 1032 $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation']; 1022 1033 } -
small-package-quotes-wwe-edition/trunk/css/small_packges_style.css
r3430551 r3479759 725 725 .woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"], 726 726 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 727 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 727 728 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 728 729 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], … … 748 749 .woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"], 749 750 .woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"], 751 .woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"], 750 752 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"], 751 753 .woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"], … … 757 759 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip, 758 760 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip, 761 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip, 759 762 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip, 760 763 .woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip, -
small-package-quotes-wwe-edition/trunk/group_small_shipment.php
r3430551 r3479759 33 33 public $destination_Address_wwe_spq; 34 34 public $origin = []; 35 private $parent_nesting_enabled = false; 35 36 36 37 /** … … 189 190 $ptype = $this->wwe_small_check_product_type($freight_enable_class, $exceedWeight, $product_weight, $en_multiple_package); 190 191 $insurance = $this->en_insurance_checked($values, $_product); 191 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity'], $product_price); 192 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $values['product_id'], $values['quantity'], $product_price); 193 $product_level_fulfillment_offset = $this->wwe_small_get_product_level_fulfillment_offset_days($_product, $values['variation_id'], $values['product_id']); 192 194 $locationId = (isset($origin_address['locationId'])) ? $origin_address['locationId'] : 0; 193 195 $locationZip = (isset($origin_address['zip'])) ? $origin_address['zip'] : ''; … … 227 229 if (!empty($origin_address) && ($product_weight <= $weight_threshold || $en_multiple_package == 'yes')) { 228 230 // Nested Material 231 $this->parent_nesting_enabled = false; 229 232 $nested_material = $this->en_nested_material($values, $_product); 230 233 if ($nested_material == "yes") { … … 241 244 $hm_status = (!is_array($hm_plan) && $hazardous_material == 'yes') ? TRUE : FALSE; 242 245 243 $product_title = str_replace(array("'", '"', '’'), '', $_product->get_ title());246 $product_title = str_replace(array("'", '"', '’'), '', $_product->get_name()); 244 247 245 248 // Shippable handling units … … 291 294 'product_quantity' => $product_quantity, 292 295 'product_price' => $product_price, 296 'fulfillment_offset_days' => $product_level_fulfillment_offset, 293 297 ); 294 298 … … 340 344 $sm_package[$locationId]['product_prices'] = (floatval($_product->get_price()) * floatval($values['quantity'])); 341 345 } 346 347 // Track maximum fulfillment offset days 348 if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) { 349 if (!isset($sm_package[$locationId]['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > $sm_package[$locationId]['max_fulfillment_offset_days']) { 350 $sm_package[$locationId]['max_fulfillment_offset_days'] = $product_level_fulfillment_offset; 351 } 352 } 342 353 } 343 354 … … 401 412 402 413 // Micro Warehouse 403 $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes'); 404 $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small'); 414 if (!empty($this->dropship_location_array)) { 415 $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes'); 416 $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small'); 417 } 418 405 419 do_action("eniture_debug_mood", "Product Detail (s)", $sm_package); 406 420 return $sm_package; 407 421 } 422 408 423 return false; 409 424 } … … 563 578 $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id(); 564 579 $nested_material = get_post_meta($post_id, '_nestedMaterials', true); 580 $this->parent_nesting_enabled = true; 565 581 } 566 582 … … 664 680 $post_id = isset($values['product_id']) ? $values['product_id'] : $post_id; 665 681 $enable_dropship = get_post_meta($post_id, '_enable_dropship', true); 682 $post_id = empty($enable_dropship) ? $values['variation_id'] : $post_id; 666 683 } 667 684 … … 923 940 924 941 // check property in parent 925 if ( isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled)) {942 if ($this->parent_nesting_enabled || (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled))) { 926 943 $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id(); 927 944 $property_enabled = get_post_meta($post_id, $property_key, true); … … 930 947 return $property_enabled; 931 948 } 949 950 function wwe_small_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id) 951 { 952 $fulfillment_offset_days = ''; 953 $field_name = '_eniture_product_level_fulfillment_offset_days'; 954 955 if ($_product->get_type() == 'variation' && $variation_id > 0) { 956 $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true); 957 958 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 959 $parent_id = $_product->get_parent_id(); 960 if ($parent_id > 0) { 961 $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true); 962 } 963 } 964 } else { 965 $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true); 966 } 967 968 if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) { 969 $fulfillment_offset_days = get_post_meta($product_id, $field_name, true); 970 } 971 972 // Validate and sanitize the value before returning 973 if (is_numeric($fulfillment_offset_days)) { 974 $value = intval($fulfillment_offset_days); 975 return $value; 976 } 977 978 // Return empty string if invalid 979 return ''; 980 } 932 981 } -
small-package-quotes-wwe-edition/trunk/js/en-speedship.js
r3393484 r3479759 439 439 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays < 1) { 440 440 441 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Days should not be less than1.</p></div>');441 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be greater than or equal to 1.</p></div>'); 442 442 jQuery('html, body').animate({ 443 443 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top … … 446 446 return false 447 447 } 448 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 8) {449 450 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Days should be less than or equal to 8.</p></div>');448 if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 20) { 449 450 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be less than or equal to 20.</p></div>'); 451 451 jQuery('html, body').animate({ 452 452 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top … … 456 456 } 457 457 458 var numberOnlyRegex = /^[0-9]+$/; 459 458 const numberOnlyRegex = /^[0-9]+$/; 460 459 if (wwe_small_shipmentOffsetDays != "" && !numberOnlyRegex.test(wwe_small_shipmentOffsetDays)) { 461 460 462 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong> Entered Days are not valid.</p></div>');461 jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be a number.</p></div>'); 463 462 jQuery('html, body').animate({ 464 463 'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top -
small-package-quotes-wwe-edition/trunk/product/en-product-detail.php
r3244589 r3479759 191 191 ], 192 192 [ 193 'type' => 'input_field', 194 'input_type' => 'number', 195 'id' => '_eniture_product_level_fulfillment_offset_days', 196 'class' => '_eniture_product_level_fulfillment_offset_days short', 197 'label' => __( 'Fulfillment Offset Days', 'woocommerce' ), 198 'placeholder' => 'Fulfillment offset days, e.g. 2', 199 '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.", 200 'custom_attributes' => [ 201 'min' => '1', 202 'max' => '20', 203 'step' => '1', 204 'title' => 'Value must be greater than or equal to 1 and less than or equal to 20', 205 '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' : '')", 206 'oninput' => "this.setCustomValidity('')" 207 ] 208 ], 209 [ 193 210 'type' => 'checkbox', 194 211 'id' => '_hazardousmaterials', … … 309 326 } 310 327 328 // Add input type if specified (e.g., 'number') 329 if (isset($custom_field['input_type'])) { 330 $custom_input_field['type'] = $custom_field['input_type']; 331 } 332 333 // Add custom attributes if specified (e.g., min, max, step) 334 if (isset($custom_field['custom_attributes'])) { 335 $custom_input_field['custom_attributes'] = $custom_field['custom_attributes']; 336 } 337 311 338 woocommerce_wp_text_input($custom_input_field); 312 339 } … … 377 404 $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : ''; 378 405 $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash($_POST[$custom_field][$postId])) : ''; 406 407 if ($custom_field == '_dropship_location') { 408 $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product); 409 } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') { 410 $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product); 411 } else { 412 $en_updated_product = esc_attr($en_updated_product); 413 } 414 379 415 update_post_meta($postId, $custom_field, $en_updated_product); 380 416 } 381 417 } 418 } 419 420 private function sanitize_fulfillment_offset_days($value) 421 { 422 $value = trim($value); 423 if ($value === '' || $value === null) return ''; 424 425 $value = preg_replace('/[^0-9.-]/', '', $value); 426 if (!is_numeric($value)) return ''; 427 428 $value = intval(floor(floatval($value))); 429 return $value < 0 ? '' : strval($value); 382 430 } 383 431 -
small-package-quotes-wwe-edition/trunk/readme.txt
r3472383 r3479759 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 5.3. 76 Stable tag: 5.3.8 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 142 142 == Changelog == 143 143 144 = 5.3.7 - 2026-03-02 = 145 * Fix: Resolved JS files minification conflict with the WP Rocket plugin to ensure compatibility with asset optimization. 144 = 5.3.8 - 2026-03-11 = 145 * Update: Added product-level offset days functionality to allow more granular shipment timing control. 146 * Update: Added Quote Information Preference setting to control whether quote information is recorded and displayed in the Additional Order Details widget. 147 * Fix: Resolved Broken Access Control vulnerability to improve overall plugin security. 146 148 147 149 = 5.3.6 - 2026-01-01 = -
small-package-quotes-wwe-edition/trunk/small_packages_shipping_class.php
r3430551 r3479759 563 563 // apply minimum shipping charge shipping rules (Cart level) and get updated rates 564 564 $en_rates = $this->get_updated_rates($sm_package, $en_rates, $en_is_shipment); 565 $save_order_meta_data = get_option('wwe_small_quote_information_preference'); 566 $save_packaging_data = get_option('box_sizing_packaging_solution_preference'); 565 567 566 568 foreach ($en_rates as $accessorial => $rate) { … … 597 599 // Images for FDO 598 600 $rate['meta_data']['en_fdo_image_urls'] = wp_json_encode($image_urls); 601 602 // Remove meta data and packaging data if not required 603 if ($save_order_meta_data == 'no') unset($rate['meta_data']['en_fdo_meta_data']); 604 if ($save_packaging_data == 'no') unset($rate['meta_data']['bin_packaging']); 599 605 } 600 606 -
small-package-quotes-wwe-edition/trunk/small_packages_tab_class_woocommrece.php
r3393484 r3479759 464 464 'id' => 'shipping_methods_do_not_sort_by_price' 465 465 ), 466 'wwe_small_quote_information_preference' => array( 467 'name' => __('Quote Information Preference', 'woocommerce-settings-fedex_small_quotes'), 468 'type' => 'radio', 469 'default' => 'yes', 470 'id' => 'wwe_small_quote_information_preference', 471 'options' => array( 472 'yes' => __('Record it in the Additional Order Details widget. (Default)', 'woocommerce-settings-fedex_small_quotes'), 473 'no' => __('Don\'t record it in the Additional Order Details widget.', 'woocommerce-settings-fedex_small_quotes'), 474 ), 475 ), 466 476 467 477 // Package rating method when Standard Box Sizes isn't in use … … 516 526 ), 517 527 'shipmentOffsetDays_wwe_small' => array( 518 'name' => __('Fulfil ment Offset Days ', 'small-package-quotes-wwe-edition'),519 'type' => 'text', 520 'desc' => 'The number of days the ship date needs to be moved to allow the processing of the order.',521 'placeholder' => 'Fulfil ment Offset Days, e.g. 2',528 'name' => __('Fulfillment Offset Days ', 'small-package-quotes-wwe-edition'), 529 'type' => 'text', 530 'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.', 531 'placeholder' => 'Fulfillment Offset Days, e.g. 2', 522 532 'id' => 'wwe_small_shipmentOffsetDays', 523 533 'class' => $disable_cot_sdo, -
small-package-quotes-wwe-edition/trunk/update-plan.php
r3313674 r3479759 27 27 $plugin_info = get_plugins(); 28 28 $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : ''; 29 30 29 $domain = eniture_wwe_small_get_domain(); 31 $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';32 30 33 31 $post_data = array( … … 35 33 'carrier' => '2', 36 34 'store_url' => $domain, 37 'webhook_url' => $plugin_dir_url,35 'webhook_url' => '', 38 36 'plugin_version' => $plugin_version, 39 37 ); … … 78 76 $plugin_info = get_plugins(); 79 77 $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : ''; 80 81 78 $domain = eniture_wwe_small_get_domain(); 82 $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';83 79 84 80 $post_data = array( … … 86 82 'carrier' => '2', 87 83 'store_url' => $domain, 88 'webhook_url' => $plugin_dir_url,84 'webhook_url' => '', 89 85 'plugin_version' => $plugin_version, 90 86 ); -
small-package-quotes-wwe-edition/trunk/woocommerceShip.php
r3472383 r3479759 6 6 Author: Eniture Technology 7 7 Author URI: https://eniture.com/ 8 Version: 5.3. 78 Version: 5.3.8 9 9 Text Domain: small-package-quotes-wwe-edition 10 License: GPLv2 or later 11 Requires Plugins: woocommerce 10 License: GPL-2.0-or-later 12 11 */ 13 12 /* … … 161 160 { 162 161 wp_enqueue_script('jquery'); 163 wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1. 7');162 wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.8'); 164 163 wp_localize_script('en_speedship_script', 'en_speedship_admin_script', array( 165 164 'plugins_url' => plugins_url(), … … 231 230 function eniture_wwe_smpkg_admin_script() 232 231 { 233 wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2. 7');232 wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.8'); 234 233 wp_enqueue_style('small_packges_style'); 235 234
Note: See TracChangeset
for help on using the changeset viewer.