[ic] Change Discounting in Another Session

Kevin Walsh interchange-users@interchange.redhat.com
Mon Mar 4 01:33:01 2002


> 
> My scenario is:
> My eShop (based on Interchange) is selling online services provided by
> venders. When a user tries purchasing a product (service), my system
> will first redirect to the vender's website for specific business rules.
> There, the vender platform will calculate discounting according to its
> own algorithm. At last, web pages will track back to my shopping cart.
> I want the discounting values be transferred through backend (server to
> server communication) instead of redirection with GET parameters in URL,
> which may be modified by front-end users. 
> Is the description above clear enough for you to understand my case?
> Do you have any ideas on that?
> 
You could write a usertag that queries a particular website, or
other service, for the required information.  The same tag would
receive the required information and set up the discounts in one
shot.  The user would not be redirected anywhere, so there would
be no trouble with session IDs or people playing with the GET
parameters etc.

Take a look at the [ups-query] (and [fedex-query]) usertag code
to see how they do live lookups to get information from a remote
website.  Once you have the data, your usertag can set the discount
value using something like:

    $Vend::Session->{discount}->{$sku} = $formula;

...where the "formula" format is the same as would be used with the
[discount] tag.  Note that you can use 'ALL_ITEMS' or 'ENTIRE_ORDER'
in place of $sku if you need to.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/