Subversion Repositories SmartDukaan

Rev

Rev 6330 | Rev 6389 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6330 Rev 6355
Line 485... Line 485...
485
def show_cod_option(cartId, sourceId, pincode):
485
def show_cod_option(cartId, sourceId, pincode):
486
    cart = Cart.get_by(id = cartId)
486
    cart = Cart.get_by(id = cartId)
487
    cod_option = True
487
    cod_option = True
488
    logistics_client = LogisticsClient().get_client()
488
    logistics_client = LogisticsClient().get_client()
489
    if cart:
489
    if cart:
-
 
490
        if cart.coupon_code:
490
        if cart.coupon_code and cart.coupon_code.lower() == 'searlybird':
491
            promotion_client = PromotionClient().get_client()
491
            cod_option = False
492
            cod_option = promotion_client.isCodApplicable(cart.coupon_code)
492
        
493
        
493
        elif cart.lines:
494
        if cod_option and cart.lines:
494
            for line in cart.lines:
495
            for line in cart.lines:
495
                logistics_info = logistics_client.getLogisticsEstimation(line.item_id, pincode, DeliveryType.PREPAID)
496
                logistics_info = logistics_client.getLogisticsEstimation(line.item_id, pincode, DeliveryType.PREPAID)
496
                if not logistics_info.codAllowed:
497
                if not logistics_info.codAllowed:
497
                    cod_option = False
498
                    cod_option = False
498
                    break
499
                    break