[ic] Force a payment method at checkout for some items

Paco Sánchez interchange-users@icdevgroup.org
Sun Jan 19 17:33:01 2003


----- Original Message -----
From: "Mike Heins" <mike@perusion.com>
To: <interchange-users@icdevgroup.org>
Sent: Saturday, January 18, 2003 4:07 PM
Subject: Re: [ic] Force a payment method at checkout for some items


>
> It would be better to have a "cod_allowed" field in pricing or inventory.
>
> This is a typical need of tying the database to the shopping cart
> to test for shipping/pricing alternatives. IC has some facilities
> that make it fairly easy to do it.
>
> Add a column to the inventory database (or anywhere you choose) named
> "cod_allowed". Set it to 1 if COD is allowed, blank otherwise.
>
> In catalog.cfg:
>
> AutoModifier  inventory:cod_allowed
>
> (Of course you restart/apply changes, having changed configuration.)
>
> Now there will be a cod_allowed attribute in the shopping cart. At that
point,
> you can do:
>
> [calc]
> $Scratch->{allow_cod} = 1;
> foreach my $item (@$Items) {
> next if $item->{cod_allowed};
> $Scratch->{allow_cod} = 0;
> last;
> }
> return;
> [/calc]
>
> Now you can test for your allowed payment methods:
>
> [if scratch allow_cod]
> # ITL you need to enable COD
> [/if]
>

Thanks a lot both Mike and Jeff.  I have implemented the AutoModifier stuff
along with the database field and works very well.  Thanks again.

Paco Sánchez
http://pacosanchez.com
mailto:psanchez%40pacosanchez%2ecom
ICQ 101879542