Product object is required for revenue tracking, recommendation engine, and campaigns such as cart reminder.
You can follow this guide to set the product object and its attributes.
Set product object
Once you create a product object, you can set its attributes. You can set predefined (e.g. color, size, voucher name, sub-category, etc.) and custom attributes.
The following parameters are required for the product object:
| Parameter | Data Type |
|---|---|
| productID | String |
| name | String |
| taxonomy | Array (of string) |
| imageURL | String |
| price | Double |
| currency | String |
Method Signature
FlutterInsiderProduct createNewProduct(String productID, name,
List<String> taxonomy, String imageURL, double price, String currency)Method Example
List<String> taxonomy = new List(3);
taxonomy[0] = "tax1";
taxonomy[1] = "tax2";
taxonomy[2] = "tax3";
FlutterInsiderProduct insiderExampleProduct =
FlutterInsider.Instance.createNewProduct("productID", "productName",
taxonomy, "imageURL", 1000.5, "currency");Set color attribute
This method allows you to set the color attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| color | String |
Method Signature
FlutterInsiderProduct setColor(String color)Method Example
insiderExampleProduct.setColor("color");Set voucher name attribute
This method allows you to set the voucher name attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| voucherName | String |
Method Signature
FlutterInsiderProduct setVoucherName(String voucherName)Method Example
insiderExampleProduct.setVoucherName("voucherName");Set voucher discount attribute
This method allows you to set the voucher discount attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| voucherDiscount | Double |
Method Signature
FlutterInsiderProduct setVoucherDiscount(double voucherDiscount)Method Example
insiderExampleProduct.setVoucherDiscount(10.5);Set promotion name attribute
This method allows you to set the promotion name attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| promotionName | String |
Method Signature
FlutterInsiderProduct setPromotionName(String promotionName)Method Example
insiderExampleProduct.setPromotionName("promotionName");Set promotion discount attribute
This method allows you to set the promotion discount attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| promotionDiscount | Double |
Method Signature
FlutterInsiderProduct setPromotionDiscount(double promotionDiscount)Method Example
insiderExampleProduct.setPromotionDiscount(10.5);Set GroupCode attribute
This method allows you to set the groupcode of your Insider product object.
| Parameter | Data Type |
|---|---|
| groupcode | String |
Method Signature
FlutterInsiderProduct setGroupCode(String groupcode)Method Example
insiderExampleProduct.setGroupCode("XXXX")Set size attribute
This method allows you to set the size attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| size | String |
Method Signature
FlutterInsiderProduct setSize(String size)Method Example
insiderExampleProduct.setSize("size");Set sale price attribute
This method allows you to set the sale price attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| salePrice | Double |
Method Signature
FlutterInsiderProduct setSalePrice(double salePrice)Method Example
insiderExampleProduct.setSalePrice(10.5);Set subcategory attribute
This method is used for Smart Recommender and allows you to set the subcategory attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| subCategory | String |
Method Signature
FlutterInsiderProduct setSubCategory(String subCategory)Method Example
insiderExampleProduct.setSubCategory("subCategory");Set shipping cost attribute
This method allows you to set the shipping cost attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| shippingCost | Double |
Method Signature
FlutterInsiderProduct setShippingCost(double shippingCost)Method Example
insiderExampleProduct.setShippingCost(10.5);Set quantity attribute
This method allows you to set the quantity attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| quantity | Integer |
Method Signature
FlutterInsiderProduct setQuantity(int quantity)Method Example
insiderExampleProduct.setQuantity(10);Set stock attribute
This method allows you to set the stock attribute of your Insider product object.
| Parameter | Data Type |
|---|---|
| stock | Integer |
Method Signature
FlutterInsiderProduct setStock(int stock)Method Example
insiderExampleProduct.setStock(10);Set brand attribute
This method allows you to set the brand for your Insider product object.
Method Signature
FlutterInsiderProduct setBrand(String brand)Method Example
insiderExampleProduct.setBrand("brand");Set stock keeping unit attribute
This method allows you to set the stock keeping unit for your Insider product object.
Method Signature
FlutterInsiderProduct setSku(String sku)Method Example
insiderExampleProduct.setSku("sku");Set gender attribute
This method allows you to set the gender for your Insider product object.
Method Signature
FlutterInsiderProduct setGender(String gender)Method Example
insiderExampleProduct.setGender("gender");Set multipack attribute
This method allows you to set the multipack for your Insider product object.
Method Signature
FlutterInsiderProduct setMultipack(String multipack)Method Example
insiderExampleProduct.setMultipack("multipack");Set product type attribute
This method allows you to set the product type for your Insider product object.
Method Signature
FlutterInsiderProduct setProductType(String productType)Method Example
insiderExampleProduct.setProductType("productType");Set global trade attribute
This method allows you to set the global trade for your Insider product object.
Method Signature
FlutterInsiderProduct setGtin(String gtin)Method Example
insiderExampleProduct.setGtin("gtin");Set description attribute
This method allows you to set the description for your Insider product object.
Method Signature
FlutterInsiderProduct setDescription(String description)Method Example
insiderExampleProduct.setDescription("description");Set tags attribute
This method allows you to set the tags for your Insider product object.
Method Signature
FlutterInsiderProduct setTags(List<String> tags)Method Example
List<String> tags = List(3);
tags[0] = "running";
tags[1] = "summer";
tags[2] = "discount";
insiderExampleProduct.setTags(tags);Set custom string attribute
This method allows you to set the custom string attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | String |
Method Signature
FlutterInsiderProduct setCustomAttributeWithString(String key, String value)Method Example
insiderExampleProduct.setCustomAttributeWithString("key", "value");Set custom integer attribute
This method allows you to set the custom integer attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | Integer |
Method signature
FlutterInsiderProduct setCustomAttributeWithInt(String key, int value)Method Example
insiderExampleProduct.setCustomAttributeWithInt("key", 10);Set custom boolean attribute
This method allows you to set the custom boolean attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | Boolean |
Method Signature
FlutterInsiderProduct setCustomAttributeWithBoolean(String key, bool value)Method Example
insiderExampleProduct.setCustomAttributeWithBoolean("key", true);Set custom double attribute
This method allows you to set the custom double attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | Double |
Method Signature
FlutterInsiderProduct setCustomAttributeWithDouble(String key, double value)Method Example
insiderExampleProduct.setCustomAttributeWithDouble("key", 10.5);Set custom date attribute
This method allows you to set the custom date attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | Date object |
Method Signature
FlutterInsiderProduct setCustomAttributeWithDate(String key, DateTime value)Method Example
DateTime date = new DateTime.now();
insiderExampleProduct.setCustomAttributeWithDate("key", date);Set custom array of string attribute
This method allows you to set the custom array of string attribute for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | String |
| value | Array (of string) |
Method Signature
FlutterInsiderProduct setCustomAttributeWithStringArray(String key, List<String> values)Method Example
List<String> stringArray = new List(3);
arr[0] = "value1";
arr[1] = "value2";
arr[2] = "value3";
insiderExampleProduct.setCustomAttributeWithStringArray("key", stringArray);Set custom array of number attribute
This method allows you to set the custom array of string number for your Insider product object.
| Parameter | Data Type |
|---|---|
| key | Number |
| value | Array (of number) |
Method Signature
FlutterInsiderProduct setCustomAttributeWithNumericArray(String key, List<num> values)Method Example
List<num> numberArray = new List(3);
arr[0] = 5;
arr[1] = 3.14;
arr[2] = 100;
insiderExampleProduct.setCustomAttributeWithNumericArray("key", numberArray);