Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var subTotal = [];
- async.forEachOf(cartitems, function (dataElement, i, inner_callback){
- console.log(i)
- let id = cartitems[i].products_id;
- modelProduct.getPriceById(id,(hasil)=>{
- if (!hasil) {
- console.log('err')
- inner_callback();
- } else {
- console.log(hasil[0].publish_price); //3000, 32000
- subTotal.push(hasil[0].publish_price);
- inner_callback();
- }
- })
- }, function(err){
- console.log('subtotl '+ JSON.stringify(subTotal));
- });
Advertisement
Add Comment
Please, Sign In to add comment