Changeset 3468430
- Timestamp:
- 02/24/2026 09:15:45 AM (5 weeks ago)
- Location:
- woot-ro/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (3 diffs)
-
includes/admin/class-woot-admin-order.php (modified) (4 diffs)
-
includes/checkout/class-woot-checkout-fields.php (modified) (2 diffs)
-
includes/shipping/class-woot-shipping-services.php (modified) (2 diffs)
-
woot.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woot-ro/trunk/README.txt
r3467627 r3468430 4 4 Requires at least: 4.0 5 5 Tested up to: 6.9 6 Stable tag: 2.2. 36 Stable tag: 2.2.4 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 78 78 79 79 == Changelog == 80 81 = 2.2.4 = 82 * New: State/county field now visible for all international countries without nomenclature (free text input) 83 * New: Zipcode (postal code) included in all shipping quotation requests 84 * New: County name sent in quotation requests for countries without nomenclature 85 * Fix: State field was hidden for countries without predefined states in classic checkout 80 86 81 87 = 2.2.3 = … … 188 194 == Upgrade Notice == 189 195 196 = 2.2.4 = 197 * International shipping quotations now include zipcode, county name, and state field for all countries. Improved accuracy for cross-border shipping rates. 198 190 199 = 2.2.3 = 191 200 * Shipping options with fixed prices now appear immediately at checkout. Parcel weight minimum enforced at 1kg. -
woot-ro/trunk/includes/admin/class-woot-admin-order.php
r3467627 r3468430 560 560 $city = !empty($address_data['city']) ? $address_data['city'] : ($order->get_shipping_city() ?: $order->get_billing_city()); 561 561 $address = !empty($address_data['address']) ? $address_data['address'] : ($order->get_shipping_address_1() ?: $order->get_billing_address_1()); 562 563 if ($debug) error_log("Woot Admin Quotation: Address - country: $country, state: $state, city: $city, address: $address"); 562 $postcode = !empty($address_data['postcode']) ? $address_data['postcode'] : ($order->get_shipping_postcode() ?: $order->get_billing_postcode()); 563 564 if ($debug) error_log("Woot Admin Quotation: Address - country: $country, state: $state, city: $city, address: $address, postcode: $postcode"); 564 565 565 566 if (empty($country) || empty($city)) { … … 597 598 } else { 598 599 $receiver['city'] = $city; 600 if (!empty($state)) { 601 $states = WC()->countries->get_states($country); 602 $receiver['county_name'] = isset($states[$state]) ? $states[$state] : $state; 603 } 604 } 605 606 // Always send zipcode if available 607 if (!empty($postcode)) { 608 $receiver['zipcode'] = $postcode; 599 609 } 600 610 … … 763 773 $debug['city'] = !empty($address_data['city']) ? $address_data['city'] : ($order->get_shipping_city() ?: $order->get_billing_city()); 764 774 $debug['address'] = !empty($address_data['address']) ? $address_data['address'] : ($order->get_shipping_address_1() ?: $order->get_billing_address_1()); 775 $debug['postcode'] = !empty($address_data['postcode']) ? $address_data['postcode'] : ($order->get_shipping_postcode() ?: $order->get_billing_postcode()); 765 776 766 777 $country_info = Woot_API::get_country_by_code($debug['country']); … … 791 802 if (!empty($city_id)) { 792 803 $receiver['city_id'] = $city_id; 804 } else { 805 $receiver['city'] = $debug['city']; 806 if (!empty($debug['state'])) { 807 $states = WC()->countries->get_states($debug['country']); 808 $receiver['county_name'] = isset($states[$debug['state']]) ? $states[$debug['state']] : $debug['state']; 809 } 810 } 811 812 // Always send zipcode if available 813 if (!empty($debug['postcode'])) { 814 $receiver['zipcode'] = $debug['postcode']; 793 815 } 794 816 -
woot-ro/trunk/includes/checkout/class-woot-checkout-fields.php
r3438930 r3468430 65 65 } 66 66 67 // For Woot countries WITHOUT counties, ensure state field is visible as free text 68 $wc_countries = WC()->countries->get_allowed_countries(); 69 $woot_countries = Woot_API::get_countries(); 70 71 foreach ($woot_countries as $country) { 72 $code = !empty($country['code']) ? strtoupper($country['code']) : ''; 73 if (empty($code) || !isset($wc_countries[$code])) { 74 continue; 75 } 76 // Skip countries that already have counties (handled above) 77 if (isset($woot_states[$code])) { 78 continue; 79 } 80 if (!isset($locale[$code])) { 81 $locale[$code] = array(); 82 } 83 $locale[$code]['state'] = array( 84 'required' => true, 85 'hidden' => false, 86 ); 87 } 88 67 89 return $locale; 68 90 } … … 143 165 foreach ($woot_states as $country_code => $states) { 144 166 $countries[$country_code] = $states; 167 } 168 169 // For Woot countries WITHOUT counties, remove from states list 170 // so WooCommerce JS shows a text input instead of hiding the field 171 $woot_countries = Woot_API::get_countries(); 172 foreach ($woot_countries as $country) { 173 $code = !empty($country['code']) ? strtoupper($country['code']) : ''; 174 if (empty($code) || isset($woot_states[$code])) { 175 continue; 176 } 177 if (isset($countries[$code]) && empty($countries[$code])) { 178 unset($countries[$code]); 179 } 145 180 } 146 181 -
woot-ro/trunk/includes/shipping/class-woot-shipping-services.php
r3467627 r3468430 911 911 $address_1 = $get_value($destination, 'address_1'); 912 912 $address = $get_value($destination, 'address'); 913 $postcode = $get_value($destination, 'postcode'); 913 914 914 915 if ($debug) { 915 error_log("Woot Quotation: Destination - country: $country, city: $city, state: $state ");916 error_log("Woot Quotation: Destination - country: $country, city: $city, state: $state, postcode: $postcode"); 916 917 } 917 918 … … 963 964 $receiver['city_id'] = $city_id; 964 965 } else { 965 // Country has no nomenclature - send city name 966 // Country has no nomenclature - send city name and county name 966 967 $receiver['city'] = $city; 967 968 if ($debug) error_log("Woot Quotation: Using city name: $city"); 968 if (!empty($state)) { 969 $states = WC()->countries->get_states($country); 970 $receiver['county_name'] = isset($states[$state]) ? $states[$state] : $state; 971 } 972 973 if ($debug) error_log("Woot Quotation: Using city name: $city, county_name: " . ($receiver['county_name'] ?? '')); 974 } 975 976 // Always send zipcode if available 977 if (!empty($postcode)) { 978 $receiver['zipcode'] = $postcode; 969 979 } 970 980 -
woot-ro/trunk/woot.php
r3467627 r3468430 17 17 * Plugin URI: https://woot.ro 18 18 * Description: Integrates all popular couriers in Romania, providing a one-stop solution for all your delivery needs 19 * Version: 2.2. 319 * Version: 2.2.4 20 20 * Author: Woot.ro 21 21 * Author URI: https://woot.ro … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('WOOT_VERSION', '2.2. 3');38 define('WOOT_VERSION', '2.2.4'); 39 39 40 40 /**
Note: See TracChangeset
for help on using the changeset viewer.