How could i show shipping price in product page?

How could i show shipping price in product page?

Trafa
Shopify Partner
2 0 0

I would like to show my shipping price, lets say 2EUR on my product page in a custom liquid block or an application. This 2EUR should be changing with the customers currency and scaling with it, also it should say free shipping if the customer is in UK or the US. 

I have tried this code already, but it just changed the currency symbol and not the actual value of it: 

 

{% comment %}
Get the customer's location based on IP address
{% endcomment %}
{% assign customer_location = request.client_ip | geolocation %}

{% comment %}
Set the currency based on the detected location
{% endcomment %}
{% assign currency_code = customer_location.country.iso_code | downcase %}

{% comment %}
Display the price in the customer's currency
{% endcomment %}
{{ 3.95 | money | append: ' ' | append: currency_code }}

Reply 1 (1)

SR_Author
Shopify Partner
13 0 1

If you want a complete solution, it can't be done with only liquid. Pay attention to my widget: https://apps.shopify.com/shiprate-estimator

If there will be any help with installation - feel free to ask me.