Subversion Repositories SmartDukaan

Rev

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

Rev 5499 Rev 5500
Line 90... Line 90...
90
    
90
    
91
    return cart, discounts
91
    return cart, discounts
92
 
92
 
93
 
93
 
94
def getDiscountOnItem(item):
94
def getDiscountOnItem(item):
95
    discount_expressions = [
-
 
96
            '150 if item.id in (159, 160, 161) else None',
-
 
97
            '200 if item.brand == "Nokia" and item.sellingPrice > 2999 and item.sellingPrice < 5001 and item.id not in (1590, 2014, 2063, 2035, 2036) else None',
-
 
98
            '500 if item.brand == "Nokia" and item.sellingPrice > 5000 and item.id not in (2565, 2602, 2210, 2478) else None'
-
 
99
        ]
-
 
100
    for expression in discount_expressions:
-
 
101
        discount = eval(expression)
-
 
102
        
-
 
103
        if discount is not None:
-
 
104
            return discount
-
 
105
    
-
 
106
    return None
95
    return None
107
96