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
}
}));
},
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024