Geolocation Delivery time coding

xnyjyh
Explorer
200 0 9

Hello, Im trying to add geolocations to display Canada or USA shipping times to this code with metafields. So the shipping times show either USA or Canada code for each location. How can I add geolocations to the code below?

Thanks

 

<style>
.delivery-date, .delivery-date p, .delivery-date div { display:inline;}
</style>
{% if product.metafields.custom.number_of_days_for_delivery != blank %}
  <div class="delivery-date">
    <p><b>Estimated Delivery Date:</b></p>
      <div id="m-date">
        {% if product.metafields.custom.range_date_for_delivery != blank %}
          {% assign range_date_add = product.metafields.custom.range_date_for_delivery | date: "%s" | times: 86400 %}
          {% assign range_date = 'now' | date: "%s" | plus: range_date_add | date: "%d %b" %}
        {% endif %}
      {% assign days_to_add = product.metafields.custom.number_of_days_for_delivery | date: "%s" | times: 86400 %}
        
  {% assign future_date = 'now' | date: "%s" | plus: days_to_add | date: "%d %b" %}
    {% if range_date %} {{ range_date | append: ' to ' }} {% endif %} {{ future_date }}
    </div>
  </div>
{% endif %}
Replies 0 (0)