| Line 146... |
Line 146... |
| 146 |
def getCashBackDetails(identifier, source_id):
|
146 |
def getCashBackDetails(identifier, source_id):
|
| 147 |
"""Need to add item level cashback, no data available right now."""
|
147 |
"""Need to add item level cashback, no data available right now."""
|
| 148 |
|
148 |
|
| 149 |
if source_id in (1,2,4):
|
149 |
if source_id in (1,2,4):
|
| 150 |
skuData = list(get_mongo_connection().Catalog.MasterData.find({'identifier':identifier.strip(), 'source_id':source_id}))
|
150 |
skuData = list(get_mongo_connection().Catalog.MasterData.find({'identifier':identifier.strip(), 'source_id':source_id}))
|
| 151 |
elif source_id in (3):
|
151 |
elif source_id == 3:
|
| 152 |
skuData = list(get_mongo_connection().Catalog.MasterData.find({'secondaryIdentifier':identifier.strip(), 'source_id':source_id}))
|
152 |
skuData = list(get_mongo_connection().Catalog.MasterData.find({'secondaryIdentifier':identifier.strip(), 'source_id':source_id}))
|
| - |
|
153 |
else:
|
| - |
|
154 |
return {}
|
| 153 |
if len(skuData) > 0:
|
155 |
if len(skuData) > 0:
|
| 154 |
cashback = list(get_mongo_connection().Catalog.CategoryCashBack.find({'category_id':skuData[0]['category_id'], 'source_id':source_id}))
|
156 |
cashback = list(get_mongo_connection().Catalog.CategoryCashBack.find({'category_id':skuData[0]['category_id'], 'source_id':source_id}))
|
| 155 |
if len(cashback) > 0:
|
157 |
if len(cashback) > 0:
|
| 156 |
return cashback[0]
|
158 |
return cashback[0]
|
| 157 |
else:
|
159 |
else:
|