[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Custom Order Routing
Hi,
MV 3.11, Linux Mandrake release 5.3
I am trying to set the "Route" directive so that for each product the
report is routed to the appropriate email address.
Routing works when I place something like the following on the final order
form.
<INPUT TYPE="hidden" NAME="mv_order_route" VALUE="main">
However, I haven't figured out how to label individual items with a
mv_order_route value that will cause the appropriate order routing. I have
used the perl script in the MV Manual but haven't made it work yet (I am at
a disadvantage because I am not a perl programmer). The script is as
follows:
[perl arg=carts interpolate=1]
my $string = <<'EOF';
[item-list][item-code] [item-field goods_type]
[/item-list]
EOF
my @items;
my %route;
@items = grep /\S/, split /\n+/, $string;
for(@items) {
my ($code, $keycode) = split /\t/, $_;
$route{$code} = $keycode;
}
my $cart = $Safe{'carts'}{'main'};
my $item;
foreach $item ( @{ $Safe{'carts'}{'main'} } ) {
$item->{mv_order_route} = $route{$item->{'code'}} || undef;
}
return '';
[/perl]
I have put the appropriate fields (goods_type) in the product database, and
it should work as far as I can tell.
Any suggestions would be very much appreciated.
Thanks,
Jeff
P.S.. I am still having problems with the apostrophes in my searches
causing all products to be listed. Please see Thurs., Sept. 16 "Apostrophe
in search string"