Subversion Repositories SmartDukaan

Rev

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

Rev 18635 Rev 19243
Line 129... Line 129...
129
    for bulkPricingDict in item['bulkPricing']:
129
    for bulkPricingDict in item['bulkPricing']:
130
        if bulkPricingDict.get('quantity') == minBuyQty:
130
        if bulkPricingDict.get('quantity') == minBuyQty:
131
            adjusted = True
131
            adjusted = True
132
    if minBuyQty > 1 and not adjusted:
132
    if minBuyQty > 1 and not adjusted:
133
        allBulkPricing = bulkItemsMap.get(item.get('item_id'))
133
        allBulkPricing = bulkItemsMap.get(item.get('item_id'))
134
        if len(allBulkPricing) == 0:
134
        if allBulkPricing is None or len(allBulkPricing) == 0:
135
            item['bulkPricing'] = [{'quantity':minBuyQty,'price':item.get('sellingPrice')}]
135
            item['bulkPricing'] = [{'quantity':minBuyQty,'price':item.get('sellingPrice')}]
136
        else:
136
        else:
137
            allBulkPricing = sorted(allBulkPricing, key=lambda k: k['quantity'],reverse=False)
137
            allBulkPricing = sorted(allBulkPricing, key=lambda k: k['quantity'],reverse=False)
138
            effectiveBulkPrice = None
138
            effectiveBulkPrice = None
139
            for bulkPricing in allBulkPricing:
139
            for bulkPricing in allBulkPricing: