Needs review
Project:
UC Attribute Stock Filter
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2011 at 14:53 UTC
Updated:
12 Sep 2012 at 08:54 UTC
Jump to comment: Most recent file
Comments
Comment #1
czeky commentedjust found out Your commented alert(parentId); is popping up when selecting one of the options, so javascript function is loaded, but not filtering out options in second select box
Comment #2
selinav commentedI've the same problem, nothing happen. I've attribute size and colour, and when I change the size, available colour don't change. I've also installed uc_multi_stock.
Can you help me?
Comment #3
selinav commentedIf I have stocks like this :
Size S, color blue : 0
Size S, color grey : 1
Size M, color blue : 0
Size M, color grey : 1
The select box color has only one option : grey, it works
but if I have
Size S, color blue : 1
Size S, color grey : 1
Size M, color blue : 0
Size M, color grey : 1
The select box color has 2 options : blue and grey, but if I change the size, I can order blue M, the javascript refresh doesn't happend.
What should I do?
Comment #4
selinav commentedWith the help of a friend with have find the error :
on the uc_attribute_stock_filter.module line 89 :
+ $tabnid=array();
+ $tabnid[$node->nid]=$available;
on line 93
- $js_array = "var uc_asf_AvailableOptions = ". json_encode($available);
+js_array = "var uc_asf_AvailableOptions = ". json_encode($tabnid);
Comment #5
drinkingcoffee commentedThanks -- the fix in #4 works for me. Though, I have completely different line numbers than 89.
I made the changes starting at line 45.
Comment #6
Samgarr commentedThanks, works for me!
Comment #7
nelslynn commentedCan anyone else take a stab at a fix for this... I will test and give feedback right way. The fix in #4 is not working with Ubercart 2.7.
If a product has two attributes, for example size and color, with two dropdown select boxes, the second select box does not get updated with attributes that are out of stock. The first select box works great when all attributes of it's option are out of stock.
I've tried both the beta13 and dev versions.
I just noticed another issue this module is causing against Ubercart: When you select a default attribute (in the Options tab), the first attribute becomes the default no matter what default is selected.
Thanks.
Comment #8
goodeit commentedI just took a look at this, and the problem appears to be that the json array of available options isn't keyed by the node id. Try this around line 35:
- $available[$option][] = $avail_opt;
+ $available[$node->nid][$option][] = $avail_opt;
Also, in order to get it to work inside Views, I had to add
case 'load':right abovecase 'view':(probably line 18).Note that both of these are against -dev and I'm working with Ubercart 2.7.
One more thing I noticed is that it appears using a Fusion sub-theme can break this. I have a workaround but it is very ugly, so I'm not going to share it unless someone really wants it.
Comment #9
ermannob commentedHi, thanks goodeit for the hints!
I'm working on a project and I had to work around this issue.
I'm offering a patch, just to help speed up fixing... It's based on your suggestions and I also included the "ugly workaround" (I'm pretty sure I know what you were talking about :D ).
The ugly workaround in .js file has some comments nearby, so please take a look at it, before your web site explodes... :)
Greetings,
-ermannob