Get current order information in custom Shipper module

12 views
Skip to first unread message

Mathias Monnerville

unread,
Nov 4, 2010, 2:02:51 PM11/4/10
to Satchmo developers
Hi,

I'm writting a custom Shipper module and would like to access the
current order to get the country name (need this information to
perform some computation in the cost() method).

I know I can access the current cart object from the Shipper (which
has a self.cart member), but I can't find a way to access the current
order.

Kind Regards,
Mathias

Mathias Monnerville

unread,
Nov 9, 2010, 4:33:18 AM11/9/10
to Satchmo developers
Okay, I finally found a way to get the shipping country name:

ship_country = self.contact.shipping_address.country.name

I didn't notice that BaseShipper.calculate(cart, contact) was called
by _get_shipping_choices() in payment/forms.py.
Reply all
Reply to author
Forward
0 new messages