All things Shopify and commerce
Hello,
I got this variant Dimension and Cubage, I already display the variant on single product, but the problem when I select other variation, the page need to refresh before its change the information
here is my code
{% for variant in product.variants %}
<div class="variant__description" data-variant-id="{{variant.id}}" {% if product.selected_or_first_available_variant.id == variant.id %} style="display: block;" {% endif %}>
{% if variant.metafields.custom.variant_size %}
<p><span class="font-body-bold">Dimension:</span>{{ variant.metafields.custom.variant_size }}</p>
{% endif %}
{% if variant.metafields.custom.variant_cubage %}
<p><span class="font-body-bold">Cubage:</span>{{ variant.metafields.custom.variant_cubage }}</p>
{% endif %}
</div>
{%- endfor -%}
anyone can help how to update variant when I click for example I have 2ft, 3ft and 4ft. I just check theme.js
and found this in Unit price change, I'm just new and studying the Expanse Theme.
_updateUnitPrice: function(variant) {
if (this.currentVariant && variant.unit_price === this.currentVariant.unit_price) {
return;
}
this.container.dispatchEvent(new CustomEvent('variantUnitPriceChange', {
detail: {
variant: variant
}
}));
},
User | RANK |
---|---|
42 | |
39 | |
24 | |
24 | |
22 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023