Hi, I'm having issues with this module and "Dependent Attributes".
Say I have this attributes and options for a product
Color:
-red
-blue
-pink
Size:
-50ml
-100ml
And say that the combination of PINK + 50ML is not possible (using Dependent Attributes).
If I have my current form as: BLUE + 50 ML and then change the colour to Pink, the form shows me now this PINK + 100ML which is correct, but the attributes on the page are changed as if PINK + 50ML was selected, which shouldn't be possible.
I tried to find what the problem was but couldn't figure it out. Point is that Ubercart Ajax Attribute Calculations is not being aware of the change in the form.
Check this:
http://paola.federicojm.com/node/4
If you need more info let me know.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | uc_aac.zip | 11.93 KB | cybis |
| #25 | uc_dependent_attributes.zip | 10.8 KB | cybis |
| #17 | 715878-uc_aac.17.patch | 1.26 KB | cybis |
| #13 | uc_aac-patch.patch | 1.71 KB | cybis |
| #12 | uc_aac.zip | 12.07 KB | cybis |
Comments
Comment #1
jm.federico commentedAh, btw, check the SKU, better than the price.
PINK + 100ml SKU: 413
PINK + 50ml SKU: 416 -> This one shouldn't happen.
Comment #2
jantoine commentedjm.federico,
If you do not wan't the Pink + 50ml to be a selectable combination, then you need to visit the products "Adjustments" tab and uncheck the "Enabled" checkbox for this particular combination that the "Dependent Attributes" module adds to the form. If you have done that and are still seeing an issue, please describe in further detail.
Cheers,
Antoine
Comment #3
jm.federico commentedHi Antonie, thanks for your reply
well, thing is I have that checkbox unselected. Effectively it doesn't show up, but all the information for the product is shown as if that option was selected.
I'm going to try and describe what exactly happens:
1. Create a product and assign 2 attributes to it (size and colour).
2. Each attribute has 2 options, giving me 4 combinations
red + 50ml, sku 1
red + 100ml, sku 2
blue + 50ml, sku 3
blue + 100ml, sku 4
3. I disable one of the combinations (red + 50ml)
This settings mean that the product should only have 3 combinations
red + 100ml, sku 2
blue + 50ml, sku 3
blue + 100ml, sku 4
So far so good, the -disabled- attribute is not shown to the user as an option.
Now the tricky part. (please bear with me as I'm not a native English speaker and I'm going to try and make this as clear as possible)
When the selected option is:
blue + 100ml, sku 4
and I change the colour
blue -> red
Things happen the way they should
When the selected option is:
blue + 50ml, sku 4
and I change the colour
blue -> red
Problem arise, the product information gets refreshed, and the "selected option" seems to be
red + 100ml
which is logical, since the 50ml option is disabled. But the product info that is shown is the one that corresponds to
red + 50ml, sku 1
Meaning that even when the drop-boxes show RED and 100ML as the selected option, the SKU (and the price) shown is the one that corresponds to RED 50ML
SO the problem is that the previously selected SIZE is not available with the new COLOUR but uaa_calc seems not to be aware of that.
To make it easier, go to http://paola.federicojm.com/node/4 and to this:
blue + 100ml, sku 4
blue -> red
The SKU show is 2, this is correct, now
blue + 50ml, sku 4
blue -> red
Thw SKU is 1, This is incorrect, should be 2, since the option for 1 (red 50ml) is disabled.
If I'm not making any sense please let me know. but hopefully with the example things are clear.
Federico
Comment #4
jm.federico commentedSome extra info about my config:
Attribute settings
- Ajax Attribute Calculations dynamically adjusts product information as a product's attribute options are changed. (CHECKED)
- Display price adjustment
I noticed that if I choose- Do not displayinstead of- Display price adjustmentThe behaviour is somehow different but correct.The -disabled- option will be shown to user, but when selected it automatically reverts to the available options. Making this one impossible to select.I don't really like that functionality, I rather not having the option there at all, it might confuse the customer by making him/her think that there is something wrong with the page.Comment #5
cybis commentedI have the exact same problem on my setup. For a demo try this:
- go to
http://lucbusquin.com/node/7it's fixed!)- choose 'Fine Print' with a 'wood frame' option
- go back to 'Value Edition'
The sku and the price are now for an item that is deselected in the 'Adjustments' tab (this shouldn't be). If nevertheless you add the selection to the cart the correct (but different) price and item are added.
Comment #6
cybis commentedHere is another observation: Ubercart Option Images is not affected by this bug and displays the correct image for the selection. This seems to suggest the issue is indeed with uaac and not with Ubercart Dependent Attribute.
As a way to warn visitor of the potential problem, I've use the sku fields in the 'Adjustments' tab of deselected item to display a error message (see
http://lucbusquin.com/node/7it's fixed!)Please let me know what further info you guys need (the status of this issue is 'postponed (maintener needs more info)').
Comment #7
cyu commentedI recall doing some really messy custom hacking to get uc_aac working with a whole series of modules (price per role, dependent attributes, option images, out of stock) and don't think I'm going to be able to do the uc_aac rewrite in d6 that would accommodate these all in a generic way like a hook system. If someone else has the drive to do that, I'd be glad to start a 3.x branch and give commit access. If not, this probably won't cross my mind again until d7.
Comment #8
cyu commentedFor the dependent attribute specific part of this issue, marking as a dup of #715884: Changes in form not being exposed to Ubercart Ajax Attribute Calculations
If anyone wants to open an issue related to any of the other modules mentioned above, feel free to.
Comment #9
cybis commentedI’m way out of my element here, but it seems to me that the compatibility problem may lie with uc_aac.js.
When a click event occurs on the add to cart form, uc_aac will proceed in the following sequence:
Since (1) and (2) occur before (3), the HTML elements (SKU, diplay price, etc.) will be replaced with value from a combination of attribute options that may have been deselected in adjustments page.
I think (3) should occur before (2), no?
Comment #10
cybis commentedI modified uc_aac.js to execute the following:
It seems to fix the compatibility issue. I've attached the modified uc_aac.js. As I said earlier, I'm way out of my element here and I'm sure there is a prettier to do it.
Comment #11
cybis commentedChanged status to 'needs review'.
Comment #12
cybis commentedOk, I think I got these modules to work together:
uc_aac.js was modified further from my previous post here to work with uc_option_image.
(I'll post a patch file as soon as learn how make one ;)
Don't use attached files. See post #16.
Comment #13
cybis commentedHere is the patch associated with post #12. (my first patch, let me know if doesn't work)
Don't use attached files. See post #16.
Comment #14
cyu commentedThanks Cybis, hopefully some people will be able to test this out and give some feedback. I imagine it will be helpful for others in the same scenario.
As far as committing the code into a new release, I'm not fond of the section with:
The modules need to find a nicer way to play together than to make special cases like that. I've talked with others about a hook system to make this all work, but it is outside of what I want to do with the D6 version....so a solution like you've provided will probably be necessary for anyone who wants to combine these modules, but isn't the route I'm hoping to take moving forward.
As far as doing a double request, again I'm glad you found a working solution, but that isn't the route I'd like to take with the module. When a large majority of the scenarios work with 1 request, doubling that to cover an edge case would be a bad idea.
Comment #15
cybis commentedcYu,
I totally understand where you're coming from. The patch I provided is more a hack than a workable solution. I'm working on getting rid of 'if (UCOI)' and making option image work with attached behavior instead. (if(UCOI) was coming from an earlier patch)
As far as the double request, again not pretty, but it's the only way I can think of for uc-aac to work with modules like dependent attributes. I'm curious if the increased load is the only downside to it.
hopefully thinks will look up with D7
Thanks for your great work, cYu!
Comment #16
cybis commentedOk, got rid of the ugly ‘if(UCOI)..’.
I modified Uc_option_image.js to work on aac’s Ajax delivered content by being called with Drupal.attachBehaviors() in uc_aac.js.
So unmodified aac should now work with this patched UCOI.
The ‘dual requests’ stays in order to enable dependent attribute compatibility.
The attached files are needed only to work with dependent attributes.
Comment #17
cybis commentedAttached is a cleaned up version of the patch #16. Also it works with uc_aac-6.x-2.1.
Comment #18
xl_cheese commentedThanks for the patch. However, it didn't make any change in the behavior I'm getting that was reported in this bug. It still won't filter out the unselected attribute combinations.
Comment #19
BrisCoder commentedI am also getting the issue where I can't get dependent attributes to filter out the unselected attribute combinations.
I have a select list where it shows all options, but I can't select the unavailable combinations.
It needs to simply get rid of those unwanted options all together out of the select list.
This post may be confusing, it's 5:45am and I haven't slept yet :)
Comment #20
cybis commentedIt works for me with Dependent Attributes 6.x-1.x-dev and a patched uc-aac-6.x-2.1.
But, make sure 'Required' is not checked for all your products attributes or it won't work.
Comment #21
deardagny commentedxl_cheese and BrisCoder – Any luck since you last posted? I'm having the same issue and am using the same mod versions as cybis in #20. Feels like I've tried everything. Any breakthroughs would be appreciated!
Comment #22
jbenjamin commentedim in the same boat. seems as though it initially works, but after adding a few items, I'm no longer seeing the selects change to reflect the excluded attributes.
update: I've narrowed down where the problem is occurring, at least in my situation.
I'm working on a clothing site, where jeans in certain colors are available only in certain inseam or waist sizes. However, the prices do not change. This lead me to set 'admin/store/settings/attributes' -> option price format "checked" / "Do not display".
This seems to break the select list updating. Once i set the radio button back to "display price adjustment", the unavailable select list items are correctly removed from the lists.
Hope this helps anyone else coming up against something similar.
Comment #23
cybis commentedSee this post for a much better solution: #1235202: uc_aac should supply a context to attachBehaviors after modifying the add to cart form.
Comment #24
priyankap commentedHi cybis,
This patch works like magic for me... thank you!
Well, I don't understand jquery. I had tried the patch at http://drupal.org/node/1235202 and could not get it working.
Than I tried this patch and it did work!!
Thank you
Comment #25
cybis commented@priyankap, patch #17 here works but is clunky and obsolete. I currently use uc_dependent_attributes 6.x-1.x-dev unpatched and uc_aac 6.x-2.1 patched only with #1235202: uc_aac should supply a context to attachBehaviors after modifying the add to cart form with good results.
I've attached those modules as currently sitting in my install.