Multiple Products for Zia Skills
This card can be used to display single images for different products. Different actions can be defined for each product image.
Attribute | Mandatory | Description | Values |
text | Yes | The text to be shown above the card | { "text":"Here are some of our products ", } |
title | Yes | Title of each product | { "title":"Zylker Furniture", } |
subtitle | No | Subtitle of each product | { "subtitle":"Great furniture at affordable prices", } |
elements | Yes | List of products | { "elements": [ { "id": "Double Bed", "image": "https://zylkerfurniture.com/media/catalog/product/cache/1/thumbnail/1024x576/b58515f018eb873dafa430b6f9ae0c1e/f/r/front_1_.png" }, { "image": "https://images-na.ssl-images-zylkerfurniture.com/images/I/61wuHhZ0ZVL._SX355_.jpg", "id": "Wardrobe" } ], } |
id | Yes | ID for each product | { "id": "Double Bed", } |
image | Yes | URL for each product | { "image": "https://zylkerfurniture.com/media/catalog/product/cache/1/thumbnail/1024x576/b58515f018eb873dafa430b6f9ae0c1e/f/r/front_1_.png" } |
actions | No | List of links/buttons that can be used to goto a page or trigger an action in the client if required | |
label | Yes | The content shown in the link | { "label": "View more", } |
name | Yes | Unique name for the button | { "name": "viewmore", } |
type | Yes | Type of action (URL / client_action) | { "type": "url", } |
link | Yes | In case the type is URL, this is the link that opens when the button is clicked | { "link": "https://www.zylkerfurniture.com/doublebed.html" } |
clientaction_name | Yes | In case the type is client_action, the function specified in $zoho.salesiq.clientactions client object with this key will be invoked on click. | { "clientaction_name": "openBookingForm" } |
Use Case:
Context Handler Function:
Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies",[
{
"type":"multiple-product",
"text":"Here are some of our products",
"elements":[
{
"title":"Double Bed",
"subtitle":"Made from Rosewood",
"id":"doublebed",
"image":"https://www.zylkerfurniture.com/doublebed.png",
"actions":[
{
"label":"Book",
"name":"bookbtn",
"type":"url",
"link":"https://www.zylkerfurniture.com/doublebed.html"
}
]
},
{
"title":"Wardrobe",
"subtitle":"Made from Teak Wood",
"image":"https://www.zylkerfurniture.com/wardrobe.png",
"actions":[
{
"label":"Book",
"name":"bookbtn",
"type":"url",
"link":"https://www.zylkerfurniture.com/wardrobe.html"
}
]
}
]
}
]);
prompt = Map();
prompt.put("param_name", "reply");
prompt.put("data", response);
result.put("prompt", prompt);
result.put("todo", "prompt");
return result;<p>
Execution Function:
Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
{
"type":"multiple-product",
"text":"Here are some of our products",
"elements":[
{
"title":"Double Bed",
"subtitle":"Made from Rosewood",
"id":"doublebed",
"image":"https://www.zylkerfurniture.com/doublebed.png",
"actions":[
{
"label":"Book",
"name":"bookbtn",
"type":"url",
"link":"https://www.zylkerfurniture.com/doublebed.html"
}
]
},
{
"title":"Wardrobe",
"subtitle":"Made from Teak Wood",
"image":"https://www.zylkerfurniture.com/wardrobe.png",
"actions":[
{
"label":"Book",
"name":"bookbtn",
"type":"url",
"link":"https://www.zylkerfurniture.com/wardrobe.html"
}
]
}
]
}
]);
result.put("data", response);
return result;