Dropdowns revert to default state after selection
| Project: | Ubercart Ajax Attribute Calculations |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | AntoineSolutions |
| Status: | fixed |
Hey, first off, thanks for making this module and maintaining UC_AAC!! Looks like a huge time saver!
I have three required attributes in select lists (drop downs):
Year
Make
Model
They have a bunch of enabled options & a few enabled adjustments, it all nearly works accept...
If I choose an Attribute Option, it filters the related dropdowns properly (selecting appropriate defaults in it's weighted order)...but then promptly sets itself back to the default option for itself...
If I select Year, then Make & Model are filtered to the year I selected, but let's say the defaults for Make & Model aren't what I wanted so I select another Make option, the real problem arises here because it has reset year to the default, and because it resets each attributes options on every submit suddenly Make & Model only displays what should be displayed for the currently selected Year option (which has been reset to default) and so on until I get this mismatch of Year Make Model like so:
2006
Dodge
Sierra
Or something similarly wonky
Again, thanks for getting this Module out, looking forward to seeing it working, let me know if I'm missing anything, or if I can clarify anything,
Cheers,
JP

#1
This happend with me once or twice but when i reinstalled Ajax Attribute Calculations 6.x-2.x the problem seemed to be resolved.
#2
wanna upload your uc_aac-6.x-2.x-dev.tar.gz? I'll do a diff between yours and mine and figure it out (I grabbed last nights snapshot)
#3
I think this is actually an issue in uc_aac.js I'll try to figure it out today and roll a patch
#4
jpstrikesback,
What browser are you using? Is this a duplicate of #462132: Weird uc_aac' behaviour in IE8 browser?
Cheers,
Antoine
#5
yup looks like this is the same ish, but I'm testing with Firefox 3.5.5 / Safari 4.03 on a Mac
#6
jpstrikesback,
Do you have any other Ubercart contributed modules enabled? If so, please disable all of them and report back.
Cheers,
Antoine
#7
Hey Antoine,
No others enabled (just uc_aac & uc_dependent_attributes).
#8
jpstrikesback,
You should have uc_dependent_attributes disabled so we can verify this is a uc_aac bug and not a uc_dependent_attributes bug.
Cheers,
Antoine
#9
ok, it's only when it's a required attribute that it reverts to default
#10
ha, exact same time
#11
yes, it's the same behavior, it only happens when a attribute is required (dependent attributes is disabled)
#12
jpstrikesback,
Thanks for all the testing on this. Here is a patch that should solve this issue. Let me know how testing goes.
Cheers,
Antoine
#13
AntoineSolutions,
The patch provided has fixed the issue for me. I'm using the latest 6.x 2.0 dev version.
Thanks!
--Matt.
#14
Actually, I spoke too soon. The patch fixes the issue when the "display price adjustment" setting is used, but when using "Display Total Price" it still does not work.
Thanks,
Matt.
#15
seems this is by design at the moment
<?php// If reprice is enabled and price adjustments are to be displayed
if (variable_get('uc_aac_reprice', 1) == 1 && variable_get('uc_attribute_option_price_format', 'adjustment') == 'adjustment') {
?>
does it depend on the form element array?
#16
Oh, and yes, it does fix the issue posted here thanks!!
Tho I'd also love to be able to show the total in the option text or nothing at all and just have the Display prices change, but I'll open a new issue for that.
#17
oops spoke too soon, I think this introduces a new little issue:
Since the default option text now uses what is set in POST if it's set, dependent options are not always updated to the correct defaults when moving back and forth across options eg:
I get to the page and here are the options (*=selected)
2006*
2007
2008
Dodge*
GMC
Ram 1500*
Let's say I have a 2007 something or another, so I choose 2007, now we have:
2006
2007*
2008
Chevrolet*
Dodge
GMC
Silverado*
The problem arises when I decide I want to select something back in 2006 instead...I get this:
2006*
2007
2008
Dodge*
GMC
Silverado*
I'll try to think thru a fix with a beer and an empty stomach...that should help right?
#18
#14: We should only be rebuilding the form if we are adjusting attribute prices based on selection. This has been fixed in the attached patch.
#17: This is new issue with the Dependent Attributes module. Let's open an issue there.
Patch attached.
*EDIT: I hate it when you realize something won't work seconds after you post it. This patch is no good as it greatly inhibits the ability for other modules to leverage uc_aac when interacting with a product. Working on a new patch.
Cheers,
Antoine
#19
Take 3!
This patch should once again fix #14 along with several other issues I found while trying different combinations of attributes settings.
Cheers,
Antoine
#20
Tested patch from comment #19 on latest 6.x-2.x-dev (Nov. 13) - works fine when set attributes price format to "Do not display"
Does not seem to correct the revert with other settings - but this suits our current needs so thanks ;)
#21
asak,
Everything seems to be working for me. Could you please give me a specific example of what is not working with this. Would be nice if I could get a couple other reviews...jpstrikesback, mwisner?
Cheers,
Antoine
#22
I did find and fix one bug. When you select the "Display total price" Option price format on the Attributes settings page, this format only works when a product has a single attribute. If a product has multiple attributes, it defaults to using the "Display price adjustment". Under this scenario, dynamic attribute adjustments were not working. This new patch will dynamically update product attributes when "Display total price" is selected and the product has 2 or more attributes.
Cheers,
Antoine
#23
This is the last issue keeping us from a 2.x-beta release. Could I please get a couple reviews on the latest patch.
Cheers,
Antoine
#24
Hello,
I have tested the patch in #22 and it appears that everything is now working. I also set a product up with two attributes and the "display total" setting selected, everything worked great.
Thanks!
--Matt.
#25
Thanks everyone for all the help testing. Patch from #22 has been committed. Marking as Fixed!
Cheers,
Antoine