1

I have created a Static e-commerce site using Hugo.

Hugo ecommerce site

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,

  1. I have created a Shopify store, added a theme and added one product.
  2. I'm not looking to customize an existing theme, but completely remove that theme add my website theme in it.

1 Answer 1

4

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:

{{ $data := getJSON "https://your-store.myshopify.com/admin/api/2022-01/products.json" (dict "X-Shopify-Access-Token" "your-token") }}
{{ range $data }}
    {{ . }}
{{ end }}

Just make sure that you've replaced both the your-store and your-token strings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.