| Line 924... |
Line 924... |
| 924 |
|
924 |
|
| 925 |
for line in cart_lines:
|
925 |
for line in cart_lines:
|
| 926 |
itemQuantityChanged=False
|
926 |
itemQuantityChanged=False
|
| 927 |
cartItem={}
|
927 |
cartItem={}
|
| 928 |
tempBulkItemList = []
|
928 |
tempBulkItemList = []
|
| - |
|
929 |
user_item_pricing = user_item_pricing_map.get(user.id)
|
| 929 |
|
930 |
|
| 930 |
old_estimate = line.estimate
|
931 |
old_estimate = line.estimate
|
| 931 |
item_id = line.item_id
|
932 |
item_id = line.item_id
|
| 932 |
item = itemsMap.get(item_id)
|
933 |
item = itemsMap.get(item_id)
|
| 933 |
#in case item is missing remove that line
|
934 |
#in case item is missing remove that line
|
| Line 949... |
Line 950... |
| 949 |
item_shipping_info = catalog_client.isActive(item_id)
|
950 |
item_shipping_info = catalog_client.isActive(item_id)
|
| 950 |
if item_shipping_info.isActive:
|
951 |
if item_shipping_info.isActive:
|
| 951 |
if item_shipping_info.isRisky and item_shipping_info.quantity < line.quantity:
|
952 |
if item_shipping_info.isRisky and item_shipping_info.quantity < line.quantity:
|
| 952 |
line.quantity = item_shipping_info.quantity
|
953 |
line.quantity = item_shipping_info.quantity
|
| 953 |
itemQuantityChanged=True
|
954 |
itemQuantityChanged=True
|
| - |
|
955 |
if user_item_pricing.has_key(item_id):
|
| - |
|
956 |
cartItem['maxQuantity'] = min(250,item_shipping_info.quantity)
|
| - |
|
957 |
else:
|
| 954 |
cartItem['maxQuantity'] = min(item_shipping_info.quantity,100)
|
958 |
cartItem['maxQuantity'] = min(item_shipping_info.quantity,100)
|
| 955 |
if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
|
959 |
if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
|
| 956 |
cartItem['maxQuantity'] = min(item_shipping_info.quantity, item.maximumBuyQuantity)
|
960 |
cartItem['maxQuantity'] = min(item_shipping_info.quantity, item.maximumBuyQuantity)
|
| 957 |
else:
|
961 |
else:
|
| 958 |
cartItem['maxQuantity'] =0
|
962 |
cartItem['maxQuantity'] =0
|
| 959 |
|
963 |
|
| 960 |
|
964 |
|
| 961 |
if item_shipping_info.quantity < cartItem['minBuyQuantity']:
|
965 |
if item_shipping_info.quantity < cartItem['minBuyQuantity']:
|
| Line 971... |
Line 975... |
| 971 |
|
975 |
|
| 972 |
cartItem['quantity'] = line.quantity
|
976 |
cartItem['quantity'] = line.quantity
|
| 973 |
|
977 |
|
| 974 |
bulkPrice = None
|
978 |
bulkPrice = None
|
| 975 |
singleUnitPricing = False
|
979 |
singleUnitPricing = False
|
| 976 |
user_item_pricing = user_item_pricing_map.get(user.id)
|
- |
|
| 977 |
if item_id in bulkPricingItems and not (user_item_pricing and user_item_pricing.has_key(item_id)):
|
980 |
if item_id in bulkPricingItems and not (user_item_pricing and user_item_pricing.has_key(item_id)):
|
| 978 |
#Check quantity qualifies or not
|
981 |
#Check quantity qualifies or not
|
| 979 |
bulkPricingList = bulkPricingMap.get(item_id)
|
982 |
bulkPricingList = bulkPricingMap.get(item_id)
|
| 980 |
bulkPricingList = sorted(bulkPricingList, key=lambda x: x.quantity, reverse=False)
|
983 |
bulkPricingList = sorted(bulkPricingList, key=lambda x: x.quantity, reverse=False)
|
| 981 |
for pricingItems in bulkPricingList:
|
984 |
for pricingItems in bulkPricingList:
|
| Line 990... |
Line 993... |
| 990 |
tempBulkItemList.append({'quantity':1,'price':deals[item_id].dealPrice})
|
993 |
tempBulkItemList.append({'quantity':1,'price':deals[item_id].dealPrice})
|
| 991 |
if bulkPrice is None:
|
994 |
if bulkPrice is None:
|
| 992 |
line.actual_price = deals[item_id].dealPrice
|
995 |
line.actual_price = deals[item_id].dealPrice
|
| 993 |
if user_item_pricing and user_item_pricing.has_key(item_id):
|
996 |
if user_item_pricing and user_item_pricing.has_key(item_id):
|
| 994 |
line.actual_price = user_item_pricing.get(item_id)
|
997 |
line.actual_price = user_item_pricing.get(item_id)
|
| 995 |
#users in item pricing can buy upto 200
|
- |
|
| 996 |
cartItem['maxQuantity'] = min(200,item_shipping_info.quantity)
|
- |
|
| - |
|
998 |
|
| 997 |
else:
|
999 |
else:
|
| 998 |
line.actual_price = bulkPrice.price
|
1000 |
line.actual_price = bulkPrice.price
|
| 999 |
if deals[item_id].dealTextOption==0:
|
1001 |
if deals[item_id].dealTextOption==0:
|
| 1000 |
line.dealText = ''
|
1002 |
line.dealText = ''
|
| 1001 |
if deals[item_id].dealTextOption==2:
|
1003 |
if deals[item_id].dealTextOption==2:
|