Subversion Repositories SmartDukaan

Rev

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

Rev 4189 Rev 4494
Line 96... Line 96...
96
        session.query(Promotion.id).limit(1).one()
96
        session.query(Promotion.id).limit(1).one()
97
        return True
97
        return True
98
    except:
98
    except:
99
        return False
99
        return False
100
 
100
 
-
 
101
def get_discounts_for_entity(entity_id):
-
 
102
    catalog_client = CatalogClient().get_client()
-
 
103
    items = catalog_client.getItemsByCatalogId(entity_id)
-
 
104
    
-
 
105
    discount_finder = ItemDiscountFinder()
-
 
106
    discounts = discount_finder.getCouponsAndDiscountsOnItem(items[0])
-
 
107
    
-
 
108
    if len(discounts) > 0:
-
 
109
        return {discounts[0][0]: discounts[0][1]}
-
 
110
    else:
-
 
111
        return {}
-
 
112
 
101
def get_item_discount_map(item_ids):
113
def get_item_discount_map(item_ids):
102
    
114
    
103
    discount_finder = ItemDiscountFinder()
115
    discount_finder = ItemDiscountFinder()
104
    item_coupons_discounts = []
116
    item_coupons_discounts = []
105
    
117