First, a little bug that I found in your new release by using beyond compare with older ones.
In functions_lookups.php on line 163:
should've been:function zen_get_products_stock($products_id) {
Next, I applied a fix by Grayson posted in archived threads to show qty of attributes on product info page. For those who still having trouble with this fix, I am including the attributes.php file here. You may drop it in includes/modules/your_template/ folder./* function zen_get_products_stock($products_id) {
I am also including another alternative version of this fix (I take no credit whatsoever on this), which shows attribute stock after price_fix and weight etc. display, which makes more sense to myself, becasue this way customer won't confuse stock level with quantity discounts/surcharges. This alternative file is called attributes_Alternative.php. You need to rename it to attributes.php to overwrite the existing one when using.
Don't forget to add a define to the product_info.php in includes/languages/english/your_template folder, such as:
[quote][define('TEXT_ATTRIBUTES_PIECES','pieces');/QUOTE]. I use 'in stock' instead of 'pieces', for it makes more sense.
Now, I need help for myself!! I tried hard to set a "display only" option value such as " select from below" to NOT show stock level, which is a conditional undone of the above fix in attributes.php. I tried codes as follows, but no luck:
This block of codes were applied after the "// prepare product options details" section and before "//radio buttons" section./*
* check if attribute is display only
*/
global $db;
$check_attributes = $db->Execute("select *
from " . TABLE_PRODUCTS_ATTRIBUTES . "
where products_id = '" . (int)$products_id . "'
and options_id = '" . (int)$option . "'
and options_values_id = '" . (int)$value . "'");
if ($check_attributes->fields['attributes_display_only'] == '1') {
$products_options_value_id = $products_options->fields['products_options_values_id'];
$products_options_details = $products_options->fields['products_options_values_name'];
$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
}
Any help on this would be greatly appreciated!
Bookmarks