public class WidgetOptions
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UNITS_BRITISH |
static java.lang.String |
UNITS_IMPERIAL |
static java.lang.String |
UNITS_METRIC |
| Constructor and Description |
|---|
WidgetOptions() |
| Modifier and Type | Method and Description |
|---|---|
WidgetOptions |
setCartEnabled(java.lang.Boolean state)
Enable or disable the widget add-to-cart callback (`onWebWidgetAddToCart`) and integration.
|
WidgetOptions |
setCloseEnabled(java.lang.Boolean state)
Enable or disable the widget close callback (`onWebWidgetClose`).
|
WidgetOptions |
setLanguage(java.lang.String language)
Set the `language` parameter.
|
WidgetOptions |
setLoadErrorEnabled(java.lang.Boolean state)
Enable or disable the widget product load error callback (`onWebWidgetProductLoadError`).
|
WidgetOptions |
setManufacturedSizes(java.util.List<ManufacturedSize> sizeList)
Set the `manufacturedSizes` parameter by List of ManufacturedSizes.
|
WidgetOptions |
setManufacturedSizes(ManufacturedSize[] manufacturedSizes)
Set the `manufacturedSizes` parameter by array of ManufacturedSize objects.
|
WidgetOptions |
setMetric(java.lang.String metric)
Set the `metric` parameter.
|
WidgetOptions |
setOpenEnabled(java.lang.Boolean state)
Enable or disable the widget open callback (`onWebWidgetOpen`).
|
WidgetOptions |
setRecommendEnabled(java.lang.Boolean state)
Enable or disable the widget recommed callback (`onWebWidgetRecommend`).
|
WidgetOptions |
setShopCountry(java.lang.String shopCountry)
Set the `shopCountry` parameter.
|
WidgetOptions |
setSizes(java.util.List<java.lang.String> sizeList)
Set the `sizes` parameter as a list of strings.
|
WidgetOptions |
setSizes(java.lang.String[] sizes)
Set the `sizes` parameter as an array of strings.
|
WidgetOptions |
setThumb(java.lang.String thumbUrl)
Set the `thumb` parameter.
|
WidgetOptions |
setUserId(java.lang.String userId)
Set `userId` parameter.
|
org.json.JSONObject |
toJSON()
Convert the WidgetOptions content to JSONObject representation, which is accepted by the widget.
|
public static java.lang.String UNITS_IMPERIAL
public static java.lang.String UNITS_METRIC
public static java.lang.String UNITS_BRITISH
public WidgetOptions setUserId(java.lang.String userId)
userId - The `userId` valuepublic WidgetOptions setLanguage(java.lang.String language)
language - The `language` valuepublic WidgetOptions setShopCountry(java.lang.String shopCountry)
shopCountry - The `shopCountry` valuepublic WidgetOptions setManufacturedSizes(ManufacturedSize[] manufacturedSizes)
manufacturedSizes - Array of ManfacturedSize objects.public WidgetOptions setManufacturedSizes(java.util.List<ManufacturedSize> sizeList)
sizeList - List of ManufacturedSizespublic WidgetOptions setSizes(java.lang.String[] sizes)
sizes - The array of size codes as stringspublic WidgetOptions setSizes(java.util.List<java.lang.String> sizeList)
sizes - The list of size codes as stringspublic WidgetOptions setThumb(java.lang.String thumbUrl)
thumbUrl - The complete publicly-accessible URL of the garment thumbnail.public WidgetOptions setMetric(java.lang.String metric)
metric - The `metric` valuepublic WidgetOptions setCartEnabled(java.lang.Boolean state)
state - The "add-to-cart" callback state.public WidgetOptions setOpenEnabled(java.lang.Boolean state)
state - The new "open" callback state.public WidgetOptions setCloseEnabled(java.lang.Boolean state)
state - The "open" callback state.public WidgetOptions setRecommendEnabled(java.lang.Boolean state)
state - The "recommed" callback state.public WidgetOptions setLoadErrorEnabled(java.lang.Boolean state)
state - The "load error" callback state.public org.json.JSONObject toJSON()