function formatCatalog(catalog){
  var data = array[catalog].data
  for (i = 0; i < data.length; i++) {
    var tags = [];
    ['itemClass', 'style', 'brand', 'gender', 'badge',	'keyword',	'author',	'contentClass'].forEach(function(e) {
      if(data[i][e]!='' && data[i][e]!=null){
        var options = data[i][e].split(';');
        options.filter(n => n)
        options.forEach(a => tags.push({ "type":"t", "tagType": properCase(e), "_id": $.trim(a), "name":$.trim(a)}));
      }
      delete data[i][e]
    })
    data[i].tags = tags;
    data[i].categories = [{"type":"c", "_id": data[i]["category"], "name":data[i]["category"]}];
  }
  array[catalog].data = data;
}
// Format Products to Required Evergage format
Format Products to Required Evergage format
Format Products to Required Evergage format
function formatCatalog(catalog){
  var data = array[catalog].data
  for (i = 0; i < data.length; i++) {
    var tags = [];
    ['itemClass', 'style', 'brand', 'gender', 'badge',	'keyword',	'author',	'contentClass'].forEach(function(e) {
      if(data[i][e]!='' && data[i][e]!=null){
        var options = data[i][e].split(';');
        options.filter(n => n)
        options.forEach(a => tags.push({ "type":"t", "tagType": properCase(e), "_id": $.trim(a), "name":$.trim(a)}));
      }
      delete data[i][e]
    })
    data[i].tags = tags;
    data[i].categories = [{"type":"c", "_id": data[i]["category"], "name":data[i]["category"]}];
  }
  array[catalog].data = data;
}
function formatCatalog ( catalog ) { var data = array [ catalog ] . data for ( i = 0 ; i < data . length ; i ++ ) { var tags = [ ] ; [ 'itemClass' , 'style' , 'brand' , 'gender' , 'badge' , 'keyword' , 'author' , 'contentClass' ] . forEach ( function ( e ) { if ( data [ i ] [ e ] != '' && data [ i ] [ e ] != null ) { var options = data [ i ] [ e ] . split ( ';' ) ; options . filter ( n => n ) options . forEach ( a => tags . push ( { "type" : "t" , "tagType" : properCase ( e ) , "_id" : $ . trim ( a ) , "name" : $ . trim ( a ) } ) ) ; } delete data [ i ] [ e ] } ) data [ i ] . tags = tags ; data [ i ] . categories = [ { "type" : "c" , "_id" : data [ i ] [ "category" ] , "name" : data [ i ] [ "category" ] } ] ; } array [ catalog ] . data = data ; }
Format Products to Required Evergage format
Format Products to Required Evergage format