bleroy / Nwazet.Commerce

Idiomatic commerce module for Orchard CMS.
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Control ordering and labeling of attributes #49

Closed bleroy closed 8 years ago

bleroy commented 10 years ago

Originally reported by: Josh Berry (Bitbucket: joshberry, GitHub: joshberry)


I'm working on some changes so we can control both the order in which attribute drop-down lists are rendered on the page and the order of attribute options within the each drop-down. In our case, this is needed because there is a logical order in which the user would want to choose certain attributes and some attribute options have a logical order as well. Think t-shirts where the sizes (small, medium, large, x-large) seem awkward in alpha order (large, medium, small, x-large).

I'm also adding a secondary display text value for attributes so the label of the drop-down shown to the user can be different from the attribute's title. This is useful for us because we may have several attributes that we want to display to the user with the same label, but on the back-end we want to easily identify them as being different. Apparel is good example, we may have a bunch of different products where we want the user to select "Size", but on the back-end we want to title the attributes as "T-Shirt size", "Sweater Size", etc.

Do you think these would be useful additions to the module? Would you consider this as a pull request? I have quite a bit of the work done and so far the changes are fairly simple and isolated.


bleroy commented 10 years ago

Original comment by Josh Berry (Bitbucket: joshberry, GitHub: joshberry):


Submitted pull request #19 for this. Keyboard support is not included but I plan on giving it a try when I have time.

bleroy commented 10 years ago

Original comment by Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy):


Yes, there are usages in the code already: use jQueryUI.sortable, which is already available as a resource from the jQuery module. Look for templates requiring it.

bleroy commented 10 years ago

Original comment by Josh Berry (Bitbucket: joshberry, GitHub: joshberry):


I like that idea. I'll can give it a try.

Any suggestions on a javascript library to use for the drag-and-drop? jQuery UI? Would be nice to keep it consistent with what's being used in other Orchard modules.

bleroy commented 10 years ago

Original comment by Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy):


I have a request: the order of the attribute values should be managed using drag and drop gestures. Bonus points for keyboard equivalents for accessibility. Would you be willing to add this? Thanks!

bleroy commented 10 years ago

Original comment by Josh Berry (Bitbucket: joshberry, GitHub: joshberry):


Just submitted pull request #17 for this.

bleroy commented 10 years ago

Original comment by Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy):


I would definitely take that as a pull request. Great stuff.