Subversion Repositories SmartDukaan

Rev

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

Rev 4155 Rev 4189
Line 130... Line 130...
130
            raise PromotionException(115, 'This coupon is applicable only for selective tablets.')
130
            raise PromotionException(115, 'This coupon is applicable only for selective tablets.')
131
        
131
        
132
        cart.totalPrice = total_selling_price
132
        cart.totalPrice = total_selling_price
133
        cart.discountedPrice = total_discounted_price
133
        cart.discountedPrice = total_discounted_price
134
    
134
    
135
    return cart, discounts
-
 
136
135
    return cart, discounts
-
 
136
 
-
 
137
 
-
 
138
def getDiscountOnItem(item):
-
 
139
    discount_expressions = [
-
 
140
            '900 if item.id in [2177, 2178, 2179, 2180, 2181, 2182] else None',
-
 
141
            '250 if item.id == 2199 else None',
-
 
142
            '2500 if item.id == 1550 else None',
-
 
143
            '500 if item.id == 1551 else None',
-
 
144
            '2000 if item.id == 1552 else None',
-
 
145
            '2500 if item.id == 2215 else None',
-
 
146
            '1500 if item.id == 2230 else None',
-
 
147
            '1700 if item.id == 2005 else None',
-
 
148
            '1200 if item.id == 2022 else None'
-
 
149
        ]
-
 
150
    for expression in discount_expressions:
-
 
151
        discount = eval(expression)
-
 
152
        
-
 
153
        if discount is not None:
-
 
154
            return discount
-
 
155
    
-
 
156
    return None
-
 
157
137
158