did you look up my stock by attribute, I updated it using 1.3.9D You'll have to use winmerge to adjust changes.
http://www.gotleather.com/Stock_by_A...files_V4.8.zip
did you look up my stock by attribute, I updated it using 1.3.9D You'll have to use winmerge to adjust changes.
http://www.gotleather.com/Stock_by_A...files_V4.8.zip
Thanks! I'll look at it now.
It looks like this was the major edit in the Orders.PHP (which was my major concern)
// kuroi: SbA
$option_name_array = explode(":", $order->products[$i]['attributes'][$j]['option']);
$option_Name = $option_name_array[0];
// end: sbA
echo '<br /><nobr><small> <i> - ' . $option_Name . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
Thank you so much. This version of the Stock-by-attribute is much cleaner and easier for me sift through. I'm going to bet that the rest of the files will also be so I will say thanks now. If I have any other questions I'll come back. Thanks again!
OK, All worked as expected except...
I have configured products with a two-option selection. When a customer adds a product they must select
-flavor option (1 - 4)
-strength option (a - d)
The problem lies where production option combination for, say, 3b does not exist or has 0 stock. The customer is allowed to select it anyway... which is confusing because the message will appear stating that there is not enough qty on hand... Now I could change the message but that still leaves the customer guessing as to what is in stock... or I could display my stock, but my stock is very low and I would prefer not to advertise this.
I would rather not display a combination of options that have 0 stock or do not exist so the customer cannot select it in the first place. Is this possible to do?![]()
See if this helps you out:
open /includes/modules/attributes.php and replace this:
with this:PHP Code:$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
PHP Code:$sql= "SELECT pov.products_options_values_id,
pov.products_options_values_name,
pa.*,
pwas.*
FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas ON pwas.stock_attributes = pa.products_attributes_id
WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and (pwas.quantity > 0 or pwas.quantity IS NULL)
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
Or you may want to install the Dynamic Drop Downs for SBA mod, it has an option in it to: Prevent Adding Out of Stock to Cart
creinold,
Thank you. I will try it out and let you know. My novice understanding of PHP and SQL tell me that this looks like it if I run out of stock on an attribute item it will not include it in the selectable items. I don't think I'll be able to put this mod tonight, but I will let you know.
Thanks again!