| Line 910... |
Line 910... |
| 910 |
cartItem['minBuyQuantity'] = item.minimumBuyQuantity
|
910 |
cartItem['minBuyQuantity'] = item.minimumBuyQuantity
|
| 911 |
cartItem['quantityStep'] = item.quantityStep
|
911 |
cartItem['quantityStep'] = item.quantityStep
|
| 912 |
cartItem['bulkPricing'] = tempBulkItemList
|
912 |
cartItem['bulkPricing'] = tempBulkItemList
|
| 913 |
cartItem['maxQuantity'] =0
|
913 |
cartItem['maxQuantity'] =0
|
| 914 |
|
914 |
|
| 915 |
item_shipping_info = catalog_client.isActive(item_id)
|
- |
|
| 916 |
if not fofoDealsAvailability.has_key(item_id):
|
915 |
if not fofoDealsAvailability.has_key(item_id):
|
| 917 |
continue
|
916 |
continue
|
| 918 |
else:
|
917 |
else:
|
| 919 |
availability = fofoDealsAvailability.get(item_id)
|
918 |
availability = fofoDealsAvailability.get(item_id)
|
| 920 |
if availability < line.quantity:
|
919 |
if availability < line.quantity:
|
| 921 |
line.quantity = availability
|
920 |
line.quantity = availability
|
| 922 |
itemQuantityChanged=True
|
921 |
itemQuantityChanged=True
|
| 923 |
cartItem['maxQuantity'] = min(availability,100)
|
922 |
cartItem['maxQuantity'] = min(availability,100)
|
| 924 |
if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
|
923 |
if item.maximumBuyQuantity is not None and item.maximumBuyQuantity >0:
|
| 925 |
cartItem['maxQuantity'] = min(item_shipping_info.quantity, item.maximumBuyQuantity)
|
924 |
cartItem['maxQuantity'] = min(availability, item.maximumBuyQuantity)
|
| 926 |
if availability < cartItem['minBuyQuantity']:
|
925 |
if availability < cartItem['minBuyQuantity']:
|
| 927 |
cartItem['minBuyQuantity'] = availability
|
926 |
cartItem['minBuyQuantity'] = availability
|
| 928 |
|
927 |
|
| 929 |
if line.quantity < cartItem['minBuyQuantity']:
|
928 |
if line.quantity < cartItem['minBuyQuantity']:
|
| 930 |
itemQuantityChanged=True
|
929 |
itemQuantityChanged=True
|
| Line 938... |
Line 937... |
| 938 |
line.actual_price = fofoDealsMap.get(item_id)
|
937 |
line.actual_price = fofoDealsMap.get(item_id)
|
| 939 |
|
938 |
|
| 940 |
cartItem['sellingPrice'] = line.actual_price
|
939 |
cartItem['sellingPrice'] = line.actual_price
|
| 941 |
cartItem['bulkPricing'] = []
|
940 |
cartItem['bulkPricing'] = []
|
| 942 |
|
941 |
|
| 943 |
print "item_shipping_info", item_shipping_info
|
- |
|
| 944 |
if item_shipping_info.isActive:
|
942 |
if availability:
|
| 945 |
cart.total_price = cart.total_price + (line.actual_price * line.quantity)
|
943 |
cart.total_price = cart.total_price + (line.actual_price * line.quantity)
|
| 946 |
##Lets assign hardcoded deliveryestimate for fofo
|
944 |
##Lets assign hardcoded deliveryestimate for fofo
|
| 947 |
item_delivery_estimate = 2
|
945 |
item_delivery_estimate = 2
|
| 948 |
codAllowed = False
|
946 |
codAllowed = False
|
| 949 |
cartItem['estimate'] = item_delivery_estimate
|
947 |
cartItem['estimate'] = item_delivery_estimate
|
| 950 |
if itemQuantityChanged:
|
948 |
if itemQuantityChanged:
|
| 951 |
cartMessageChanged += 1
|
949 |
cartMessageChanged += 1
|
| 952 |
cartItemMessages.append({"type":"danger", "messageText":"Only " + str(item_shipping_info.quantity) + " available"})
|
950 |
cartItemMessages.append({"type":"danger", "messageText":"Only " + str(item.maximumBuyQuantity) + " available"})
|
| 953 |
if old_estimate != item_delivery_estimate:
|
951 |
if old_estimate != item_delivery_estimate:
|
| 954 |
line.estimate = item_delivery_estimate
|
952 |
line.estimate = item_delivery_estimate
|
| 955 |
cart.updated_on = current_time
|
953 |
cart.updated_on = current_time
|
| 956 |
totalAmount += line.actual_price * cartItem['quantity']
|
954 |
totalAmount += line.actual_price * cartItem['quantity']
|
| 957 |
else:
|
955 |
else:
|