#!/usr/local/bin/perl # update.pl - web cgi routine to update items in the shopping cart # # Dave Stoddard - 5/29/04 # dgs@accelix.com # # Copyright # --------- # Copyright(c) 2004, Accelix LLC. All Rights Reserved. # # Description # ----------- # This program modifies quantities for items in an existing shopping cart. # # RCS Information # --------------- # $Id$ # $Log$ # # package main; use strict 'vars'; use strict 'subs'; # use warnings; # use diagnostics; # load application modules use cart; # shopping cart support routines # --------------------------- # DECLARATIONS AND PROTOTYPES # --------------------------- # local elements my %form = (); # data from form (name/value pairs) my %state = (); # state persistence data hash ### ### START PROGRAM ### # initialize the program %form = ReadForm (); # read the form %state = GetState (%form); # get current state data (cookies) # map paypal field names to shopping cart field names $form{price} = $form{amount} if (defined $form{amount}); $form{quantity} = $form{add} if (defined $form{add}); $form{itemno} = $form{item_number} if (defined $form{item_number}); $form{title} = $form{item_name} if (defined $form{item_name}); $form{optname1} = $form{on0} if (defined $form{on0}); $form{optval1} = $form{os0} if (defined $form{os0}); $form{optname2} = $form{on1} if (defined $form{on1}); $form{optval2} = $form{os1} if (defined $form{os1}); $form{optname3} = $form{on2} if (defined $form{on2}); $form{optval3} = $form{os2} if (defined $form{os2}); # update cart quantities UpdateCartItem (%form,%state); ExitProgram (); ### End Main Program ###