[ic] How to display adjusted options prices?

Mike Heins interchange-users@icdevgroup.org
Tue Jul 9 14:06:00 2002


Quoting Interchange (inter@myoccasion.com):
> Thank you for that suggestion... :)
> 
> However, all the products across the board for the size L are priced 
> at an additional cost of $5.  It would be really tedious to edit 
> every size of every product.
> 
> I also realized that if I select size L, at the checkout page, it 
> doesn't reflect the additional $5, instead, it's just $100, which is 
> incorrect  :(  What went wrong?
> 
> I also noticed that if I don't use the options table, instead, using 
> the pricing table, create a new column for size L, and put in $5 for 
> every product, it worked too.  However, I just couldn't get the 
> select widget to display the words "Small", "Medium" and "Large".
> 
> I've changed my products table to be:
> 
> code    size    				price
> aaa     S=Small, M=Medium, L=Large	100
> 
> 
> My html codes for using the pricing table are:
> 
> <SELECT NAME="[modifier-name size]">
> [loop option="[modifier-name size]" list="S, M, L"]
> <OPTION> [loop-code] -- [price code="[item-code]" size="[loop-code]"]
> [/loop]
> </SELECT>
> 
> 
> But I don't want to hardcode the size list like that, since some 
> products do not contain all these sizes.  How can I change my code to 
> get the size options from the products table?
> 

Pretty easily using the acclist=1 modifier:

 <SELECT NAME="[modifier-name size]">
 [loop
	option="[modifier-name size]"
	acclist=1
	list=|
		[field column=size code='[item-code]']
	    |]
 <OPTION VALUE="[loop-code]"> [loop-param label] -- [price code="[item-code]" size="[loop-code]"]
 [/loop]
 </SELECT>

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown