Liquid error (product-loop line 35): divided by 0 per m²

Solved
Love4Floors
New Member
2 1 0

Hi, I have not done any changes to my site and this error is now displayed on my website.

I am using metafields and buy the measurment.

Any idea how to fix this?

https://www.love4floors.co.uk/collections/engineered-oak-collection

Love4Floors_0-1623676913138.pngLove4Floors_1-1623676935324.png

 

0 Likes
Michal_Morek
Shopify Partner
820 73 140

This is an accepted solution.

Hi @Love4Floors 

Sincerely hope you're having a great day!

I've read your problem and before providing a solution, would like to analyze some source, code. Then, I will provide a solution to you up here - on the forum.

Could you share the source code of the product-loop file with me here?

Follow the steps below:

scrnli_22_05_2021_15-34-42.png

Then find product-loop.liquid file.

Founder of Shopify agency - Accomplishify.com
If you would like to hire us as Shopify experts, please reach out via:
  • Email michal.morek@accomplishify.com
  • WhatsApp +48 507 613 425
0 Likes
Love4Floors
New Member
2 1 0

This is an accepted solution.

Czesc Michal,

Thank you for your reply.

Please see below:

 

{% assign on_sale = false %}
{% if product.available and product.compare_at_price > product.price %}
  {% assign on_sale = true %}
{% endif %}
 
{% assign sold_out = true %}
{% if product.available  %}
  {% assign sold_out = false %}
{% endif %}
<div class="main_box{% if section.settings.collection_overlay %} quick-view-overlay {% endif %}">
  <div class="box_1">
    {% if on_sale %}
    <div class="on-sale">{{ 'products.product.sale' | t }}</div>
    {% endif %}
    {% if sold_out %}
    <div class="sold-out">{{ 'products.product.sold_out' | t }}</div>
    {% endif %}
    <div class="product-image">
      <a href="{{ product.url | within: collection }}"><img src="{{ product.featured_image.src | product_img_url: '800x' }}" alt="{{ product.featured_image.alt | escape }}"></a>
    </div>
    {% if section.settings.collection_overlay %}
      <div class="overlay hidden-sm hidden-xs">
        {% include 'product-quick-view-btn' qvp:product %}
      </div>
    {% endif %}
  </div>
  <div class="desc">
    <h5><a href="{{ product.url | within: collection }}">{{ product.title | escape }}</a></h5>
    
    {% if section.settings.show_grid_type %}
    <p>{{ product.type }}</p>
    {% endif %}
    <div class="price"><span class="money">
      {% if product.metafields.productfeatures.packsize.size > 1 %}
      {{ product.variants.first.price  | divided_by: product.metafields.productfeatures.packsize | money }} per  m&#178;
      {% else %}
      {% if product.price_varies %}{{ 'products.product.price_from' | t }}{% endif %} 
      {{ product.price | money }} {% if on_sale %}</span>{% endif %}
      <span class="compare-price money">{{ product.compare_at_price | money }}</span>{% endif %}
    </div>
  </div>
  {% if section.settings.collection_overlay %}
  {% include 'product-quick-view' qvp:product %}
  {% endif %}
</div>
0 Likes