Subversion Repositories SmartDukaan

Rev

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

Rev 18445 Rev 18482
Line 891... Line 891...
891
        cartItem['packQuantity'] = item.packQuantity
891
        cartItem['packQuantity'] = item.packQuantity
892
        cartItem['minBuyQuantity'] = item.minimumBuyQuantity
892
        cartItem['minBuyQuantity'] = item.minimumBuyQuantity
893
        cartItem['quantityStep'] = item.quantityStep
893
        cartItem['quantityStep'] = item.quantityStep
894
        cartItem['bulkPricing'] = tempBulkItemList
894
        cartItem['bulkPricing'] = tempBulkItemList
895
        bulkPrice = None
895
        bulkPrice = None
-
 
896
        singleUnitPricing = False
896
        if item_id in bulkPricingItems:
897
        if item_id in bulkPricingItems:
897
            #Check quantity qualifies or not
898
            #Check quantity qualifies or not
898
            bulkPricingList = bulkPricingMap.get(item_id)
899
            bulkPricingList = bulkPricingMap.get(item_id)
899
            bulkPricingList = sorted(bulkPricingList, key=lambda x: x.quantity, reverse=False)
900
            bulkPricingList = sorted(bulkPricingList, key=lambda x: x.quantity, reverse=False)
900
            for pricingItems in bulkPricingList:
901
            for pricingItems in bulkPricingList:
-
 
902
                if pricingItems.quantity ==1:
-
 
903
                    singleUnitPricing = True
901
                if pricingItems.quantity <= line.quantity:
904
                if pricingItems.quantity <= line.quantity:
902
                    bulkPrice = pricingItems
905
                    bulkPrice = pricingItems
903
                tempBulkItemList.append({'quantity':pricingItems.quantity,'price':pricingItems.price})    
906
                tempBulkItemList.append({'quantity':pricingItems.quantity,'price':pricingItems.price})
904
            
907
            
905
        if item_id in dealItems:
908
        if item_id in dealItems:
-
 
909
            if not singleUnitPricing and item_id in bulkPricingItems:
-
 
910
                tempBulkItemList.append({'quantity':1,'price':deals[item_id].dealPrice})
906
            if bulkPrice is None:
911
            if bulkPrice is None:
907
                line.actual_price = deals[item_id].dealPrice
912
                line.actual_price = deals[item_id].dealPrice
908
            else:
913
            else:
909
                line.actual_price = bulkPrice.price
914
                line.actual_price = bulkPrice.price
910
            if deals[item_id].dealTextOption==0:
915
            if deals[item_id].dealTextOption==0:
Line 916... Line 921...
916
                line.freebieId = 0
921
                line.freebieId = 0
917
            if deals[item_id].dealFreebieOption==2:
922
            if deals[item_id].dealFreebieOption==2:
918
                line.freebieId =  deals[item_id].dealFreebieItemId
923
                line.freebieId =  deals[item_id].dealFreebieItemId
919
            cartItem['dealText'] = line.dealText
924
            cartItem['dealText'] = line.dealText
920
        else:
925
        else:
-
 
926
            if not singleUnitPricing and item_id in bulkPricingItems:
-
 
927
                tempBulkItemList.append({'quantity':1,'price':item.sellingPrice})
921
            if bulkPrice is None:
928
            if bulkPrice is None:
922
                line.actual_price = item.sellingPrice
929
                line.actual_price = item.sellingPrice
923
            else:
930
            else:
924
                line.actual_price = bulkPrice.price
931
                line.actual_price = bulkPrice.price
925
            if item.bestDealText:
932
            if item.bestDealText: