Re: Show out of stock items but not for sale
Set your inventory tracking to off and your disabled when out of stock to off.
Then edit your include/func/func.product.php
Find this section
$appearance = array(
'empty_stock' => $config['General']['unlimited_products'] != "Y" && ($product['avail'] <= 0 || $product['avail'] < $product['min_amount']),
'has_price' => $product['taxed_price'] > 0 || (!empty($product['variantid']) && isset($product['variants_has_price']) && $product['variants_has_price']),
'has_market_price' => $product['list_price'] > 0 && $product['taxed_price'] < $product['list_price'],
'buy_now_enabled' => $current_area == 'C' && $config['Appearance']['buynow_button_enabled'] == "Y",
'buy_now_form_enabled' => $product['price'] > 0 || ($active_modules['Special_Offers'] && $product['use_special_price']) || $product['product_type'] == 'C',
'min_quantity' => max(1, $product['min_amount']),
'max_quantity' => $config['General']['unlimited_products'] == "Y" ? $config['Appearance']['max_select_quantity'] : min($config['Appearance']['max_select_quantity'], $product['avail']),
'buy_now_buttons_enabled' => $config['General']['unlimited_products'] == "Y" || ($product['avail'] > 0 && $product['avail'] >= $product['min_amount']) || ($product['variantid'] && $product['avail'] > 0),
'force_1_amount' => $product['distribution'] || (!empty($active_modules['Subscriptions']) && !empty($product['catalogprice']))
);
I changed it to this:
$appearance = array(
'empty_stock' => ($product['avail'] <= 0 || $product['avail'] < $product['min_amount']),
'has_price' => $product['taxed_price'] > 0 || (!empty($product['variantid']) && isset($product['variants_has_price']) && $product['variants_has_price']),
'has_market_price' => $product['list_price'] > 0 && $product['taxed_price'] < $product['list_price'],
'buy_now_enabled' => $current_area == 'C' && $config['Appearance']['buynow_button_enabled'] == "Y",
'buy_now_form_enabled' => $product['price'] > 0 || ($active_modules['Special_Offers'] && $product['use_special_price']) || $product['product_type'] == 'C',
'min_quantity' => max(1, $product['min_amount']),
'max_quantity' => $config['General']['unlimited_products'] == "Y" ? $config['Appearance']['max_select_quantity'] : min($config['Appearance']['max_select_quantity'], $product['avail']),
'buy_now_buttons_enabled' => ($product['avail'] > 0 && $product['avail'] >= $product['min_amount']) || ($product['variantid'] && $product['avail'] > 0),
'force_1_amount' => $product['distribution'] || (!empty($active_modules['Subscriptions']) && !empty($product['catalogprice']))
);
On my 4.3 that makes it so the system doesnt check if inventory track is on or off, it will only check if there is any stock left. So you can have inventory tracking disabled and it will still show it as out of stock if availability is down to 0.
Works for me,
|