Subversion Repositories SmartDukaan

Rev

Rev 3559 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3559 Rev 4189
Line 90... Line 90...
90
        
90
        
91
        cart.totalPrice = total_selling_price
91
        cart.totalPrice = total_selling_price
92
        cart.discountedPrice = total_discounted_price
92
        cart.discountedPrice = total_discounted_price
93
    
93
    
94
    return cart, discounts
94
    return cart, discounts
-
 
95
 
-
 
96
def getDiscountOnItem(item):
-
 
97
    discount_expressions = [
-
 
98
            '250 if item.id in (5, 6, 7, 8, 9, 1499, 10, 1560, 1561) else None',
-
 
99
            '600 if item.id == 2016 else None',
-
 
100
            '1390 if item.id == 1543 else None',
-
 
101
            '1690 if item.id == 1550 else None'
-
 
102
        ]
-
 
103
    for expression in discount_expressions:
-
 
104
        discount = eval(expression)
-
 
105
        
-
 
106
        if discount is not None:
-
 
107
            return discount
-
 
108
    
-
 
109
    return None
95
110