def getCost( self, order ):
settings = self.settings
if(settings.flatrate_option == "Percentage"):
return self.settings.flat_rate
else: # we're calculating the percentage
items = filter( IShippableLineItem.providedBy,
order.shopping_cart.values() )
cost = 0
for item in items:
cost += item.cost
shipcost = cost * (settings.flatrate_percentage / 100)
if shipcost > settings.flatrate_max:
shipcost = settings.flatrate_max
return shipcost)
1)
I've doubt about the condition
if(settings.flatrate_option == "Percentage")
I've filled one issue report about it. On my file, I've changed it for
if(settings.flatrate_option == "Flat Rate")
2) Now it seems that in case I choose
flatrate_options="Percentage" that the cost is computed for only one item
of each type, I mean if I buy 10 times the same item, I'm charged only once
no matter the quantity if I may say
but if I write
cost += item.cost * item.quantity
I've got the expected result
Original issue reported on code.google.com by danielle...@gmail.com on 24 Apr 2009 at 9:26
Original issue reported on code.google.com by
danielle...@gmail.com
on 24 Apr 2009 at 9:26