purchase.address-autocomplete.suggest Need to be able to drill down on returned addresses

Solved

purchase.address-autocomplete.suggest Need to be able to drill down on returned addresses

GerryFC
Shopify Partner
2 0 0

Hi all

We are  trying to build a drop down list of addresses using the 

purchase.address-autocomplete.suggest extension.
Due to various vagaries, we will sometimes returns a condensed link of addresses and invite the user to drill down further to find their actual address by clicking on the drill down suggestion.
Trouble is, we can't find any way of making this work in the current set up for extensions. Has anyone solved a similar issue
 
So far:
Extended 'purchase.address-autocomplete.format-suggestion' to detect a drill down link and forward to the API to find the next step in the chain, it does this well and finds the data, but we can make this component return the results to the gui as the results do not have a formattedAddress
 
Cheers
 
 
Accepted Solution (1)

richardcobain
Pathfinder
120 4 14

This is an accepted solution.

It sounds like your issue is with dynamically updating the dropdown list when a user clicks on a drill-down suggestion. Since purchase.address-autocomplete.format-suggestion works but doesn't update the UI, try using Shopify's API response handling with purchase.address-autocomplete.suggest to dynamically inject the new results. Ensure that your API returns formattedAddress for each level of the drill-down. If Shopify’s built-in extension limits this behavior, consider using a custom JavaScript event listener to capture the drill-down click and trigger a new API request to update the dropdown dynamically.

View solution in original post

Replies 2 (2)

richardcobain
Pathfinder
120 4 14

This is an accepted solution.

It sounds like your issue is with dynamically updating the dropdown list when a user clicks on a drill-down suggestion. Since purchase.address-autocomplete.format-suggestion works but doesn't update the UI, try using Shopify's API response handling with purchase.address-autocomplete.suggest to dynamically inject the new results. Ensure that your API returns formattedAddress for each level of the drill-down. If Shopify’s built-in extension limits this behavior, consider using a custom JavaScript event listener to capture the drill-down click and trigger a new API request to update the dropdown dynamically.

GerryFC
Shopify Partner
2 0 0

Thanks Richard! Apologies for delay in reply, with your help we got it done.

 

Cheers

Gerry