[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Re: adding extra information into the shopping cart structure
On Thu, Oct 10, 2002 at 02:34:57PM +0200, racke@linuxia.de wrote:
> John Allman writes:
>
> >Mike Heins wrote:
> >
> >>As with most IC things, it is just a perl data structure.
> >> $Session = {
> >> carts => {
> >> main => [],
> >> newcart => [
> >> { code => 'foo', quantity => 1, mv_ib =>
> >>'products' },
> >> ],
> >> },
> >> etc => 'etc.',
> >> };
> >>
> >>
> >>
> >Hi - just a quick query here. I posted this a few hours ago under a
> >different thread, but since it is in fact a different issue i though i
> >should start a seperate thread. sorry if this annoys anyone!
> >
> >Am i right in thinking that if i want to add a new key and value to the
> >shopping cart data scructure it is pretty straightforward? I am
> >considering going with a one shopping basket solution and just having
> >something on the basket page to indicate that an item ordered was ordered
> >via the "quick catalog order" option. I'm thinking that it should be
> >possible for me to put something like quickorder => 1 in the perl
> >structure and then access it on the basket page with [item-quickorder]. Am
> >i right in thinking this and if so could you tell me the correct syntax?
> >
> >i'm thinking maybe something like
> >
> >$lastitem = pop($Session->{carts}->{main});
> >$lastitem->{'quickorder' => 1};
>
> I doubt that is valid Perl syntax. Try:
>
It looks valid to me, though it might or might not give the
desired result. :^>
> $lastitem->{quickorder} = 1;
>
> >push($Session->{carts}->{main},$lastitem);
>
> Or in the shorthand:
>
> $Items->[$#$Items]->{quickorder} = 1
>
> >
> >could something like that work and could i access it with
> >[item-quickorder] on the basket page? is there a better way to do what i'm
> >looking for?
>
How are we supposed to guess what you are looking for? :-)
If you are more comfortable with straight perl than the tags, use
perl. IC is written in perl and mostly aimed at non-programmers
that don't know perl. That doesn't stop people who know perl from
doing all sorts of nasty things to it late at night.
> Don't try to invent ITL :-;, give [item-field quickorder] a shot.
>
> You may need AutoModifier quickorder in the configuration.
>
> Bye
> Racke
>
>
> --
> Prolific Interchange Consulting (Excellent German Quality !).
> Take a look at Materialboerse (http://www.materialboerse.de/), WITT
> (http://www.witt-weiden.de/), Boxmover (http://shop.boxmover.ch/) or
> Passionshop (http://www.passionshop.com/racke). Need a shop ? Contact us.
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
--
Christopher F. Miller, Publisher cfm@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
1.207.657.5078 http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux