Shopify themes, liquid, logos, and UX
Hello! My Shopify store has been a pleasantly successful addition to my physical location. I am now trying to perfect it.
As you may have guessed, we deal in jewelry, and in that market, exact weights are absolutely necessary as the value of precious metals are measured in weight and are high enough that decimal places are very relevant. While I have been able to add a custom liquid code into the product page (based on instructions in this and this forum post) that display the product's weight, it unfortunately rounds the weight to the nearest whole number. Please see attached images. This is unacceptable - the true, exact weight must be displayed for the reasons above.
I have attempted to use alternative means / variables listed here and here to no avail - but I am far from proficient in coding, so I could easily be making a simple mistake. Most attempts I have made do not display anything, much less the weight. The code I have gotten to display weight (rounded) are as follows (from the forum posts previous mentioned):
Weight: {{ product.variants.first.weight | weight_with_unit }}
Weight: {% for variant in product.variants %}{{variant.weight | weight_with_unit }}{% endfor %}
The pictures below show the first code working, but both display identical outputs.
We have discussed adding the weights to all the descriptions by hand, but as we have hundreds of items and only more coming, it would be a task I would rather not do. All the correct and true weights are already entered into the 'Weight' field under 'Shipping' on their admin product page. So please - help me display the true weight of our items.
Pic 1
Despite the weight being entered correctly...
Pic 2
...it is rounded to the nearest whole number.
Thank you in advance for any assistance.
Hello, how are you?
after 3 hours trying to figure it out, this is what worked for me:
weight_with_unit s
{% if card_product.variants.first.weight != blank %}<- check if not null
{{card_product.variants.first.weight_in_unit | number_with_delimiter}} g
{% endif %}
substitute card_product for product, it should work fine. weight_with_unit should be left out, it doesn`t work with number_with_delimiter, unfortunely... if you find a way to work both out let me know.
best,
isabel
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024