[ic] mv_order_route

Mike Heins interchange-users@icdevgroup.org
Wed Oct 23 11:53:00 2002


Quoting paul jordan (paul@gishnetwork.com):
> >
> > Could anyone tell me how to enable the option in Items to display
> > mv_order_route field? I can not find it in Edit items...
> >
> > So for example if I set this in catalog:
> >    Route  firm1  email           orders@firm1.com
> >    Route  firm1  reply           service@firm1.com
> >    Route  firm1  encrypt         0
> >    Route  firm1  report          etc/report_mail
> >
> > and
> >
> >    Route  firm2  email           orders@firm2.com
> >    Route  firm2  reply           service@firm2.com
> >    Route  firm2  encrypt         0
> >    Route  firm2  report          etc/report_mail
> >
> >
> > and in Items I add the mv_order_route to one product FIRM1 and
> > another FIRM2
> > .. the order will then go to 2 emails each including products with right
> > route (so items with FIRM1 will go to FIRM1 email and items with
> > FIRM2 would
> > go to FIRM2 email)
> >
> > Is this correct? and if it is.. please help me get the option
> > mv_order_route
> > in Items list..
> >
> > Thanks!
> > Saso
> 
> 
> Saso, this is wrong. Number one, mv_order_route is not in the products
> table, not should it be. I believe you should not name columns in tables the
> same as session variables.
> 
> Anyways, the idea is to create another column in products (or recycle one)
> called maybe 'firm' then in it you would put a '1' or '2' or '3'..... to
> represent the different firms.
> 
> Then use that as your "flag value".
> 
> Note: I was messing with order routes a while abck and this is what Mike
> Heins said:
> ---------------------------------------
>     FormIgnore  mv_order_route
> 
> nothing that comes in from the form is good. (We did that because having
> the user be able to arbitrarily set order routes can be a security problem.)
> ----------------------------------------

In any case, what you need to set is mv_order_route in the cart. This can
be done with AutoModifier if you make a field "mv_order_route" in
the products table:

	AutoModifier  mv_order_route

If you don't want to name it mv_order_route in the database, and name it
"vendor" instead, then set it in a piece of code in the checkout profile
or top of the checkout page:

[perl tables=products
    foreach my $item (@$Items) {
	next if $item->{mv_order_route};
	$item->{mv_order_route} = tag_data('products', 'vendor', $item->{code});
    }
    return;
[/perl]

Set it to firm1, firm2, or whatever. Then have the routes defined
as above. A separate order report for each vendors items will be sent
to them.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Experience is what allows you to recognize a mistake the second
time you make it. -- unknown