Prototype.js Cannot call class as function

110 views Asked by At

I'm having conflicts with the Shopify Javascript Buy SDK and prototype.js. I'm using Magento 1 to implement a custom cart (because using Magento's cart is not feasible for this particular project), however I'm getting this error.

enter image description here

Here is my SDK implementation:

      const client = ShopifyBuy.buildClient({
            domain: 'your-shop-name.myshopify.com',
            storefrontAccessToken: 'your-storefront-access-token'
        });
        client.checkout.create(lineItemsToAdd).then((checkout) => {
            window.open(checkout.webUrl, null, "fullscreen=no,toolbar=no,height=800,width=1100");
        });

How can I resolve or bypass this conflict?

  • protoype v1.7
  • shopify prototype v2.2.4
0

There are 0 answers