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.

Comments

jm.federico’s picture

Ah, btw, check the SKU, better than the price.

PINK + 100ml SKU: 413
PINK + 50ml SKU: 416 -> This one shouldn't happen.

jantoine’s picture

Status: Active » Postponed (maintainer needs more info)

jm.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

jm.federico’s picture

Hi 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

jm.federico’s picture

Some 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 display
instead of
- Display price adjustment

The 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.

cybis’s picture

I have the exact same problem on my setup. For a demo try this:

- go to http://lucbusquin.com/node/7 it'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.

cybis’s picture

Version: 6.x-2.x-dev » 6.x-2.0
Priority: Major » Normal
Status: Needs review » Postponed (maintainer needs more info)

Here 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/7 it's fixed!)

Please let me know what further info you guys need (the status of this issue is 'postponed (maintener needs more info)').

cyu’s picture

Status: Postponed (maintainer needs more info) » Active

I 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.

cyu’s picture

Status: Active » Closed (duplicate)

For 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.

cybis’s picture

I’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:

  • (1) Make a request with POST
  • (2) Replace the HTML elements with the new values
  • (3) Update the add to cart form

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?

cybis’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Priority: Normal » Major
Status: Closed (duplicate) » Patch (to be ported)
StatusFileSize
new691 bytes

I modified uc_aac.js to execute the following:

  1. Make a request with POST
  2. Update the add to cart form
  3. Make a new request with POST
  4. Replace the HTML elements with the new values

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.

cybis’s picture

Status: Patch (to be ported) » Needs review

Changed status to 'needs review'.

cybis’s picture

StatusFileSize
new12.07 KB

Ok, I think I got these modules to work together:

  • uc_aac-6.x-2.x-dev
  • uc_option_image-6.x-1.4
  • uc_dependent_attributes-6.x-1.x-dev

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.

cybis’s picture

StatusFileSize
new1.71 KB

Here 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.

cyu’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs review

Thanks 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:

if (UCOI) {

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.

cybis’s picture

cYu,

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!

cybis’s picture

StatusFileSize
new1.73 KB
new12.04 KB

Ok, 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.

cybis’s picture

Version: 6.x-2.x-dev » 6.x-2.1
Priority: Major » Normal
StatusFileSize
new1.26 KB

Attached is a cleaned up version of the patch #16. Also it works with uc_aac-6.x-2.1.

xl_cheese’s picture

Thanks 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.

BrisCoder’s picture

I 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 :)

cybis’s picture

It 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.

deardagny’s picture

xl_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!

jbenjamin’s picture

im 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.

cybis’s picture

priyankap’s picture

Hi 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

cybis’s picture

Category: bug » feature
Status: Needs review » Closed (duplicate)
StatusFileSize
new10.8 KB
new11.93 KB

@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.