Product object

Prev Next

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.

your title goes here
If you pass any nil/null or empty string to this method, it will return an empty and invalid product object. An invalid product object will be ignored by any product-related operations.

The following parameters are required for the product object:

ParameterData Type
productIDString
nameString
taxonomyArray (of string)
imageURLString
priceDouble
currencyString

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");
your title goes here
Make sure to set the attributes in the given data types, and set no attribute as nil/null or as an empty string. 

Set color attribute

This method allows you to set the color attribute of your Insider product object. 

ParameterData Type
colorString

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. 

ParameterData Type
voucherNameString

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. 

ParameterData Type
voucherDiscountDouble

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. 

ParameterData Type
promotionNameString

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. 

ParameterData Type
promotionDiscountDouble

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. 

ParameterData Type
groupcodeString

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. 

ParameterData Type
sizeString

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. 

ParameterData Type
salePriceDouble

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. 

ParameterData Type
subCategoryString

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. 

ParameterData Type
shippingCostDouble

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. 

ParameterData Type
quantityInteger

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. 

ParameterData Type
stockInteger

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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueString

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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueInteger

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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueBoolean

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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueDouble

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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueDate 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.

your title goes here
Your attribute key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this attribute will be ignored. You can use underscores.
ParameterData Type
keyString
valueArray (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.

your title goes here
Your attribute key should be only numbers. Otherwise, this attribute will be ignored.
ParameterData Type
keyNumber
valueArray (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);