Needs review
Project:
UC Attribute Stock Filter
Version:
6.x-1.0-beta12
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2009 at 05:15 UTC
Updated:
21 Nov 2009 at 16:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
terramedia commentedI'm getting this error as well, however it's coming up for me on every page where a product exists, whether the user does anything or not. Any thoughts?
Comment #2
pcomins commentedThere doesn't seem to be any response from the module dev team; I had to remove the item from my inventory because I can't have errors showing up on my live store site. Very annoying - I hope someone can figure out what's wrong.
Comment #3
henrrrik commentedLine 100 is a foreach loop that removes unavailable options from the select form (e.g. if "Large" is unavailable in ANY color, it removes it before the form is rendered). The error appears when there is no attribute array, i.e. there are no options in the select list. Can you verify that you have one or more attributes enabled for the product in question?
Comment #4
pcomins commentedI _had_ attributes and options set, basically that gave a buyer the ability to buy an item in a one-or-the-other mode, which would go to one sku or the other, quantity numbers set on each. Since this site is live I can't give you an example because adding the attributes to anything shows errors all over my catalogs. Other people are having the same problem - maybe someone else can give their example?
July 28 Update:
I turned the attributes and options back on for several of my live items. I don't see the error showing up on my pages any more but it's filling my log like mad:
Referrer http://www.bay94c.com/node/354
Message Invalid argument supplied for foreach() in /usr/www/users/bay94c/modules/uc_attribute_stock_filter/uc_attribute_stock_filter.module on line 100.
Comment #5
jagopian commentedHi,
I did a patch to fix this problem
Comment #6
terramedia commentedThe similar issue I was having was on http://epicsleepwear.com it was basically whenever there was stock on any of the attributes the error would appear. If there was no stock on any of the attributes then it didn't come up.
The patch above from jagopian seems to have fixed it though, thanks mate!!
Comment #7
terramedia commentedUpon further testing it would seem the patch only partially fixes the issue.
The error no longer occurs, however now, an attributes option that is out of stock can still be purchased if another option has stock.
For example if there are 3 sizes, S, M and L. There is stock of S, but M and L are out of stock.
If M or L are selected, they can still be added to the cart and purchased, the stock level is not checked and the user is not prevented from selecting these.
Before implementing the patch, out of stock options could not be selected, only in stock options.
It would appear if no stock of any option is available that it functions as expected, just not when there are some options in stock and some not.
Any thoughts?
Thanks for all your help so far with this.