Debut: How to add price to variant names in variant selector on product page

Highlighted
New Member
3 0 0

I am trying to add price to variant names in variant selector of debut product page.

how the variant picker shows options-

"Blue color"

"Red color"

 

how I am trying to make it.

"Blue color $5"

"red color $7"

 

I have tried to inspect via chrome but it shows value rather than the code. Also in theme.js I couldn't identify where to do what. Any ideas?

0 Likes
Highlighted
Shopify Partner
1079 170 195

Locate your product-template.liquid file in:

  1. Online Store
  2. Edit
  3. Edit Code
  4. product-template.liquid
  5. Locate Line 175 assuming you haven't modified the code
  6. Add the underlined snipped to show price

JHKC_0-1599579078069.png

Let me know, Cheers!

 

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
K&J
0 Likes
Highlighted
New Member
3 0 0

It did not work for me. however when I add -{{product.price}} in the below code location as shown in bold, it adds the price to each variant. But it adds only the base price to each, instead of price of each variant. 

what it shows

small-$25

medium-$25

large-$25

 

Can someone guide me how to get respective variant price-


<select class="single-option-selector single-option-selector-{{ section.id }} product-form__input"
id="SingleOptionSelector-{{ forloop.index0 }}"
data-index="option{{ forloop.index }}"
>
{% for value in option.values %}
<option value="{{ value | escape }}"{% if option.selected_value == value %} selected="selected"{% endif %}>{{ value }}-{{product.price}}</option>
{% endfor %}
</select>

0 Likes