Skip to content

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
njparadis committed Aug 17, 2021
1 parent ab267d6 commit ca7192e
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,15 @@ function prepareOrderPayload(order, isFutureOrder, mailType) {
var discountCoupon = '';
var promotionID = '';
var shippingLineItems = order.shipments[0].shippingLineItems;
// var shippingLineItem = {};
// var shippingItemsArray = [];
if (shippingLineItems && shippingLineItems.length > 0) {
if (shippingLineItems[0].lineItemCtnr) {
var couponLineItems = shippingLineItems[0].lineItemCtnr.couponLineItems;
if (couponLineItems && couponLineItems.length > 0) {
var couponLineItem = {};
for (var q in couponLineItems) {
if (couponLineItem[q].statusCode == 'APPLIED') {
discountCoupon = couponLineItem[q].couponCode;
if (!empty(couponLineItem[q].promotion)) {
var promotion = couponLineItem[q].promotion;
if (couponLineItems[q].statusCode == 'APPLIED') {
discountCoupon = couponLineItems[q].couponCode;
if (!empty(couponLineItems[q].promotion)) {
var promotion = couponLineItems[q].promotion;
promotionID = promotion.ID;
}
break;
Expand Down

0 comments on commit ca7192e

Please sign in to comment.