New Shopify Certification now available: Liquid Storefronts for Theme Developers

insert price widget on product page (Crave Theme)

SDBdigital
Shopify Partner
67 0 16

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.

Screenshot 2022-04-22 at 09.16.28.png

Replies 3 (3)
Developden
Shopify Partner
38 20 15

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.

 

If we helped you, please Like and Accept the Solution.
Developden | Custom Shopify Solutions
Contact us: contact@developden.com
https://developden.com
SDBdigital
Shopify Partner
67 0 16

Hi

 

It doesn't work.

I've tried placing the code in various places - but it just doesn't display

Screenshot 2022-04-25 at 10.28.58.png

Digiboys
Shopify Partner
1 0 0

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.