Utilize variant.barcode in updating ajax dropdown cart

Highlighted
New Member
2 0 0

Have tried many things to try and utilize the upc field from the product variant when updating the drop down cart but cant seem to get the UPC information. we store a number in the upc field that represents certain things. I cant seem to find the right combination for providing the data in that field.

 

for (var i = 0; i < cart.items.length; i++) {

   var message ='';

switch(cart.items[i].variant.barcode) {
   case "1": 
               message ='this is 1';
       break;
   case "2": 
               message ='this is 2';
       break;
   case "3": 
               message ='this is 3';
       break;
   }


}

0 Likes