Skip to content

Instantly share code, notes, and snippets.

@stuartchaney
Last active December 2, 2022 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartchaney/01f2b3a9209fc1e682dcb12fab481efe to your computer and use it in GitHub Desktop.
Save stuartchaney/01f2b3a9209fc1e682dcb12fab481efe to your computer and use it in GitHub Desktop.
{% comment %}{% assign icon_url = %}{% endcomment %}
{%- assign potential_points_config = shop.metafields.ba_loy.config.frontend.potential_points.order_placed -%}
{%- if potential_points_config.enabled && template.name == "product" -%}
{%- if potential_points_config.points_type == "multipler" -%}
{%- assign potential_points = product.price | divided_by: 100 | times: potential_points_config.points_amount -%}
{%- else -%}
{%- assign potential_points = potential_points_config.points_amount -%}
{%- endif -%}
{% capture potential_points_html %}<span class='order-placed-potential-points-amount'>{{potential_points}}</span>{% endcapture %}
<div id="loy-potential-points">
{% if icon_url %}
<div id="potential-points-icon" style="margin: auto;">
{{ icon_url| image_url: width: 50 | image_tag: class: 'points-icon', loading: 'lazy' }}
</div>
{% endif %}
<div id="potential-points-text">
<h3>TODO</h3>
<p>TODO</p>
</div>
</div>
{%- endif -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment