Created
September 10, 2012 18:20
-
-
Save joshcartme/3692706 to your computer and use it in GitHub Desktop.
Cartridge OrderForm to work with cartridge-tax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.localflavor.us.forms import USStateSelect | |
from cartridge.shop import checkout | |
from cartridge.shop.forms import OrderForm | |
from mezzanine.conf import settings | |
class OrderForm(OrderForm): | |
def __init__(self, request, step, *args,**kwrds): | |
first = step == checkout.CHECKOUT_STEP_FIRST | |
super(OrderForm, self).__init__(request, step, *args, **kwrds) | |
if settings.SHOP_CHECKOUT_STEPS_SPLIT: | |
if first: | |
self.fields['billing_detail_state'].widget = USStateSelect() | |
self.fields['shipping_detail_state'].widget = USStateSelect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment