Changeset 2938346
- Timestamp:
- 07/13/2023 04:28:02 PM (3 years ago)
- Location:
- address-autocomplete-google-places
- Files:
-
- 6 edited
- 1 copied
-
tags/1.1.1 (copied) (copied from address-autocomplete-google-places/trunk)
-
tags/1.1.1/address-autocomplete.php (modified) (2 diffs)
-
tags/1.1.1/assets/address-autocomplete.js (modified) (2 diffs)
-
tags/1.1.1/readme.txt (modified) (3 diffs)
-
trunk/address-autocomplete.php (modified) (2 diffs)
-
trunk/assets/address-autocomplete.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
address-autocomplete-google-places/tags/1.1.1/address-autocomplete.php
r2878134 r2938346 1 1 <?php 2 2 /** 3 * Plugin Name: Address Autocomplete Google Places3 * Plugin Name: Address Autocomplete with Google Places 4 4 * Plugin URI: https://github.com/devpress/address-autocomplete-google-places 5 5 * Description: Enables address autocomplete with Google Places API for WooCommerce. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: DevPress 8 8 * Author URI: https://devpress.com … … 10 10 * Requires at least: 6.0 11 11 * Requires PHP: 7.2 12 * Tested up to: 6. 1.112 * Tested up to: 6.2.2 13 13 * 14 14 * WC requires at least: 5.6.0 15 * WC tested up to: 7. 2.215 * WC tested up to: 7.8.2 16 16 * 17 17 * License: GNU General Public License v3.0 -
address-autocomplete-google-places/tags/1.1.1/assets/address-autocomplete.js
r2878134 r2938346 105 105 const addressComponents = place.address_components; 106 106 107 // Useful for debugging. 108 if (false) { 109 for (const component of place.address_components) { 110 const componentType = component.types[0]; 111 console.log(componentType); 112 console.log(component); 113 } 114 } 115 107 116 // Get country first since address components vary by country. 108 117 const country = this.getAddressComponentShortName( … … 130 139 ); 131 140 if (stateField.tagName == "SELECT") { 132 stateField.value = stateComponent.short_name;133 141 Array.prototype.forEach.call(stateField.options, function (option) { 134 if (stateComponent.short_name == option.value) { 142 // We can generally assume the shortname will be the value. 143 if (option.value == stateComponent.short_name) { 144 stateField.value = stateComponent.short_name; 145 option.selected = true; 146 return true; 147 } 148 149 // But if there isn't a match, we can try the long name. 150 // This was implemented for Mexico. 151 if (option.text == stateComponent.long_name) { 152 stateField.value = stateComponent.long_name; 135 153 option.selected = true; 136 154 return true; -
address-autocomplete-google-places/tags/1.1.1/readme.txt
r2878134 r2938346 4 4 Tags: woocommerce 5 5 Requires at least: 6.0 6 Tested up to: 6. 1.17 Stable tag: 1.1. 06 Tested up to: 6.2.2 7 Stable tag: 1.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 23 23 24 24 == Frequently Asked Questions == 25 26 = What countries are supported? = 27 28 This extension should work for any country Google Places supports. It has been tested with: 29 30 * Canada (CA) 31 * Mexico (MX) 32 * Portugal (PT) 33 * Puerto Rico (PR) 34 * United Kingdom (UK) 35 * United States (US) 36 37 If you find a bug or issue with address parsing for a specific country, please reach out to support! 25 38 26 39 = How do I get a Google Places API Key? = … … 49 62 == Changelog == 50 63 64 = 1.1.1 = 65 66 * Update: Support for Mexico. 67 51 68 = 1.1.0 = 52 69 -
address-autocomplete-google-places/trunk/address-autocomplete.php
r2878134 r2938346 1 1 <?php 2 2 /** 3 * Plugin Name: Address Autocomplete Google Places3 * Plugin Name: Address Autocomplete with Google Places 4 4 * Plugin URI: https://github.com/devpress/address-autocomplete-google-places 5 5 * Description: Enables address autocomplete with Google Places API for WooCommerce. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: DevPress 8 8 * Author URI: https://devpress.com … … 10 10 * Requires at least: 6.0 11 11 * Requires PHP: 7.2 12 * Tested up to: 6. 1.112 * Tested up to: 6.2.2 13 13 * 14 14 * WC requires at least: 5.6.0 15 * WC tested up to: 7. 2.215 * WC tested up to: 7.8.2 16 16 * 17 17 * License: GNU General Public License v3.0 -
address-autocomplete-google-places/trunk/assets/address-autocomplete.js
r2878134 r2938346 105 105 const addressComponents = place.address_components; 106 106 107 // Useful for debugging. 108 if (false) { 109 for (const component of place.address_components) { 110 const componentType = component.types[0]; 111 console.log(componentType); 112 console.log(component); 113 } 114 } 115 107 116 // Get country first since address components vary by country. 108 117 const country = this.getAddressComponentShortName( … … 130 139 ); 131 140 if (stateField.tagName == "SELECT") { 132 stateField.value = stateComponent.short_name;133 141 Array.prototype.forEach.call(stateField.options, function (option) { 134 if (stateComponent.short_name == option.value) { 142 // We can generally assume the shortname will be the value. 143 if (option.value == stateComponent.short_name) { 144 stateField.value = stateComponent.short_name; 145 option.selected = true; 146 return true; 147 } 148 149 // But if there isn't a match, we can try the long name. 150 // This was implemented for Mexico. 151 if (option.text == stateComponent.long_name) { 152 stateField.value = stateComponent.long_name; 135 153 option.selected = true; 136 154 return true; -
address-autocomplete-google-places/trunk/readme.txt
r2878134 r2938346 4 4 Tags: woocommerce 5 5 Requires at least: 6.0 6 Tested up to: 6. 1.17 Stable tag: 1.1. 06 Tested up to: 6.2.2 7 Stable tag: 1.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 23 23 24 24 == Frequently Asked Questions == 25 26 = What countries are supported? = 27 28 This extension should work for any country Google Places supports. It has been tested with: 29 30 * Canada (CA) 31 * Mexico (MX) 32 * Portugal (PT) 33 * Puerto Rico (PR) 34 * United Kingdom (UK) 35 * United States (US) 36 37 If you find a bug or issue with address parsing for a specific country, please reach out to support! 25 38 26 39 = How do I get a Google Places API Key? = … … 49 62 == Changelog == 50 63 64 = 1.1.1 = 65 66 * Update: Support for Mexico. 67 51 68 = 1.1.0 = 52 69
Note: See TracChangeset
for help on using the changeset viewer.