【问题标题】:Automatically select state and city according to zip code in Magento's onepage checkout [closed]根据 Magento 单页结帐中的邮政编码自动选择州和城市 [关闭]
【发布时间】:2015-06-07 02:36:31
【问题描述】:

我想在一页结帐的计费信息处理栏中根据邮政编码自动选择州和城市。

【问题讨论】:

标签: magento magento-1.9 magento-1.9.1


【解决方案1】:

使用地理编码 API。

例如,如果您想要 zip 10017

的结果
http://maps.googleapis.com/maps/api/geocode/json?address=10017+US&sensor=true

我们在这里传递邮政编码 + 国家/地区。原因是,某些邮政编码返回多个结果。例如 - 208006

谢谢。

【讨论】:

  • 我必须在哪里使用上述 GeoCoding API?请解释
  • 您可以使用 Ajax 功能。您可以在邮政编码字段旁边添加一个按钮并触发 ajax 以从 Google 获取 JSON 响应,或者您可以根据您的要求触发“onkeyup”或“onblur”。谢谢。
  • 不,它不适合我
  • 我怎样才能得到结帐页面的邮政编码?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多