How to integrate the Buy Button from Shopify Lite on a Nuxt website

Deodat
New Member
3 0 1

Hello, 

I wonder how to integrate the Shopify Lite's Buy Button on a Nuxt website.
I saw that there is the nuxt-shopify module (https://github.com/Gomah/nuxt-shopify) but is it adapted?

Thanks for your help!

Deodat

Reply 1 (1)
Deodat
New Member
3 0 1

For the example, with Snipcart, we can do something like that :

 

In nuxt.config.js :

head: {
  link: [
    {
      rel: 'stylesheet',
      href: 'https://cdn.snipcart.com/themes/2.0/base/snipcart.min.css'
    }
  ],
  script: [
    {
       src: 'https://cdn.snipcart.com/themes/2.0/current/snipcart.js',
       id: 'snipcart',
       'data-api-key': process.env.SNIPCART_API_KEY
    }
  ]
},
 

And in a product page :

      <button
        class="snipcart-add-item"
        :data-item-id="blok._uid"
        :data-item-name="blok.name"
        :data-item-price="blok.price"
        :data-item-url="$nuxt.$route.path"
      >
        Buy {{ blok.name }}
      </button>


Is there an equivalent for Shopify Lite?