[ic] Can't get CommonAdjust to adjust price.

Kevin Walsh interchange-users@icdevgroup.org
Thu Dec 5 14:44:01 2002


John Murtari [mrlist@thebook.com] wrote:
> 
> Have a catalog for a client who wants to support both US and
> Canadian pricing -- except, there is not a straight conversion
> factor.  Canadian prices are adjusted by him based on other factors
> unique to the items.  Interchange 4.8.6
> 
> Wanted to keep things simple for him so his products database has
> the price column (in US dollars), it also has a "caPrice" column
> with the canadian price.  He wants to offer people two entry
> points to the store, one would set for US pricing, the other canadian.
> 
> Checked out some messages in the group, and I have a UserTag which
> seems to do the trick, and it will display the correct price by
> itself -- but doesn't effect the actual price ic displays for the
> item?  What am I missing?
> 
> ---  On my flypage I have the following (and the correct price is
> displayed)
> 
> Pricing: [scratch whichCatalog] Dollars ([item-field caPrice])
> ([adjprice code="[item-code]" quantity="1" title="[item-field title]" ])
> 
> 
> --- In my catalog.cfg (please ignore the title stuff)
> 
> CommonAdjust  [adjprice]
> 
> UserTag adjprice Interpolate
> UserTag adjprice Order code quantity title
> UserTag adjprice Routine <<EOR
> sub {
>    my ($sku, $quantity, $title) = @_;
> 
>    $sku         ||= $item->{code};
>    $quantity    ||= $item->{quantity};
>    $title       ||= $item->{title};
> 
>    my $price = $Tag->data( {
>          table => 'products',
>          field => 'caPrice',
>          key => $sku,
>      });
> 
> #   return $quantity*($price + $quantity * 5 * length($sku));
>     return $quantity*$price;
> }
> EOR
> 
Section 1.5 (Dynamic Locale Directive Changes) of the Interchange
Internationalisation Features document contains the following text:

    To use a different field in the products database for pricing based
    on locale, set the PriceField locale setting. For example:

        # Establish the default at startup
        PriceField    price
        Locale fr_FR  PriceField  prix

    The default will always be price, but if the locale fr_FR is set,
    the PriceField directive will change to prix to give prices in
    francs instead of dollars.  If PriceBreaks is enabled, the prix
    field from the pricing database will be used to develop the quantity
    pricing.

Does that not answer your question?

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