Learn how to configure the default variant selection in your product templates
getDefaultProductVariant
hook in your JavaScript template object.
getDefaultProductVariant
to select different variants based on your requirements. Here are some practical examples:
product
(Object): The full product object containing all product data including variantsgetDefaultProductVariant
function returns null
, it will have no effect on the variant selection in the store. The default variant selection behavior will remain unchanged.