Change product barcode with Variant Change on Product Page

Change product barcode with Variant Change on Product Page

SH_23
Excursionist
36 1 17

Hi All. So I have managed to get my Product Barcode to show on the Product page using the code:

{% assign current_variant = product.selected_or_first_available_variant %}
<b>Product Barcode: </b><span class="variant-barcode">{{ current_variant.barcode }}</span>

However on products where there are multiple variants, the barcode doesnt seem to change with the selected variant.

Can anyone help me with what to do in order to get the barcode to update to reflect the selected variant please?

Thanks in Advance.

Replies 2 (2)

SH_23
Excursionist
36 1 17

Does anyone have any input please?

avaAdmin
New Member
4 0 0

Hey- I know this is years old, but did you ever get this sorted? I'm looking to get this working too. 
Thanks!