Needs work
Project:
Commerce Stock
Version:
7.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
24 Jan 2012 at 22:26 UTC
Updated:
9 Jul 2014 at 21:35 UTC
Jump to comment: Most recent, Most recent file
When you add two products to a product display, and one has stock enabled for its product type, and the other one doesn't, the product that doesn't require stock is automatically marked as Out of Stock.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | enabled_stock_not_allways_checked_1415870_3.patch | 799 bytes | guy_schneerson |
| #3 | enabled_stock_and_disabled_stock_ine_one_dispaly_1415870_3.patch | 536 bytes | guy_schneerson |
Comments
Comment #1
guy_schneerson commentedand I thought I had all combination of products possible on my test site.
Will look into it.
Comment #2
guy_schneerson commentedthe good news is: its only an issue on version 1 :)
Comment #3
guy_schneerson commentedOK i fixed the issue but its not going to be easy to implement.
I am attaching two patches:
enabled_stock_not_allways_checked_1415870_3.patch
This fixes the logic so the form validate always checks that stock is enabled, that's good because products with stock disabled can get validated when in a product display holding other products with stock enabled.
I see no issues in committing this patch (after testing).
enabled_stock_and_disabled_stock_ine_one_dispaly_1415870_3.patch
This is a small patch but potentially problematic:
The existing code sets:
$stock_enabled[$key] = TRUE;if a product has no stock field.The patch changes this to:
$stock_enabled[$key] = FALSE;The reason for the original code is that the stock field in the past did not default to zero, so a missing stock field was evaluated as zero.
While this has been fixed people that have enabled stock on products before this was fixed may have products that are showing as out of stock that will suddenly become available if this patch is committed.
I don't see an easy way to resolve it possible options:
1) create a more comprehensive patch that add an update that upgrades all existing products first (volunteers?).
2) not commit the second patch and update the readme file and documentation explaining & pointing to the patch.
Any other idea, let me know
Comment #4
guy_schneerson commentedenabled_stock_not_allways_checked_1415870_3.patch is now committed as part of: http://drupalcode.org/project/commerce_stock.git/commit/0fcb18d.
will not commit enabled_stock_and_disabled_stock_ine_one_dispaly_1415870_3.patch (see #3 for more details)
Comment #6
guy_schneerson commentedIt has been a while so will probably roll out enabled_stock_and_disabled_stock_ine_one_dispaly_1415870_3.patch with a warning in the read me file and release notes
Comment #7
lsolesen commented