I am facing an issue with the Affirm app (promotional msg) which says “$xx per month”. The Affirm team shared the following instruction set and I followed it but I still cant get it to work:
If someone has had experience with this, that would be great. Adding a few screenshots of code pushed in so far here. Happy to provide more information as required.
here are the 2 code files. Let me know if you need anything else:
product form liquid
{%- capture form_classes -%}
product-form product-form-{{ section.id }}
{%- endcapture -%}
{%
form 'product',
product,
class: form_classes,
novalidate: 'novalidate',
data-product-form: '',
data-product-handle: product.handle,
data-current-product-id: current_variant.id
%}
{% comment %}
product quantity within form remains hidden but will be updated
from outside the form if enabled.
{% endcomment %}
{% comment %}
In order for this form to submit, it needs to contain an input with name="id".
ProductForm() will automatically create this input (or make sure it has the
right value set if it already exists) on form submit based on the
currently selected variant. However, if JS is disabled we need a fallback.
Include a single
{%- for variant in product.variants -%}
{%- endfor -%}
Love Now, Pay Later! Qualify with
{%- if show_dynamic_checkout -%}
{{ form | payment_button }}
{%- endif -%}
{% comment %} {%- unless is_quick -%}
{{- form | payment_terms -}}
{%- endunless -%} {% endcomment %}
[ CONSULT A SPECIALIST](https://xxx.com/xxx)
{%- endform -%}
Affirm.js
_affirm_config = {
public_api_key: "XXXXX",
script: "https://cdn1.affirm.com/js/v2/affirm.js"
};
(function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a