Closed (fixed)
Project:
Ubercart Stock Manager With Attributes
Version:
5.x-1.0
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2009 at 15:08 UTC
Updated:
12 Jun 2009 at 16:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
hanoiiGot to the same issue and after extensive debugging I think I found the problem (and the solution).
There's a scenario which is not really considered in the uc_multi_get_sku() function, which is when some adjustments (if not all as per default) share the same SKU as the product. In that case no adjustment information is stored on the db, and then, the combination of attributes will not be found in the db. Further more, this function is supposed to return an SKU all the time, it's never checked against the return value (which is false in the event I just described) and thus leading to improperly set SKUs.
One of the places where this happen is on the uc_multi_stock_cart_item() hook, in which the function uc_multi_get_sku() is called, and if within the scenario above, it will return false and it will set the $item['model'] to false leading to no model information on the product's order and then no decrement of the stock level of the product (or adjustment).
Attached is my proposed and tested solution to the function in which an SKU is returned ALL the time, either the one found on the adjustments table or product's SKU. I also fixed the coding standards of that function. Hope this helps.
a.=
Comment #2
hanoiiComment #3
Vetkhy commentedI also want to note, that in 6.x-dev version the function uc_multi_get_sku also return FALSE if it cannot find adjustment so we can add to cart item with unknown adjustment.
Comment #4
hanoiiCommitted #1 to both branches.
@Vetkhy. Can you check the -dev version (check today's date) and see if this also fixes your issue on D6?
Thanks,
a.=
Comment #5
Vetkhy commentedYes. One little thing I want to say, that we should use active zero-level stock for product's SKU for this case.
Comment #6
hanoiiAlso, you may want to look at http://drupal.org/project/uc_out_of_stock. I have just released a new D6 version that contains some ideas and work alike this module.