isCouponsPresent function

bool isCouponsPresent(
  1. bool cartUser,
  2. ProductData currentService
)

Implementation

bool isCouponsPresent(bool cartUser, ProductData currentService){

  List<ProductData> _products = cartGetProductsForBooking();
  for (var item in offers) {
    if (!item.visible)
      continue;
    if (!cartUser){
      if (_isCouponValid(item, currentService))
        return true;
    }else {
      var ret = true;
      for (var product in _products) {
        if (!_isCouponValid(item, product))
          ret = false;
      }
      if (ret)
        return true;
    }
  }
  return false;
}