What I am trying to do in the email is have it print those for columns as many times as there is a product. So product1 is required and product2-10 is not. Also I should add that I have defined price1-10 for the ability to let the recipient know how much ammount is (it takes the price/ea and multiplies it by the quantity.) Hence the price2 you will see below.
If a customer fills in product1 and product2 for two seperate products, but not any other products I want views.py to quit building the email after product2.
Currently here is what I have to try and handle this:
Expand|Select|Wrap|Line Numbers
- try:
- price2 = (float(orderformdata['product_qty2'])) * int(orderformdata['product_price2']);
- body+= "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (orderformdata['product_name2'],orderformdata['product_color2'],orderformdata['product_qty2'],orderformdata['product_price2'],price2)
- except:
- if price2 is null
- then
- the result is 'EXIT', termg
- pass
ValueError at /order-form/
empty string for float()
Request Method: POST
Exception Type: ValueError
Exception Value: empty string for float()
Any help someone could be with this would be wonderful! Thanks!
MM