[interchange-docs] xmldocs - racke modified glossary/price
Kevin Walsh
kevin at cursor.biz
Mon Dec 10 13:35:11 EST 2007
> +UserTag calc_price Routine <<EOR
> +sub {
> + my ($code, $quantity, $set);
> +
> + $code = $Vend::Interpolate::item->{code};
> + $quantity = $Vend::Interpolate::item->{quantity};
> +
> + $Tag->perl({tables => 'vendors_pricing'});
> +
> + $set = $Db{vendors_pricing}->query(q{select price from vendors_pricing where sku = '%s' order by price asc limit 1}, $code);
> +
> + if (@$set) {
> + return $set->[0]->[0];
> + } else {
> + return 0;
> + }
> +}
> +EOR
>
Is there any particular reason why you're using $Vend::Interpolate::item
instead of just $item in your example code? I find it more readable to
just use $item.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
More information about the docs
mailing list