Script: Class dw.catalog.ProductVariationAttributeValue

Class ProductVariationAttributeValue

  • Object
    • dw.catalog.ProductVariationAttributeValue

Represents a product variation attribute

Properties

description : String Read Only

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

displayValue : String Read Only

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

ID : String Read Only

The ID of the product variation attribute value.

value : Object Read Only

The value for the product variation attribute value.

Constructor Summary

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

Method Summary

equals(obj : Object) : boolean

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.

getDisplayValue() : String

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.

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

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

getImage(viewtype : String) : MediaFile

The method calls getImages(String) and returns the first image of the list.

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.

getValue() : Object

Returns the value for the product variation attribute value.

hashCode() : Number

Calculates the hash code for a product variation attribute value.

Methods inherited from class Object

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

Method Detail

equals

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

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

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

getID() : String

Returns the ID of the product variation attribute value.

Returns:

the ID of the product variation attribute value.


getImage

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


getImage

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


getImages

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

getValue() : Object

Returns the value for the product variation attribute value.

Returns:

the value for the product variation attribute value.


hashCode

hashCode() : Number

Calculates the hash code for a product variation attribute value.

Returns:

the hash code for a product variation attribute value.