File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -53,5 +53,6 @@ the most basic methods or features.
53
53
- [ Complex template with Single-Product Message] ( template.md#complex-template-with-single-product-message )
54
54
- [ Complex template with Multi-Product Message] ( template.md#complex-template-with-multi-product-message )
55
55
- [ Complex template with Carousel] ( template.md#complex-template-with-carousel )
56
+ - [ Complex template with Product Carousel] ( template.md#complex-template-with-product-carousel )
56
57
- [ Complex template with Limited-Time Offer] ( template.md#complex-template-with-limited-time-offer )
57
58
- [ OTP prefab template] ( template.md#otp-prefab-template )
Original file line number Diff line number Diff line change @@ -206,11 +206,39 @@ const template_carousel_message = new Template(
206
206
new BodyComponent (new BodyParameter (" PROMO10" )),
207
207
new CarouselComponent (
208
208
new CarouselCard (
209
- new Image (image ),
209
+ new Image (" image_url " ),
210
210
new URLComponent (" ?code=PROMO10&product=1" )
211
211
),
212
212
new CarouselCard (
213
- new Image (image ),
213
+ new Image (" image_url" ),
214
+ new URLComponent (" ?code=PROMO10&product=2" )
215
+ )
216
+ )
217
+ );
218
+ ```
219
+
220
+ ## Complex template with Product Carousel
221
+
222
+ ``` ts
223
+ import {
224
+ Template ,
225
+ BodyComponent ,
226
+ CarouselComponent ,
227
+ CarouselCard ,
228
+ CatalogProduct
229
+ } from " whatsapp-api-js/messages" ;
230
+
231
+ const template_product_carousel_message = new Template (
232
+ " template_name" ,
233
+ " en" ,
234
+ new BodyComponent (new BodyParameter (" PROMO10" )),
235
+ new CarouselComponent (
236
+ new CarouselCard (
237
+ new CatalogProduct (" product_id_1" , " catalog_id" ),
238
+ new URLComponent (" ?code=PROMO10&product=1" )
239
+ ),
240
+ new CarouselCard (
241
+ new CatalogProduct (" product_id_2" , " catalog_id" ),
214
242
new URLComponent (" ?code=PROMO10&product=2" )
215
243
)
216
244
)
Original file line number Diff line number Diff line change @@ -910,7 +910,7 @@ export class CarouselCard implements ClientBuildableMessageComponent {
910
910
* @param components - The other components for the card
911
911
*/
912
912
constructor (
913
- header : Image | Video ,
913
+ header : Image | Video | CatalogProduct ,
914
914
...components : ( BodyComponent | ButtonComponent ) [ ]
915
915
) {
916
916
const tmp = new Template (
You can’t perform that action at this time.
0 commit comments