[ic] Re: adding extra information into the shopping cart structure

Jim Balcom interchange-users@icdevgroup.org
Thu Oct 10 15:40:01 2002


On Thu, 10 Oct 2002, John Allman wrote:

JA>>>> Am i right in thinking that if i want to add a new key and value to
JA>>>> the shopping cart data scructure it is pretty straightforward? I am
JA>>>> considering going with a one shopping basket solution and just having
JA>>>> something on the basket page to indicate that an item ordered was
JA>>>> ordered via the "quick catalog order" option. I'm thinking that it
JA>>>> should be possible for me to put something like quickorder => 1 in
JA>>>> the perl structure and then access it on the basket page with
JA>>>> [item-quickorder]. Am i right in thinking this and if so could you
JA>>>> tell me the correct syntax?
JA>>>> i'm thinking maybe something like
JA>>>> $lastitem = pop($Session->{carts}->{main});
JA>>>> $lastitem->{'quickorder' => 1};

Perhaps I got carried away with my deleting here.

Perhaps I don't understand what you want to accomplish.

Here is some code that I put in LEFTONLY_TOP and some similar templates in
4.6.3

<tr>
  <td bgcolor="#999999" valign="top" width=131>

<FORM ACTION="[process-target]" METHOD=POST name="basket">
<INPUT TYPE=hidden  NAME="mv_todo"        VALUE="refresh">
<INPUT TYPE=hidden  NAME="mv_order_item"  VALUE="[item-code]">
<table width="131" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999"
<tr><td><center><i><b><font size=+2><font color = "white">
Grab 'N Go</font></font></b></i></center>
</td></tr>
        <tr>
        <td align="center"><font __FFACE__ size="1">
        <font color="white"><b>SKU: </b></font></font>
        <input type="text" name="mv_order_item" size="10">
        [perl] $mv_order_item =~ tr/a-z/A-Z/ [/perl]
        </td></tr>
        <tr><td align="center"> <font __FFACE__ size="1">
        <font color="white"><b>Quantity:</b></font></font>
        <input type="text" name="mv_order_quantity" size="6" value="1">
        </td>
        </tr>
        <tr><td><font size =-1><font color ="white"><center>
        <A HREF="http://www.thediapersuperstore.com/cgi-bin/diaperstore/grabngo-help.html">
        Need Help? </A></font></font></center></td></tr>
        <tr>
        <td align="center">
        <input type="submit" value="Buy it Now!">
        </td>
        </tr>
</table>
</FORM>

This appears on most pages. Repeat customers that have our SKU's can enter
the SKU (U/L case) and the quantity that they want, and it is immediately
put in their cart.


-= Jim =-

                   .-.
                   /v\
                  // \\
                 /(   )\
                 ^^ - ^^
          > Phear the Penguin <
              L  I  N  U  X

----------------------------------------------------------------
Jim's Linux-Operated Underground Bomb Shelter

Tagline for Thursday, October 10, 2002 at 15:30 PM:
The Borg assimilated my race & all I got was this T-shirt

----------------------------------------------------------------
This Linux System has been up 287 hours

My web page: http://www.idk-enterprises.com
----------------------------------------------------------------