如何将 Shopify 购物车添加到 Hugo 电子商务网站
我使用 Hugo 创建了一个静态电子商务网站。
想要通过 Shopify 后台添加产品,并将其反映在我的网站。
我对液体模板非常熟悉。请让我知道如何实现这一目标?
到目前为止,
- 我已经创建了一个 Shopify 商店,添加了一个主题并添加了一种产品。
- 我不想自定义现有主题,而是完全删除该主题并在其中添加我的网站主题。
I have created a Static e-commerce site using Hugo.
want to add products thro' Shopify admin, and get it reflected on my site.
I'm quite familiar with liquid templating. Kindly let me know how to achieve this?
So far,
- I have created a Shopify store, added a theme and added one product.
- I'm not looking to customize an existing theme, but completely remove that theme add my website theme in it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 Shopify API 获取您的产品。 此端点可能适合您。然后,您可以从 Hugo 中通过 getJson 函数检索产品告诉它 Shopify 授权标头
X-Shopify-Access-Token
。像这样:只需确保您已替换
your-store
和your-token
字符串即可。You should be able to get your products using the Shopify API. This endpoint could be the one for you. From Hugo, you can then retrieve the products by getJson function with telling it the Shopify authorization header
X-Shopify-Access-Token
. Like this:Just make sure that you've replaced both the
your-store
andyour-token
strings.