Custom order of items in a portal (long ...)

Hi all,

This is going to be a bit long and convoluted, so bear with me.

I am creating an order system for a take-away that sells multiple types of food, including pizzas. One part of this is taking orders, and this is where the problem is.

This is a screenshot of the current order system:

This shows the items in an order, with notes underneath the items. There is a form at the top for adding items to the order.

As you can see, this order has two pizzas on it, and each pizza has a form for adding toppings to that pizza. This is done by having a column in the orderitems table that contains the orderitemid (primary key for the orderitems table) of the pizza. The toppings have to be displayed underneath the associated pizza, obviously =)

So far in Servoy, I have this:

The problems are that I cannot see how to add a form underneath a pizza to add a topping for that item, and that the toppings are not displayed underneath the associated pizza.

Adding the toppings to a pizza can be easily sorted by having a dialog pop up and prompt for the topping, so that is less of a problem. The order of the toppings, however, is essential.

ROCLASI has suggested creating an HTML field, and writing the order items into that, and for each pizza item, run a query to retrieve associated toppings … which would work, but it would remove a major benefit, namely being able to edit the quantity/price after a topping has been added.

Does anybody have any suggestions how to accomplish displaying the toppings underneath the correct pizza, from inside a portal?

Hi,

You can do that by setting a field to sort by. Have it set to 0 for the “main pizza item” and 1 for topping, then sort by that. I’ll call the field “isTopping” for illustration:

So:

301 9T Margherita - isTopping = 0, MasterPizzaID = 101
820 Crab - isTopping = 1, MasterPizzaID = 101
821 Cockles - isTopping = 1, MasterPizzaID = 101

Then, sory by MasterPizzaID and isTopping. Done.

Hope this helps,

Bob Cusick