Fluent builder that creates or updates a SKU for a given product and SKU code. Configure it with a title, image, base cost, physical dimensions, custom fields, parameter options and per-location inventory quantities, then call build to persist the SKU and apply the configured inventory levels. Obtained by calling newProductSkuBuilder on the catalogManager service from server-side JavaScript.

Group: Builders


Methods

title(String s) · imageHash(String s) · baseCost(BigDecimal s) · baseCost(Double s) · weightKgs(BigDecimal s) · heightCm(BigDecimal s) · widthCm(BigDecimal s) · lengthCm(BigDecimal s) · field1(String s) · field2(String s) · field3(String s) · addInventory(InventoryLocation loc, Long quantity) · addParameterOption(ParameterOption po) · addParameterOption(String paramCode, String optCode) · build()

title(String s)

Returns: ProductSkuBuilder

Sets the SKU's display title.

ParameterDescription
sthe SKU's display title

imageHash(String s)

Returns: ProductSkuBuilder

Sets the content hash of the SKU's image.

ParameterDescription
sthe content hash of the image data

baseCost(BigDecimal s)

Returns: ProductSkuBuilder

Sets the SKU's base cost, before any pricing rules are applied.

ParameterDescription
sthe SKU's base cost

baseCost(Double s)

Returns: ProductSkuBuilder

Sets the SKU's base cost, before any pricing rules are applied.

ParameterDescription
sthe SKU's base cost

weightKgs(BigDecimal s)

Returns: ProductSkuBuilder

Sets the SKU's weight, in kilograms.

ParameterDescription
sthe SKU's weight in kilograms

heightCm(BigDecimal s)

Returns: ProductSkuBuilder

Sets the SKU's height, in centimetres.

ParameterDescription
sthe SKU's height in centimetres

widthCm(BigDecimal s)

Returns: ProductSkuBuilder

Sets the SKU's width, in centimetres.

ParameterDescription
sthe SKU's width in centimetres

lengthCm(BigDecimal s)

Returns: ProductSkuBuilder

Sets the SKU's length, in centimetres.

ParameterDescription
sthe SKU's length in centimetres

field1(String s)

Returns: ProductSkuBuilder

Sets the SKU's first custom field value.

ParameterDescription
sthe value for custom field 1

field2(String s)

Returns: ProductSkuBuilder

Sets the SKU's second custom field value.

ParameterDescription
sthe value for custom field 2

field3(String s)

Returns: ProductSkuBuilder

Sets the SKU's third custom field value.

ParameterDescription
sthe value for custom field 3

addInventory(InventoryLocation loc, Long quantity)

Returns: ProductSkuBuilder

Sets the stock quantity to apply at the given inventory location when the SKU is built.

ParameterDescription
locthe inventory location to set stock for
quantitythe stock quantity to apply at that location

addParameterOption(ParameterOption po)

Returns: ProductSkuBuilder

Adds a parameter option that the SKU is built with, contributing to the combination of options that identifies it as a variant of the product.

ParameterDescription
pothe parameter option to add

addParameterOption(String paramCode, String optCode)

Returns: ProductSkuBuilder

Adds a parameter option that the SKU is built with, looking up the parameter and option by their codes on the product.

ParameterDescription
paramCodethe code of the product parameter the option belongs to
optCodethe code of the option to add

build()

Returns: ProductSku

Persists the SKU, creating it if it does not already exist for this product and combination of parameter options, and applies the title, image, cost, dimensions, custom fields and per-location inventory quantities configured on this builder.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.