Heres the problem.
Best viewed visually at http://217.43.93.212/store/
Select Footwear, Stilettos, Choose a shoe, put this in my basket.
Change the size and the new size change is reflected in the drop down list. Perfect!
Now add another stiletto to the basket change size (Dispear! - Angst and stress)
You will see ive added a few debugging lines to the table to show the values.
I can't understand why this works first time but then not for any other item added....
Now for the code ....
<cfoutput query = "GetCartItems">
<cfset tblitemsItemID = GetCartItems.ItemIdPK>
<!--- Get sizess relevant for this item --->
<CFQUERY NAME="Getsizes" datasource="#application.dsn#">
SELECT tblItemSizes.FKItemID,
tblSizes.Size,
tblItemSizes.FKSizeID,
tblSizes.SizeID
FROM tblSizes
INNER JOIN tblItemSizes
ON tblSizes.SizeID = tblItemSizes.FKSizeID
WHERE (tblItemSizes.FKItemID = #tblitemsItemId#)
</cfquery>
<tr><td BGCOLOR="##cc0000" colspan="7">
Possible Sizes for this item are :
<cfloop query="GetSizes">#GetSizes.Size#,</cfloop>
</td></tr>
<!--- Get colours relevant for this item --->
<CFQUERY NAME="GetColours" datasource="#application.dsn#">
SELECT tblItemColours.FKItemID,
tblColours.Colour,
tblItemColours.FKColourID,
tblColours.ColourID
FROM tblColours
INNER JOIN tblItemColours
ON tblColours.ColourID = tblItemColours.FKColourID
WHERE (tblItemColours.FKItemID = #tblitemsItemId#)
Order By ColourID ASC
</cfquery>
<tr><td BGCOLOR="##cc0000" colspan="7">Get Cart Items Size(Outer loop) = #GetCartItems.ItemSize#</td></tr>
<TR>
<TD BGCOLOR="##cc0000">#PartNum#</TD>
<TD BGCOLOR="##cc0000">#ItemName#</TD>
<td BGCOLOR="##cc0000">
<cfif GetSizes.size eq "">
N/A
<cfelse>
<select name="selectSize#Replace(ItemIDPK,"-","_","ALL")#">
<cfloop query="Getsizes"><!--- Sizes relevant for this item only --->
<cfif Getsizes.Size eq GetCartItems.ItemSize>
<option value="#GetCartItems.ItemSize#" selected>#GetCartItems.ItemSize#</option>
<!--- Increment the cart query here? --->
<cfelse>
<option value="#GetSizes.Size#">#GetSizes.Size#</option>
</cfif>
</cfloop>
</select>
</cfif>
</td>
<td BGCOLOR="##cc0000">
<select name="selectColour#Replace(ItemIDPK,"-","_","ALL")#">
<cfloop query="GetColours"><!--- Colours relevant for this item only --->
<cfif GetColours.ColourID eq GetCartItems.ItemColour>
<option value="#GetColours.ColourID#" selected>#GetColours.Colour#</option>
<cfelse>
<option value="#GetColours.ColourID#">#GetColours.Colour#</option>
</cfif>
</cfloop>
</select>
</td>
<td ALIGN="RIGHT" bgcolor="##cc0000">#lscurrencyFormat(ItemCost)#</TD>
<td bgcolor="##cc0000">
<input type="Text" name="Quantity#Replace(ItemIDPK,"-","_","ALL")#" value="#Quantity#" align="RIGHT" size="3">
</TD>
<TD BGCOLOR="##cc0000" ALIGN="RIGHT">
#lscurrencyFormat(ItemCost * Quantity)#
</TD>
</TR>
<!--- Add cost of current item(s) to total cost --->
<CFSET TotalCost = TotalCost + (GetCartItems.ItemCost * GetCartItems.Quantity)>
</cfoutput>
Regards- Paul
-- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*To unsubscribe, e-mail: [EMAIL PROTECTED]
