I'm building a webshop using Cartridge/Mezzanine. By default however the checkout form (cartridge.shop.forms.OrderForm) contains fields for both first names and last names. I want a form where the customer just has to provide a name. Further, I don't want to use the fields for Country and State/Region.
So far I've created a CustomOrderForm that subclasses the OrderForm and added a 'name'-field. I also attempted to override the init method using this:
class CustomOrderForm(OrderForm):
name = forms.CharField(label=("Navn"))
def __init__(self, *args, **kwargs):
super(OrderForm, self).__init__(*args, **kwargs)
self.fields.pop('billing_detail_country')
This doesn't really do me any good except the 'name'-field is displayed in the template. But I still need to take the input from this field, split it into first name and last name and populate the relevant fields with it.
How do I do this?