<button id="btn-add-to-basket" class="{{btn_class}}" data-variant-id="{{variant_id}}">
{{btn_text}}
</button>
{{ longclaw_vendors_bundle()|safe }}
{{ longclaw_client_bundle()|safe }}
<script type="text/javascript">
  var btn = document.getElementById('btn-add-to-basket');
  btn.addEventListener("click", function (e) {
    longclawclient.basketList.post({
      prefix: "{{ longclaw_api_url_prefix() }}",
      data: {
        variant_id: e.target.dataset.variantId
      }
    });
  });
</script>
