Repository navigation
Shopify unit price disappeared? Render the variant measurement when available #40
vistabylara-dev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
سعر الوحدة يختلف عن سعر العبوة. اعرض بيانات القياس الخاصة بالمتغير عند توفرها.
Free Shopify code series · 37/50 · Reviewed 24 October 2026
The problem
A custom price redesign can accidentally remove unit pricing. Shopify provides unit price and measurement data; use the measurement-aware filter instead of guessing a per-kilogram or per-litre calculation.
Placement and precautions
Duplicate the theme and work in its unpublished preview. Save the original files and change one component at a time.
Adapt inside the existing product pricing component. Use the existing current-variant value if your theme already has one, and keep its live variant-update mechanism.
Bounded Liquid example — not a replacement for an entire theme file:
{% assign measured_variant = product.selected_or_first_available_variant %} {% if measured_variant.unit_price_measurement %} <p class="vbl-unit-price"> {{ measured_variant.unit_price | money_with_currency | unit_price_with_measurement: measured_variant.unit_price_measurement }} </p> {% endif %}Check in preview
Preview a variant with configured measurement data and one without. Compare the value and unit to the catalogue, then switch variants and markets. No measurement should produce no unit-price paragraph.
Limits to understand
This is a display example, not a regulatory assessment. It cannot create missing measurement data or replace total price, selling-plan or volume-pricing logic.
Validation: This code passed Shopify's validation tool. This is static validation, not proof of rendering, accessibility, theme compatibility, indexing or improved sales. No live merchant store was changed or purchase performed.
Rollback
Restore the saved markup and styles if anything regresses. Remove any new calls before deleting their referenced files. Remove only unused locale keys introduced for this example. Keep the previous working theme available until the full affected journey has been checked.
Need this fixed in your store?
Send Dr Lara your store URL, theme name, affected page and what changed before the issue started. Start with free guidance and a free initial consultation. If you want implementation, we agree the scope and fee separately before work starts.
Explore Shopify repairs and development with Vista by Lara
WhatsApp Dr Lara about guide 37 or call +971 50 799 4292.
Free guidance. No commitment. Practical implementation is separately scoped.
Join the discussion
What result do you see, and what should happen instead? Share a short sanitized example. Remove passwords, tokens, customer details and private admin URLs.
Official references
Dr Lara · Vista by Lara · Dubai, UAE
All reactions