Subversion Repositories SmartDukaan

Rev

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

Rev 17393 Rev 17605
Line 63... Line 63...
63
 
63
 
64
AFFILIATE_OFFER_API= {1:"https://www.spicesafar.com/FreeBapp/fetchOffersSM?deviceId=%s&retailerCode=%d"}
64
AFFILIATE_OFFER_API= {1:"https://www.spicesafar.com/FreeBapp/fetchOffersSM?deviceId=%s&retailerCode=%d"}
65
AFFILIATE_OFFER_DESC_API = {1:"https://www.spicesafar.com/FreeBapp/individualOffersSM?deviceId=%s&offerId=%s&retailerCode=%d"}
65
AFFILIATE_OFFER_DESC_API = {1:"https://www.spicesafar.com/FreeBapp/individualOffersSM?deviceId=%s&offerId=%s&retailerCode=%d"}
66
CREDIT_TYPE_ORDER = "Order"
66
CREDIT_TYPE_ORDER = "Order"
67
CREDIT_TYPE_APP = "App"
67
CREDIT_TYPE_APP = "App"
-
 
68
SUB_CATEGORY_MAP = {7:'Memory Card',8:'Data Cable',9:'USB Lights',10:"Screen Magnifier"}
68
 
69
 
69
def get_mongo_connection(host='localhost', port=27017):
70
def get_mongo_connection(host='localhost', port=27017):
70
    global con
71
    global con
71
    if con is None:
72
    if con is None:
72
        print "Establishing connection %s host and port %d" %(host,port)
73
        print "Establishing connection %s host and port %d" %(host,port)
Line 91... Line 92...
91
        return None
92
        return None
92
    
93
    
93
    return date
94
    return date
94
 
95
 
95
def getCashBack(skuId, source_id, category_id, mc, mongoHost):
96
def getCashBack(skuId, source_id, category_id, mc, mongoHost):
96
    if not bool(mc.get("category_cash_back")):
97
    if mc.get("category_cash_back") is None or not bool(mc.get("category_cash_back")):
97
        populateCashBack(mc, mongoHost)
98
        populateCashBack(mc, mongoHost)
98
    itemCashBackMap = mc.get("item_cash_back")
99
    itemCashBackMap = mc.get("item_cash_back")
99
    itemCashBack = itemCashBackMap.get(skuId)
100
    itemCashBack = itemCashBackMap.get(skuId)
100
    if itemCashBack is not None:
101
    if itemCashBack is not None:
101
        return itemCashBack
102
        return itemCashBack