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

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

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:

Then find product-loop.liquid file.

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 %}

{% if on_sale %}
{{ 'products.product.sale' | t }}
{% endif %} {% if sold_out %}
{{ 'products.product.sold_out' | t }}
{% endif %}
{{ product.featured_image.alt | escape }}
{% if section.settings.collection_overlay %}
{% include 'product-quick-view-btn' qvp:product %}
{% endif %}
{{ product.title | escape }}

{% if section.settings.show_grid_type %}

{{ product.type }}

{% endif %}
{% if product.metafields.productfeatures.packsize.size > 1 %} {{ product.variants.first.price | divided_by: product.metafields.productfeatures.packsize | money }} per m² {% else %} {% if product.price_varies %}{{ 'products.product.price_from' | t }}{% endif %} {{ product.price | money }} {% if on_sale %}{% endif %} {{ product.compare_at_price | money }}{% endif %}
{% if section.settings.collection_overlay %} {% include 'product-quick-view' qvp:product %} {% endif %}