Remove decimal in product.liquid Supply Theme

Highlighted
Excursionist
16 0 4

Hello,

I'm trying to remove the decimals from the price in product.liquid from Supply theme.

In other templates we only need to add " | remove '.00' " but in supply theme is not working:

This is the code that shows the price in product.liquid:

    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">;

      {% assign variant = product.selected_or_first_available_variant %}

      <meta itemprop="priceCurrency" content="{{ shop.currency }}">
      <meta itemprop="price" content="{{ variant.price | money_without_currency }}">

      <ul class="inline-list product-meta">
        <li>
          <span id="productPrice" class="h1">
            {% include 'price' with variant.price %}
          </span>
        </li>
        {% if product.compare_at_price_max > product.price and settings.product_show_saved_amount %}
        <li>
          <span id="comparePrice" class="sale-tag large">
            {% assign compare_price = variant.compare_at_price %}
            {% assign product_price = variant.price %}
            {% include 'price-sale' %}
          </span>
        </li>
        {% endif %}
        {% if settings.product_reviews_enable %}
          <li class="product-meta--review">
            <span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
          </li>
        {% endif %}
      </ul

 

Someone knows what i need to change?

Thanks!

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
400 0 72

Hi Albert,

Britton here with the Shopify support team.

There actually should be an easier way to do this than changing your theme's code. If you visit Settings > General in your store and scroll down you will need to click on change formatting. From there, format your currency like this: https://screenshot.click/26-31-qhg68_27rwp.jpg. That should get rid of the decimals on your prices.

I hope that helps!

-Britton

Britton Shopify Guru
Highlighted
New Member
1 0 0

Thanks!

0 Likes
Highlighted
Shopify Partner
12 0 3

What if I need to remove decimals on specific pages ?

0 Likes
Highlighted
Tourist
19 0 2

But this does not apply in checkout... Is there a way to fix this?

0 Likes