Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   How to add extra field(In stock/Out of stock) to a DropDownList ? (http://www.velocityreviews.com/forums/t301064-how-to-add-extra-field-in-stock-out-of-stock-to-a-dropdownlist.html)

savvy 06-28-2006 10:48 AM

How to add extra field(In stock/Out of stock) to a DropDownList ?
 
I am developing a Garments shopping cart. On the single product page
where the customer selects size and colour of a garment and if its ok
for him, then adds to his basket, so every time he checks for Colour
(dropdownlist) and Size (dropdownlist) I'm checking whether the Item is
"In Stock" or "Out of Stock" and displaying the same using a Label
outside.

Is their any way so that I can display "In Stock" or "Out of Stock"
inside the dropdownlist menu of the Size when the customer chooses a
Colour. The pattern wanted is displayed below.

Colour DropdownList
Black
Blue
Green

Size DropdownList
3 yrs (In Stock)
6 yrs (Out of Stock)
12 yrs (In Stock)

I have no idea how to add an extra field inside the DropdownList.
Any ideas would be of great help to me and will be greatly appreciated
Thanks in Advance for your time

Database Queries:
SELECT * FROM ProductClrIcons WHERE ProductID=@prod_id -- (For
ColourIcons)
SELECT * FROM ProductSizes WHERE ProductID=@prod_id--- (For Sizes)
SELECT * FROM ProductSizesColours WHERE ColourName=@colname AND
Sizes=@sizes AND ProductID=@prod_id--- ( For StockLevels)


Cowboy \(Gregory A. Beamer\) 06-28-2006 12:28 PM

Re: How to add extra field(In stock/Out of stock) to a DropDownList ?
 
PUll the data the way you like it up front

SELECT ps.ProductSizeID
, [Description] -- raw description
, InStock -- raw Boolean for in stock?
, CASE InStock WHEN 0 THEN Description + ' (Out of Stock)'
ELSE Description + ' (In Stock)' END As DropDownItem
FORM ProductSizes
WHERE ProductID = @ProductID

You then bind the display field to the concatenated field.

You will still have to do a server side check when the order is processed,
but this alerts the customer up front without the check each change.

If you are bleeding edge, you can also have the check done via Ajax. Okay,
let's drop that idea for now. :-)

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"savvy" <johngera@gmail.com> wrote in message
news:1151491706.624827.315260@75g2000cwc.googlegro ups.com...
>I am developing a Garments shopping cart. On the single product page
> where the customer selects size and colour of a garment and if its ok
> for him, then adds to his basket, so every time he checks for Colour
> (dropdownlist) and Size (dropdownlist) I'm checking whether the Item is
> "In Stock" or "Out of Stock" and displaying the same using a Label
> outside.
>
> Is their any way so that I can display "In Stock" or "Out of Stock"
> inside the dropdownlist menu of the Size when the customer chooses a
> Colour. The pattern wanted is displayed below.
>
> Colour DropdownList
> Black
> Blue
> Green
>
> Size DropdownList
> 3 yrs (In Stock)
> 6 yrs (Out of Stock)
> 12 yrs (In Stock)
>
> I have no idea how to add an extra field inside the DropdownList.
> Any ideas would be of great help to me and will be greatly appreciated
> Thanks in Advance for your time
>
> Database Queries:
> SELECT * FROM ProductClrIcons WHERE ProductID=@prod_id -- (For
> ColourIcons)
> SELECT * FROM ProductSizes WHERE ProductID=@prod_id--- (For Sizes)
> SELECT * FROM ProductSizesColours WHERE ColourName=@colname AND
> Sizes=@sizes AND ProductID=@prod_id--- ( For StockLevels)
>





All times are GMT. The time now is 03:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.