Closed (fixed)
Project:
Ubercart Order Attributes
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2012 at 17:20 UTC
Updated:
13 May 2012 at 22:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
m.stentaMore considerations for checkboxes:
Checkbox attributes are the only attributes that can have multiple values. So aside from the display of them mentioned in item #2 above, we'll also have to figure out how to deal with them in the "Edit Attributes" form (in the popup).
This module currently just provides a textfield for editing the value of an option, so naturally it assumes that there is only one option selected, and will therefore only display the first option it finds in the textfield. When the attributes are saved, it saves the contents of the textfield to the [0] (first) item of the attributes array, and would discard any others.
So essentially, this module is broken when dealing with "Checkboxes" attributes. It will only display the first selected option in the textfield for editing, and will discard all other selection options from that attribute when you click "Apply."
I think that means this issue should be a "bug report" rather than a "feature request".
One possible solution to this, to keep things simple, would be to add a bit of logic to the form so that it loads all options into a single string, separated by commas, and put that into the textfield. Then, when the attributes are saved, the options wouldn't be lost, they would just be condensed into one option (essentially making them into a "Text field" attribute rather than "Checkboxes"). This would work for shops that don't need to maintain the separation of options, and only need the text.
I'm open to ideas on this. We're working on adding the ability to display Ubercart's default attribute form for each attribute (see #1375680: Replace arbitrary text fields with Ubercart attribute widgets), which would be a solution to this in most cases. However, I want to keep the ability to arbitrarily edit attribute/option titles, so this needs to be addressed in this context as well.
Comment #2
m.stentaAttached is a patch which does all 3 of the things described in the summary.
Comment #3
m.stentaComment #4
mattcasey commentedAh, good catch. I think once you save something with the admin textfield, it should be assumed you're not planning on using the Ubercart field anymore. So long as the attribute title is retained, the UC field with checkboxes can still display but the options would need to be selected again. I think that would be a rare case.
Thanks for breaking up my patch, I will test.
Comment #5
scotwith1tIt still feels really unnatural having the auto-complete box when you're editing these fields. If you've got pre-defined attributes, using a specific widget and potentially only a few of the possible options for that attribute enabled for that product, i would think it would make perfect sense to go ahead and present the user with the widget as it would be in the product itself...that is to say, if it's a dropdown, show me a dropdown and only with the options for that attribute that are active for this product. If you don't have it enabled, it shouldn't be an option when editing.
Here's where my client is coming from: Imagine a large event where a couple dozen volunteers are registering people at the door...they have already ordered their t-shirt for the event, but you ran out of Smalls. There ARE no X-Smalls for this event, but you've asked the check-in volunteers to edit the order to reflect the size they are to receive from the t-shirt area and in order to better track what's needed for next year's event. They edit the attribute to read x-small, the participant goes over to the -shirt area to get theirs, the order shows an x-small shirt and there aren't any available...
I know this is very specific to this example, but see where I'm going with this? If it's not an option in the purchasing process, it shouldn't be able to be changed to that and certainly not to something that's not even an established option - XXX-Large shirts? um, no we didn't order any that big for this yoga event's participants ;) If you present a text field, that's too easy of a mistake to make and invalid if you've only got certain products available...
Comment #6
m.stentaI believe what you're describing is a part of the patch in #1375680: Replace arbitrary text fields with Ubercart attribute widgets. This issue is just to fix a few bugs with "checkbox" attributes, mainly. It doesn't change anything in the interface, it just fixes some things that weren't working in the background.
The changes made in this patch are necessary for the latest changes in #1375680: Replace arbitrary text fields with Ubercart attribute widgets.
If you want to test this one, try adding some checkbox attributes to products, and make sure they work. Or, if you just want the stuff from the other issue, apply this patch, and then apply the other one, and you should be good to go.
Comment #7
scotwith1tSorry, going back and forth between this and the original issue now :) See my latest at #1375680: Replace arbitrary text fields with Ubercart attribute widgets and see if that makes sense to you? If this one would just be a more or less final patch for the 1.x version and the other is more like working towards a 2.x version, that's totally cool by me.
Comment #8
scotwith1tDefinitely seeing the other types of attributes here now, so I say this one works and can be committed.
Comment #9
m.stentaCool cool. I'm feeling pretty confident about this patch. It's not too complicated. I'm going to go ahead and commit it.
If any issues are discovered, please reopen.
Comment #9.0
m.stentaUpdated issue summary.