Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Widget displays NaN and click not working to open popup #16

Open
yertech opened this issue Nov 8, 2021 · 0 comments
Open

Widget displays NaN and click not working to open popup #16

yertech opened this issue Nov 8, 2021 · 0 comments

Comments

@yertech
Copy link

yertech commented Nov 8, 2021

Hi,

The widget was working just fine until I noticed that it was ko. The calls to api and files seem ok.
When I click I don't have the popup anymore.

image

test : https://ki-decoration.com/collections/luminaires/products/suspension-de-nacre-boho-chic

It's a shopify website and I implemented it like this :
product.liquid

<script>
  var widgets = Alma.Widgets.initialize(
      'xxxxxxxxxxxxxx', 
      Alma.ApiMode.LIVE,
    )

  var selectCallback = function(variant, selector) {
    if (variant && variant.featured_image) {
      var newImage = variant.featured_image; 
      var mainImageDomEl = jQuery('.cloud-zoom img')[0]; 
      Shopify.Image.switchImage(newImage, mainImageDomEl, switchImage); 
    }
    if (variant && variant.available) {  
      currentProduct = variant;
      if(currentProduct && currentProduct.price >= 5000 )
      {
        widgets.add(Alma.Widgets.PaymentPlans, {
          container: '#payment-plans',
          purchaseAmount: currentProduct.price,
            plans: [
              { installmentsCount: 2 },
              { installmentsCount: 3 },
              { installmentsCount: 4 }
            ]
        })
        widgets.render();
      }
...
</script>

theme.liquid (in the )

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/alma-widgets.min.css" />
  <script src="https://cdn.jsdelivr.net/npm/@alma/[email protected]/dist/alma-widgets.umd.js"></script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant