Discussions

Ask a Question
Back to All

Needs documentation of Methods for Widget Custom Templates

Hi,
I'm using the custom template and I notice these methods (variantOptionAvailable and selectVariantOption) aren't included in the documentation and I will need it to modify it further. Example code below.

Thank for any kinds of help.

        <div
          class="variant-option"
          v-if="option.name.toLowerCase() == 'color' || option.name.toLowerCase() == 'colour' "
        >
          <label>COLOUR</label>
          <div
            class="option-swatch color"
            v-bind:class="{ activeSwatch: product.selected_variant['option' + option.position] == value, unavailable: !variantOptionAvailable(product, 'option' + option.position, value) }"
            v-for="(value, index) in option.values"
            v-on:click="selectVariantOption(product, 'option' + option.position, value)"
          >
            <div
              class="option-swatch color-container"
              :style="{ backgroundImage: 'url(' + getURL(value) + ')' }"
            ></div>
          </div>
        </div>