Subversion Repositories SmartDukaan

Rev

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

Rev 18482 Rev 18521
Line 868... Line 868...
868
    
868
    
869
    cartMessageChanged = 0
869
    cartMessageChanged = 0
870
    cartMessageOOS = 0
870
    cartMessageOOS = 0
871
    cartMessageUndeliverable = 0
871
    cartMessageUndeliverable = 0
872
    
872
    
-
 
873
    
-
 
874
    
873
    for line in cart_lines:
875
    for line in cart_lines:
874
        itemQuantityChanged=False
876
        itemQuantityChanged=False
875
        cartItem={}
877
        cartItem={}
876
        tempBulkItemList = []
878
        tempBulkItemList = []
877
        
879
        
Line 890... Line 892...
890
        cartItem['catalogItemId'] = item.catalogItemId
892
        cartItem['catalogItemId'] = item.catalogItemId
891
        cartItem['packQuantity'] = item.packQuantity
893
        cartItem['packQuantity'] = item.packQuantity
892
        cartItem['minBuyQuantity'] = item.minimumBuyQuantity
894
        cartItem['minBuyQuantity'] = item.minimumBuyQuantity
893
        cartItem['quantityStep'] = item.quantityStep
895
        cartItem['quantityStep'] = item.quantityStep
894
        cartItem['bulkPricing'] = tempBulkItemList
896
        cartItem['bulkPricing'] = tempBulkItemList
-
 
897
        
-
 
898
        item_shipping_info = inventory_client.isActive(item_id) 
-
 
899
        if item_shipping_info.isActive:
-
 
900
            if item_shipping_info.isRisky and item_shipping_info.quantity < line.quantity:
-
 
901
                line.quantity = item_shipping_info.quantity
-
 
902
                itemQuantityChanged=True
-
 
903
            cartItem['quantity'] = line.quantity
-
 
904
            cartItem['maxQuantity'] = min(item_shipping_info.quantity, 20)
-
 
905
            if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
-
 
906
                cartItem['maxQuantity'] = min(item_shipping_info.quantity, item.maximumBuyQuantity)
-
 
907
        
-
 
908
        if item_shipping_info.quantity < cartItem['minBuyQuantity']:
-
 
909
            cartItem['minBuyQuantity'] = item_shipping_info.quantity 
-
 
910
        
-
 
911
        if line.quantity < cartItem['minBuyQuantity']:
-
 
912
            itemQuantityChanged=True
-
 
913
            line.quantity = cartItem['minBuyQuantity']
-
 
914
        
-
 
915
        if line.quantity > cartItem['maxQuantity']:
-
 
916
            itemQuantityChanged=True
-
 
917
            line.quantity = cartItem['maxQuantity']
-
 
918
 
895
        bulkPrice = None
919
        bulkPrice = None
896
        singleUnitPricing = False
920
        singleUnitPricing = False
897
        if item_id in bulkPricingItems:
921
        if item_id in bulkPricingItems:
898
            #Check quantity qualifies or not
922
            #Check quantity qualifies or not
899
            bulkPricingList = bulkPricingMap.get(item_id)
923
            bulkPricingList = bulkPricingMap.get(item_id)
Line 933... Line 957...
933
                cartItem['dealText'] = item.bestDealText
957
                cartItem['dealText'] = item.bestDealText
934
            line.dealText = None
958
            line.dealText = None
935
            line.freebieId = None
959
            line.freebieId = None
936
        cartItem['sellingPrice'] = line.actual_price
960
        cartItem['sellingPrice'] = line.actual_price
937
        
961
        
938
        item_shipping_info = inventory_client.isActive(item_id) 
-
 
939
        if item_shipping_info.isActive:
962
        if item_shipping_info.isActive:
940
            if item_shipping_info.isRisky and item_shipping_info.quantity < line.quantity:
-
 
941
                line.quantity = item_shipping_info.quantity
-
 
942
                itemQuantityChanged=True
-
 
943
            cartItem['quantity'] = line.quantity
-
 
944
            cartItem['maxQuantity'] = min(item_shipping_info.quantity, 20)
-
 
945
            if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
-
 
946
                cartItem['maxQuantity'] = min(item_shipping_info.quantity, item.maximumBuyQuantity) 
-
 
947
            cart.total_price = cart.total_price + (line.actual_price * line.quantity)
963
            cart.total_price = cart.total_price + (line.actual_price * line.quantity)
948
            try:
964
            try:
949
                item_delivery_estimate = logistics_client.getLogisticsEstimation(item_id, customer_pincode, DeliveryType.PREPAID).deliveryTime
965
                item_delivery_estimate = logistics_client.getLogisticsEstimation(item_id, customer_pincode, DeliveryType.PREPAID).deliveryTime
950
            except LogisticsServiceException:
966
            except LogisticsServiceException:
951
                item_delivery_estimate = -1
967
                item_delivery_estimate = -1