Class ProductVariationAttributeValue

Represents a product variation attribute

PropertyDescription
ID: String (read-only)Returns the ID of the product variation attribute value.
description: String (read-only)Returns the description of the product variation attribute value in the current locale.
displayValue: String (read-only)Returns the display value for the product variation attribute value, which can be used in the user interface.
value: Object (read-only)Returns the value for the product variation attribute value.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
equals(Object)Returns true if the specified object is equal to this object.
getDescription()Returns the description of the product variation attribute value in the current locale.
getDisplayValue()Returns the display value for the product variation attribute value, which can be used in the user interface.
getID()Returns the ID of the product variation attribute value.
getImage(String)The method calls getImages(String) and returns the first image of the list.
getImage(String, Number)The method calls getImages(String) and returns the image at the specific index.
getImages(String)Returns all images that match the given view type and have the variant value of this value, which is typically the 'color' attribute.
getValue()Returns the value for the product variation attribute value.
hashCode()Calculates the hash code for a product variation attribute value.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

ID: String (read-only)

Returns the ID of the product variation attribute value.


description: String (read-only)

Returns the description of the product variation attribute value in the current locale.


displayValue: String (read-only)

Returns the display value for the product variation attribute value, which can be used in the user interface.


value: Object (read-only)

Returns the value for the product variation attribute value.


equals(obj: Object): Boolean

Returns true if the specified object is equal to this object.

Parameters:

  • obj - the object to test.

Returns:

  • true if the specified object is equal to this object.

getDescription(): String

Returns the description of the product variation attribute value in the current locale.

Returns:

  • the description of the product variation attribute value in the current locale, or null if it wasn't found.

getDisplayValue(): String

Returns the display value for the product variation attribute value, which can be used in the user interface.

Returns:

  • the display value for the product variation attribute value, which can be used in the user interface.

getID(): String

Returns the ID of the product variation attribute value.

Returns:

  • the ID of the product variation attribute value.

getImage(viewtype: String): MediaFile

The method calls getImages(String) and returns the first image of the list. The method is specifically built for handling color swatches in an apparel site.

If no images are defined for this variant and specified view type, then the first image of the master product images for that view type is returned. If no master product images are defined, the method returns null.

Parameters:

  • viewtype - the view type annotated to image

Returns:

  • the MediaFile or null

Throws:

  • NullArgumentException - if viewtype is null

getImage(viewtype: String, index: Number): MediaFile

The method calls getImages(String) and returns the image at the specific index.

If images are defined for this view type and variant, but not for specified index, the method returns null.

If no images are defined for this variant and specified view type, the image at the specified index of the master product images is returned. If no master product image for specified index is defined, the method returns null.

Parameters:

  • viewtype - the view type annotated to image
  • index - the index number of the image within image list

Returns:

  • the MediaFile or null

Throws:

  • NullArgumentException - if viewtype is null

getImages(viewtype: String): List

Returns all images that match the given view type and have the variant value of this value, which is typically the 'color' attribute. The images are returned in the order of their index number ascending.

If no images are defined for this variant, then the images of the master for that view type are returned.

Parameters:

  • viewtype - the view type annotated to images

Returns:

  • a list of MediaFile objects, possibly empty

Throws:

  • NullArgumentException - if viewtype is null

getValue(): Object

Returns the value for the product variation attribute value.

Returns:

  • the value for the product variation attribute value.

hashCode(): Number

Calculates the hash code for a product variation attribute value.

Returns:

  • the hash code for a product variation attribute value.