Shipping zones are a pain to figure out. I’m surprised there isn’t a shipping-zones.com kind of website plastered with ads like the “what time is it” sites.
I should make one in my free time, along with some calculators that integrate with UPS/FedEx/USPS
Why? I need to build a shipping table / zone table for Anuva anyways.
Zone
Number
State
FK Zone
ShippingTable
FK Zone
1 – $x
2 – $y
3 – $z
state = State.objects.get(code=OR)
state.zone.shippingtable_set.get(zone=state.zone).filter(qty<=4).reverse()[0]?
That sounds like a terrible way to go.
Filter the price list by qty so you only see the right prices, reverse them to make [0] the last item, and take that item?
(1 or more, 2 or more, 3 or more, 4 or more)
Filter by at <= 2
(1 or more, 2 or more)
reverse
(2 or more, 1 or more)
[0]
2 or more = price / bottle
Works.. but seems dirty.