Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Chris Beardsley
Added: Jan 22, 2019 3:50 PM
Views: 26
Tags: no tags
  1. function createFacebookData(){
  2. var contents = [];
  3. for(var i = 0; i < {{dlv - ecommerce.purchase.products}}.length; i++) {
  4.   var product = {{dlv - ecommerce.purchase.products}}[i];
  5.   var content = {"id": product["id"], "quantity": product["quantity"], "item_price": product["price"] };
  6.   contents.push(content);
  7. }
  8. return contents}