if there is an open order-- add product to that order
In the create -- instead of just instantly creating a new order:
FIRST go try to find order where payment type is None (Null) and assign to current order
if current order is not none then do a create on orderproduct
if there is not an order-- create one.
Use try and except for item not there and then do this.
neworder= order.objects.create
then orderproduct.create and order would be neworder from above.
** Same thing as we are doing in register creating a customer from user
In order create function
In the create -- instead of just instantly creating a new order:
orderproduct
Use try and except for item not there and then do this.
neworder= order.objects.create
thenorderproduct.create
and order would beneworder
from above.** Same thing as we are doing in register creating a customer from user