• Jaso

    (@subwebsites)


    Is this an Abandoned Plugin as I don’t see any support questions answered???

    Hard to know whether to use this as there’s no help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jaso

    (@subwebsites)

    This does not complete the CHINESE State Province as seen here:
    https://prnt.sc/zs4wlu

    How to fix?

    Also for Italian.. Let us Know !!
    How a plugin can be there if there’s no any type of support ?

    @subwebsites

    The province or state are not autofilled because the returned billing_state or shipping_state value from Google Places API are different from the default WooCommerce state codes.

    For example, for this particular address: 4560, Jin Ke Lu

    Places API: Shanghai Shi

    WooCommerce State Value for the dropdown: CN10

    ————————————-

    In order to make sure that the state field is autofilled with the Places API, we will match the result with the corresponding state code value in the autocomplete.js file.

    
    var prop = this.component_form[f][1];
    var billing_state_selected;
                            if(place.address_components[field].hasOwnProperty(prop)){
                                this.formFieldsValue[this.component_form[f][0]] = place.address_components[field][prop];
    
        if ( this.component_form[f][0] == "billing_state" ) {
    	switch (place.address_components[field][prop]) {
    		case "Shanghai Shi":
    		billing_state_selected = "CN10";
    		break;
    		
                    case "Yunnan Sheng":
    		billing_state_selected = "CN1";
    		break;
    									  
                    case "Beijing Shi":
    		billing_state_selected = "CN2";
    		break;
    									  
                    case "Tianjin Shi":
    	        billing_state_selected = "CN3";
    		break;
    
                   // do the same for the remaining regions
    
         }			
    		// debugging
                    // console.log(this.component_form[f][0] + " = " + place.address_components[field][prop]); 
                            }
    

    This is what we will get when all the state codes are properly assigned:

    • This reply was modified 3 years, 3 months ago by cheey2003.
    • This reply was modified 3 years, 3 months ago by Yui.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Abandoned Plugin????’ is closed to new replies.