[ic] Getting started...
Chris Wenham
interchange-users@icdevgroup.org
Tue Jun 10 08:42:00 2003
On Monday 09 June 2003 18:08, Patrick Galbraith wrote:
> I've been perusing the code and am trying to figure out how I'll use
> this. I started wondering where I might find where the actual shopping
> cart for each user is stored? I looked at the db table 'orderline' and
> thought that was is, but that's for products that have already been
> ordered.
Shopping carts are stored as Perl hashes in session files that you'll find in
each catalog's /session directory. To access these hashes directly from
within a template, the best way is to use some embedded perl in your HTML and
the objects that Interchange exposes, like this:
<h2>Blah blah blah...</h2>
[perl]
my $current_cart = $Carts->{main};
my $quantity = $current_cart->[0]->{quantity};
$Scratch->{foo} = $quantity;
return;
[/perl]
<p>Quantity of first item in cart: [scratch foo]</p>
There's more interfaces documented here:
http://www.icdevgroup.org/i/dev/docfly.html?mv_arg=ictemplates07%2e00
> Also, I was wondering where a developer would look to modify the
> ordering process to use a billing company such as authorise.net - I have
> a nice library I've built that sends billing info to their server and
> returns whether that transaction was successful. Where would I plug that
> in - where is the actual code that does the order? Is it all in the lib
> dir?
Interchange already comes with an Authorize.Net module that you'll find in
the ~interch/lib/Vend/Payment directory. There's modules for other payment
processors there, too.
Regards,
Chris Wenham