greying-out options in select box

oldmanpants - October 22, 2008 - 23:18
Project:Ubercart Out of stock Notification
Version:5.x-1.0-beta6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm not sure if this functionality can be achieved with this module?

It would be great if options that are out of stock would be greyed-out in the select box, and be un-selectable.

That way you could see which options are out of stock before actually selecting them.

Thanks!

#1

hanoii - October 23, 2008 - 12:49

I am not sure if greying out options is possible in HTML at all, might be something to look at some time. The only thing I can think of are very seldom possibilities where the stock can change in the backend and it won't show on the user's side until he refreshes the page. If you want/can investigate about this, that would be great.

#2

adrian_ - October 30, 2008 - 15:01

There is an empty attribute disabled for options:

<option disabled="disabled">title</option>

http://www.w3.org/TR/html401/interact/forms.html#adef-disabled

Instead just disabling, the label should be changed to "title (Out of stock)".

#3

hanoii - October 30, 2008 - 15:06
Status:active» postponed

Thanks for pointing that out. Now I give a second thought to this, it seems that this is not a task for such a module like this. I am sure there should be a way that the attributes form can be themed or altered to display the disabled options in the attributes form element, rather than doing that with this module, as this is mainly an usability module, not that much of changing the display of things.

#4

hanoii - May 6, 2009 - 20:07
Status:postponed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.