[ic] Admin Order Entry

Andrew Baerg interchange-users@interchange.redhat.com
Fri May 3 15:59:00 2002


On Fri, 2002-05-03 at 12:52, Mike Heins wrote:
> Quoting Andrew Baerg (andrew@baerg.ca):
> > On Fri, 2002-05-03 at 11:47, Mike Heins wrote:
> > > Quoting Andrew Baerg (andrew@baerg.ca):
> > > > In case anyone cares about this issue, I have investigated it further
> > > > and submitted the following to bug #361:
> > > > 
> > > > It seems to me that the problem lies in Routing. I have found that
> > > > only the default route is ever performed so that if you remove it, as
> > > > one of the suggestions states, the last route defined in catalog.cfg
> > > > becomes the default and is the only one which is performed(whether
> > > > through the admin UI or not).
> > > 
> > > No. All routes defined in mv_order_route or through the cascade
> > > mechanism are performed.
> > > 
> > > > My temporary solution, which I realize
> > > > is a horrible hack but which works without issues, is to define a log
> > > > Route which includes both log_entry stuff and log_transaction stuff
> > > > and decides which to do based on a variable I pass
> > > > it. receipt.html also uses the variable to decide whether to diplay
> > > > the admin UI or the customer UI. Anyways, that's my two cents for
> > > > what it's worth.
> > > > 
> > > 
> > > I think all you need to do is set in a page:
> > > 
> > > 	[value name=mv_order_route set="route1 route2 route3"]
> > > 
> > > You should find all routes executed just fine...
> > 
> > This is what is in the admin/entry.html page, although it is in the form
> > <input type=hidden name=mv_order_route value="route1 route2 route3">,
> 
> Bingo.
> 
> Since the standard catalog.cfg has this:
> 
> 	FormIgnore  mv_order_route
> 
> that has zero effect.

OK, so using the [value] tag does in fact work, however, there are still
some issues which I had to address which I will outline here for those
who need to use the admin UI for order entry.

1. If you simply set mv_order_route to "route1, route2..." the routes
get executed, but unless one of the routes is defined as master, the
cart will not be emptied and you will be returned to entry.html with all
the previous values filled in(this makes it /look/ like the order was
not entered). One way to overcome this is to define a new route in
catalog.cfg as follows and then set mv_order_route to "admin" in
entry.html: 
Route   admin   master          1
Route   admin   cascade         "log_entry main copy_user"
Route   admin   empty           1
Route   admin   supplant        1
Route   admin   email           '__ORDERS_TO__'

2. Once this route is defined, to be safe I would set mv_order_route to
default in checkout page.

3. The last issue was that receipt.html is displayed within the customer
UI. To overcome this I pass a variable from entry.html page to
receipt.html so that if the order is entered from the admin UI, the page
uses the admin header and footer instead of the customer UI templates.
This successfully keeps the user in the admin interface.

If anyone has any other problems with getting order entry to work in the
admin UI let me know as I now have it working.



Andrew Baerg
Edge Marketing