[ic] Product Kits - Solution Code; Last Bit

Loy Ellen Gross design@iinc.com
Wed, 6 Dec 2000 12:39:26 -0500 (EST)

I've got my packages working this way:

In products, I have a field called pckglist, which contains a list
of packages this particular item is included in. I have a field called
reqs which contains a list of items this particular item requires.


      <P CLASS="boxheadings"><B>Included With These Plans:</B><BR>
      [loop arg="[item-field pckglist]"]
        <A HREF="[area [loop-code]]">[loop-field title]</A> [loop-price]<BR>

      <P CLASS="boxheadings"><B>Requires:</B><BR>
      [loop arg="[item-field reqs]"]
        <A HREF="[area [loop-code]]">[loop-field title]</A> [loop-price]<BR>

  <FORM ACTION="[process-target]" METHOD=POST>                
  <INPUT TYPE=hidden NAME=mv_todo VALUE=refresh>              
  <INPUT TYPE=hidden NAME=mv_order_group VALUE="1">           
  <INPUT TYPE=hidden NAME=mv_order_item VALUE="[item-code]">  
  [loop arg="[item-field reqs]"]                           
    [if !ordered [loop-code]]
      <INPUT TYPE=hidden NAME=mv_order_item VALUE="[loop-code]">
  <INPUT TYPE=submit VALUE="Order [item-field title]">                     


      [comment] Check for Required Items [/comment]
      [if-field reqs]
	[loop arg="[item-field reqs]"]
	  [if !ordered [loop-code]]
	    &nbsp;&nbsp;Requires [loop-field title]!
	    &nbsp;Check <INPUT TYPE="CHECKBOX" NAME="mv_order_item"
		this.form.submit()" VALUE="[loop-code]"> to add.<BR>
		<INPUT TYPE="HIDDEN" NAME="mv_order_quantity" VALUE="1">
      [comment] Discount if Part of Ordered Package [/comment]
      [if-field pckg]
	  [loop arg="[item-field pckglist]"]
	    [if ordered [loop-code]]
	      [discount [item-code]] 0 [/discount]
	      This item's price is included with
	      <I>[data products title [loop-code]]</I><BR>
	      If the amount is not zero, click [Recalculate] to see
	      an updated total.

As you can see from the "If the amount is not zero" quote, that's
my one remaining problem. When an item is first added to the cart,
it shows up at full retail. After clicking [Recalculate], it drops
to zero. The package item is already in the cart and has been from
a previous run -- 

The interesting part is that the quote "This item's price..." DOES
show up on the first run, so obviously the amount is being calculated,
just not displayed. Is there any way to force the discount to be
displayed immediately? I'm using [discount-price] * [item-quantity]
to display the subtotals.


  -- Loy

"Any language where the unassuming word "fly" signifies an annoying insect, 
	a means of travel, and a critical part of a gentleman's apparel 
		is clearly asking to be mangled." -- Bill Bryson

    Loy Ellen Gross * Web Designer & Programmer * Xcalibur Internet
          716-344-1114 * design@iinc.com * http://www.iinc.com
      Xcalibur Internet is part of the BiznessOnline.com Network