Dynamic order forms

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Migi
Forum Newbie
Posts: 1
Joined: Fri Jul 17, 2009 9:35 am

Dynamic order forms

Post by Migi »

I'm working on a website that will sell truck bodies. The problem with this is that they are very complex, with many parameters that a customer could choose and tight connections between these parameters. I will give a few examples to show how complex it can be:
  • A user has 3 elements to choose for an element: A, B and C. If he chooses A, more options should be shown (D, E and F). If he chooses E or F, even more options should be shown. Option C can not be chosen if the user filled in X or Y in field Z somewhere else.
  • A user can choose where he wants to place the door on the side of a truck body. This limits of how close to the edges the door can be is influenced by a lot of other parameters. Additionally, the door can only be placed on positions in steps of X, Y or Z millimeters, depending on the product, usually creating about 200 discrete possibilities.
  • A user can decide to either give give the internal, the external or another (don't know the English word) length of the truck body. That's 3 drop-down menu's, but when he selects one, the others should be automatically updated. Furthermore, these lengths are also influenced by other parameters (e.g. internal length -= 4 mm when the user chooses option X).
These requirements on their own are quite complex, but possible. I know how to code, some clever PHP+MySQL+AJAX should do the job. I only really went 8O when I read the last requirement: these order-forms and their functionality should not be hard-coded. An product manager, who possibly doesn't even know how to hello-world, should be able to set up a new order form for a new product without writing a single letter of code, preferably using graphical methods that are as intuitive as possible.

Apart from that, designs and templates shouldn't be hard-coded either. Designing a new template should be no more than editing a few html files, and the whole site should be available in multiple languages. Obviously. :)

Sigh.

A few days of brainstorming later, I have still no idea on how to begin. The templates I can handle with a parser that understands things like "{{LOOP: products}}{{VAR: product.name}}<br>{{ENDLOOP}}" and "{{IF: something}}" etc. Languages can also be solved that way (a {{TXT: abc}} command. But still, the main problem remains: how would I do this? I'm not asking for specific details, just the general outline of how you would do it, maybe a few database table names, and what you would let such a "form creation" page look like (internally and externally). Also, I don't think that I'm the only one with this kind of problem, so maybe there are already a few libraries out there that could help?

Any help would be appreciated! :D

Thanks in advance,
Migi
joeynovak
Forum Commoner
Posts: 26
Joined: Sun May 10, 2009 11:09 am

Re: Dynamic order forms

Post by joeynovak »

I think I would ask for more money first... Either that or ask them what they are smoking. It can definitely be done, but it would not be easy... You would need some kind of rules engine, and apply the rules for whether to show each option, and the list of option values.

Doing it visually... You would essentially write a visual interface for your rules engine.

So, they would add an option, called "SIDE DOOR COLOR", and the option values. And for each option, and option values, you can add rules for when NOT to show it, or hide always and only show when...

That's the first way that comes to mind.

Good luck!
Post Reply