Hi, I have a question. I want my dropdown menu, when we are on a product and select a size, to show the price in the dropdown menu next to the size. I am attaching an example of what I have in mind. I am using the dawn 15.3.0 template.
Hey @Bajgor ,
Welcome to the Shopify community.
In order to show the price near the Product variant required to do the custom code in your theme file.
Would you like to share the store url so that I can take a look and provide you with the solution code.
Thanks
Hello @Bajgor ,
Edit go to snippets → product-variant-options.liquid
search for
replace it with
Regards
Guleria
Hey @Bajgor !
To show the price next to each size option in the variant dropdown on product pages, you’ll need to modify the product form code and JavaScript that renders the variant picker.
Step-by-Step Instructions#### 1. Edit the Variant Picker
In your Shopify admin:
-
Go to Online Store → Themes → next to Dawn theme, click “…” → Edit Code
-
Open: sections/main-product.liquid
Search for the variant dropdown — it will look something like:
<select
id=“Option-{{ forloop.index0 }}”
class=“product__input product__input–dropdown”
name=“options[{{ option.name }}]”
{% for value in option.values %}
{{ value }} {% endfor %}Replace the line with this:
{% for value in option.values %}
{% assign matched_variant = product.variants | where: ‘option’ | where: option.name, value | first %}
{% if matched_variant %}
{% assign variant_price = matched_variant.price | money %}
{% if matched_variant.available %}
This attempts to get the price for each variant and append it to the label.
2. Ensure Dynamic Updates Work
The above will only show correct info on page load, but if your store has dynamic variant switching, you should also update this logic in:
/assets/global.js (or global.js.liquid)
Look for or add the logic inside the function that renders variant options (often updateOptions, updateMasterId, or similar) and enhance the option text.
If you share your current JS file or structure of how the variant dropdown is rendered, I can write the exact JavaScript needed for your case.
3. (Optional) Style the Options
Some themes cut off long dropdown text. You can add CSS like:
.product__input–dropdown option {
white-space: normal;
padding: 6px;
}
Add this in base.css under Assets to improve readability.
If this reply was useful to you, we would really appreciate it if you gave us a LIKE and mark the issue as SOLVED!
And what will be the css code and where to give it so that these prices will be on the right side without the dash as in the attachment
Possible to remove the - dash.
replace this line
{{ value }} {% if variant_price != ‘’ %}- {{ variant_price }}{% endif %}
with this one
{{ value }} {% if variant_price != ‘’ %} {{ variant_price }}{% endif %}
But with this setup it’s not possible to align them like you shared in the attachment.