[ic] Datamining with Interchange

cfm@maine.com cfm@maine.com
Tue, 6 Feb 2001 13:26:29 -0500


> > The problem is that we have a proprietary system that all business runs on.
> > Our current software interfaces through a gateway to get realtime customer
> > pricing (via contracts) and a real system order number.  The nice thing is
> > that it's all done for us, and we can just pull the order up in the system
> > as if customer service put it in themselves.
> > 
> > I'm curious whether Interchange might be adaptable to this type of
> > environment.  It would mean somehow linking it to a gateway that it could
> > query for pricing. 
> 

Think this through carefully and completely.  Among the things that
can bite you: if you have a lot of items and big pages your gateway 
system is going to get hammered.  Think of what can be cached, how 
and where, what sort of optimizations you might make.  You might only
stub in for it at first, but success might just kill you if you don't 
plan for it.


> This should be quite possible. An example for a customized pricing
> (you can use a global usertag which has the full power of Perl):
> 
> # Pricing 
> UserTag calc_price Order code quantity
> UserTag calc_price Routine <<EOF
> sub {
>     my ($code, $quantity);
> 
> 	if ($Vend::Interpolate::item) {
> 		$code = $Vend::Interpolate::item->{code};
> 		$quantity = $Vend::Interpolate::item->{quantity};
> 	} else {
> 		($code, $quantity) = @_;
>     }
> 
> 	# sanity check
> 	if ($code !~ /^\d+$/ || $quantity !~ /^\d+$/) {
> 		Log ("Wrong input for calc_price: CODE $code QUANTITY $quantity");
>         return;
>     }
> 
>     my $db = Vend::Data::database_exists_ref('price');
> 	my $keys = $db->query ("select price,min from price where component_idf = $code order by min");
> 	my $price;
> 
> 	if (@$keys) {
> 		# fallback price
> 		$price = $keys->[0]->[0];
> 		# check for appropriate price
> 		for (my $i = 0; $i < @$keys; $i++) {
> 			if ($quantity > $keys->[$i]->[1]) {
> 				$price = $keys->[$i]->[0];
> 			}
> 		}
> 	}
> 	$price;
> }
> EOF
> 
> CommonAdjust [calc_price]
> 
> > Also, when the order is placed, Interchange would need
> > to let the order go through to our system (attaching the account number as
> > the method of payment) instead of processing the order itself.
> 
> I produced a patch for IC so you can call any function "Sub" from
> within a order route, so this is feasible too.
> 
> Ciao
>         Racke
> 
> -- 
> LinuXia Systems && Cobolt NetServices, eCommerce and more
> Shop- und Datenbanklösungen mit MiniVend, Firewalls auf Debian-Basis
> http://www.linuxia.de - http://www.cobolt.net
> --> Junior Officer of the MiniVend/Interchange Bug Patrol <--- 
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Content management, electronic commerce, internet integration, Debian linux