• Plugin doesn’t work and makes it impossible for you to enter an address on checkout. It disables the form and shows some warning with no info

Viewing 6 replies - 1 through 6 (of 6 total)
  • @calvincanisa May I know whether you have activated the Maps Javascript API in addition to the Places API in Google Cloud Platform?

    I experienced the same issue of disabled form field and found out from the console that the Maps Javascript API is required (https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error). The form is working flawlessly once I have made sure the API key is activated for both Places and Maps Javascript API.

    Maps Javascript API is required despite there is no request for it 🤔 (from my GCP API section)

    Did you ever get this resolved? I’m having same issue and checked Google Cloud Platform and have Maps Javascript API and Places API both enabled as far as I can tell. Although, I am not an expert at this kind of stuff. Perhaps I need to create a new credential just for this plugin application?

    [Edit]: I just created a new API key credential and included both of these API’s but it still didn’t work. I cleared cache as well. When I type in the address field, it lets me type 2 digits then I see a grey exclamation point and locks out the field so I can no longer type in it.

    Update 2: I got it to work properly now and will leave my fix for someone in the future. I had to change two small settings in the API Keys settings in Google Cloud Platform. To do this I clicked on the API key, went to Application Restrictions section and clicked on HTTP Referrers (websites) and entered my website address as such: *website.com/*, then went down to the API Restrictions section and clicked Don’t Restrict Key. After that, form works perfectly fine now.

    One thing I noticed that maybe you know the answer to @cheey2003, when the address autocompletes, it also imports the neighborhood/community name in the Address 2 field. This could be a problem for fulfilling orders because mail carriers do not associate addresses with neighborhood/community name. Do you know how to turn this off so it doesn’t import this part of the address?

    @ehong33234 Thank you very much for sharing your fix on the Google Cloud Platform settings in order for the autocomplete feature to work properly. I always set my settings as Don’t Restrict Key so I have not encountered the issue before 😀

    If you would want to deactivate the neighbourhood/community name for the Address 2, you can do so by commenting out line 83 in the autocomplete.js file

     this.component_form =
            {
                'street_number': ['billing_address_1', 'short_name'],
                'route': ['billing_address_1', 'long_name'],
                'sublocality_level_2': ['billing_address_2', 'long_name'],
                // 'neighborhood' : ['billing_address_2', 'long_name'],
                'locality': ['billing_city', 'long_name'],
                'postal_town': ['billing_city', 'long_name'],
                'sublocality_level_1': ['billing_city', 'long_name'],
                'administrative_area_level_1': ['billing_state', 'short_name'],
                'administrative_area_level_2': ['billing_state', 'short_name'],
                'country': ['billing_country', 'long_name'],
                'postal_code': ['billing_postcode', 'short_name']
            };
        },

    On the other hand, for better field matching logic, we can also do the same in the autocomplete.js file, similar to what I have highlighted in another topic: https://wordpress.org/support/topic/abandoned-plugin-51/?#post-14806274

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘not working’ is closed to new replies.