我正在尝试通过URL查询参数在Shopify checkout中预先填充发货/账单地址。我发现这里引用的送货地址很容易做到:
https://community.shopify.com/c/Shopify-APIs-SDKs/Autofill-checkout-fields/td-p/318793
但是,当我尝试对帐单信息执行相同的操作时,付款屏幕上的“与发货地址相同”选项始终处于选中状态,如果我手动选择不同地址的选项,则所有值都为空
如何预填充这两个地址?我尝试将账单查询参数直接添加到结账支付页面URL,但也不起作用。这是我一直在尝试的URL:
demo-store.myshopify.com/checkout?checkout[email]=fake.name@gmail.com&checkout[shipping_address][first_name]=John&checkout[shipping_address][last_name]=Doe&checkout[shipping_address][address1]=333%20Fake%20St.&checkout[shipping_address][city]=San%20Diego&checkout[shipping_address][province]=CA&checkout[shipping_address][country]=USA&checkout[shipping_address][zip]=92116&checkout[shipping_address][phone]=333-333-3333&checkout[different_billing_address]=true&checkout[billing_address][first_name]=Jane&checkout[billing_address][last_name]=Doe&checkout[billing_address][address1]=444%20Fake%20St%20&checkout[billing_address][city]=San%20Diego&checkout[billing_address][province]=CA&checkout[billing_address][country]=USA&checkout[billing_address][zip]=92121&checkout[billing_address][phone]=444-444-4444
此外,还有一个额外的问题,发货状态似乎总是基于IP地址填充的,所以即使我向它传递一个值,它也会显示我所处的状态。如何让它始终反映查询参数的值?
发布于 2021-09-11 03:07:53
要在购物网上创建预填充的结帐,您需要通过Admin API或Storefront API提供结帐
要创建签出并返回web URL,请向admin/checkouts.json端点发送POST请求。
根据您选择的方式,可以使用许多不同的访问点来实现这一点,如Shopify Dev portal中所述,尽管您不能仅使用URL参数以请求的方式完成此操作。
有关进一步的阅读,请参阅Getting started for the Storefront API和Storefront API Checkout Object
https://stackoverflow.com/questions/61508555
复制相似问题