Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Storing shopping cart orders via Apache::Session

by pashanoid (Scribe)
on Aug 23, 2012 at 05:24 UTC ( [id://989202]=perlquestion: print w/replies, xml ) Need Help??

pashanoid has asked for the wisdom of the Perl Monks concerning the following question:

Dear Brethern, what's the propper way of storing shopping cart items in Apache::Session? should I encode the orders in one hash like:

$session{'cart'}='item_1=quantity:item_2=quantity:...';

encode/decode it every time the user adds/deletes items from his cart and pass it around or is there a better/propper wat to do this? Thank you!

Replies are listed 'Best First'.
Re: Storing shopping cart orders via Apache::Session
by Anonymous Monk on Aug 23, 2012 at 06:28 UTC
    store an array instead -- just like the documentation shows
    $session{an_array_ref} = [ $one, $two, $three ];
      any chance you can provide an exaple?
        I just did. You can find additional examples in MANIFEST (hint, its t/99file.t)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://989202]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found