Lista Multi Producto
function ListMultipleProducts(number, headerText, bodyText, footerText, catalogId, sections){
const sectionObjects = sections.map(section => {
return {
title: section.title,
product_items: section.productRetailerIds.map(id => {
return { product_retailer_id: id };
})
};
});
const data = JSON.stringify({
"messaging_product": "whatsapp",
"to" : number,
"type": "interactive",
"interactive": {
"type": "product_list",
"header":{
"type": "text",
"text": headerText
},
"body":{
"text": bodyText
},
"footer":{
"text": footerText
},
"action": {
"catalog_id": catalogId,
"sections": sectionObjects
}
}
});
return data;
}Última actualización