Hello,
i want to add this code on cart page for facebook pixel track.I want to have all the skus that is on the cart in one line
fbq('track', 'Purchase', {
content_ids: ['sku1', 'sku2' ],
});
when i am adding the following content_ids: ['<?php echo $prow->product_sku ?>' ], i can have only the one sku that is on the cart but i want all the sku's in one line...
is there something i can do?
Thanks
YOu need to do a foreach in PHP
something so :
<?php $skus = array();
foreach ($this->cart->products as $pkey => $prow) {
$skus[] = $prow->product_sku;
}
?>
// javascript part
fbq('track', 'Purchase', {
content_ids: ['<?php echo implode("','",$skus) ?>' ],
});
thank you very much
very good ! thx