Announcement

Collapse
No announcement yet.

Affirm setup question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Affirm setup question

    I am trying to setup the Affirm financing option but running into trouble with the [price] variable in the code. If I use [price] and the item has a [saleprice] then the calculator only uses the higher [price] amount not the sale price and the payments are not correct. Does anyone know how to capture the amount going into the shopping cart? (whether it is a sale or regular price?) I pasted the code below:
    Code:
     
     <div class="affirm-as-low-as" data-amount="" id="as-low-as-refreshable" data-page-type="product"></div> <script>  affirm.ui.ready(function(){     var refreshable = document.getElementById('as-low-as-refreshable');     if (refreshable){     var amount = "[price]".replace(/[^0-9]+/g,"");     refreshable.setAttribute('data-amount', amount);     affirm.ui.refresh();       }   }); </script>
    Last edited by discpb; 02-05-2019, 03:00 PM.
Working...
X