A space to discuss online store customization, theme development, and Liquid templating.
Hi
I need to install a pricing widget on the product pages. Using the Crave theme.
It's a single line of code:
<script async src="https://content.payfast.co.za/widgets/moretyme/widget.min.js?amount={{ current_variant.price | divided_by: 100.0 }}&font=Lato&font-color=#041b2b&link-color=--HASH--177ee8" type="application/javascript"></script>
I just dont know which liquid file to look for.
Hi @SDBdigital ,
You should place this in the main-product.liquid file in the sections folder.
This section uses blocks so I would put it in the 'price' block just above this line of code:
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
On the latest version of the Crave theme, this would be the 220th line in the main-product.liquid section file.
Hi
It doesn't work.
I've tried placing the code in various places - but it just doesn't display
Change the code: "<script async src="https://content.payfast.co.za/widgets/moretyme/widget.min.js?amount={{product.price | money_without_currency | replace:',','' }}" type="application/javascript"></script>"
Use: {{product.price | money_without_currency | replace:',','' }} instead of {{ current_variant.price | divided_by: 100.0 }} for the amount data and it should work.