Subversion Repositories SmartDukaan

Rev

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

Rev 3871 Rev 3877
Line 26... Line 26...
26
        raise PromotionException(111, 'You are not allowed to use this coupon')
26
        raise PromotionException(111, 'You are not allowed to use this coupon')
27
    
27
    
28
    #Allow only first 1000 users to use the coupon
28
    #Allow only first 1000 users to use the coupon
29
    count_coupon_usage = get_coupon_usage_count_by_user(coupon_code, cart.userId)
29
    count_coupon_usage = get_coupon_usage_count_by_user(coupon_code, cart.userId)
30
    
30
    
31
    if count_coupon_usage >= 1000:
31
    if count_coupon_usage > 0:
32
        raise PromotionException(112, 'This promotion is over.')
32
        raise PromotionException(112, 'You have already used the voucher.')
33
    
33
    
34
    discounts = []
34
    discounts = []
35
    
35
    
36
    if cart.lines:
36
    if cart.lines:
37
        total_selling_price = 0
37
        total_selling_price = 0