Subversion Repositories SmartDukaan

Rev

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

Rev 20940 Rev 20981
Line 699... Line 699...
699
def show_cod_option(cartId, sourceId, pincode):
699
def show_cod_option(cartId, sourceId, pincode):
700
    cart = Cart.get_by(id = cartId)
700
    cart = Cart.get_by(id = cartId)
701
    cod_option = True
701
    cod_option = True
702
    logistics_client = LogisticsClient().get_client()
702
    logistics_client = LogisticsClient().get_client()
703
    if cart:
703
    if cart:
-
 
704
        itemIds = []
-
 
705
        for line in cart.lines:
-
 
706
            itemIds.append(line.item_id)
-
 
707
        catalog_client = CatalogClient().get_client()
-
 
708
        items = catalog_client.getItems(itemIds)
-
 
709
        for item in items:
-
 
710
            if item.category not in [10006, 10010]:
-
 
711
                return False
-
 
712
    
704
        if cart.coupon_code:
713
        if cart.coupon_code:
705
            promotion_client = PromotionClient().get_client()
714
            promotion_client = PromotionClient().get_client()
706
            cod_option = promotion_client.isCodApplicable(to_t_cart(cart))
715
            cod_option = promotion_client.isCodApplicable(to_t_cart(cart))
707
        
716
        
708
        if cod_option and cart.lines:
717
        if cod_option and cart.lines:
Line 855... Line 864...
855
    except:
864
    except:
856
        traceback.print_exc()
865
        traceback.print_exc()
857
        return False
866
        return False
858
             
867
             
859
    
868
    
860
def valiate_cart_new(cartId, customer_pincode, sourceId):
869
def validate_cart_new(cartId, customer_pincode, sourceId):
861
    
870
    
862
    inventory_client = CatalogClient().get_client()
871
    inventory_client = CatalogClient().get_client()
863
    logistics_client = LogisticsClient().get_client()
872
    logistics_client = LogisticsClient().get_client()
864
    promotion_client = PromotionClient().get_client()
873
    promotion_client = PromotionClient().get_client()
865
    # No need to validate duplicate items since there are only two ways
874
    # No need to validate duplicate items since there are only two ways