sunshynecraftsbeads Posted June 5, 2011 Share Posted June 5, 2011 HI, I was wondering if it was possible to have all my listings showing on my website regardless of whether they are in stock or not. IE: (example) Amethyst Crystals $1.00 Aquamarine Crystals $1.00 - Out of Stock Air Opal Crystals $1.00 I have looked for addons and googled my question but it all seem to tell me to do the Theme Switcher. I do not want to change my theme. I just want to let my customers know that I do carry that product but I am just out of stock for the moment. I actually really like the simple look of redmond for my site and do not want to chnage the theme as suggested. Is there somewhere I can go to get the information or is there a addon for the in the 2.3.1 version ? Any advise or help would be greatly appreciated. Thank you in advance, Tracie Link to comment Share on other sites More sharing options...
NodsDorf Posted June 5, 2011 Share Posted June 5, 2011 This add-on has working code: I slightly modified it for 2.3.1 Find: <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1"); $reviews = tep_db_fetch_array($reviews_query); ?> Add this above <div id="piGal" style="float: right;"> <?php if ($product_info['products_quantity'] == 0) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = (($check['count'] > 0) ? true : false); } else { $notification_exists = false; } echo "<font color=red><B>*** Temporarily out of stock. ***</b></font><BR>"; if ($notification_exists == true) { echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">Notify me when this item is in stock.</a>'; } else { echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">Notify me when this item is in stock.</a>'; } } else { echo "This product is available from our warehouse and usually ships in one day!<br>Local customers can call 555-555-5555 to check in-store availability.<br>"; } ?> </div> You can edit some of the text in there to reflect what you want it to say. Seems like it works okay. Link to comment Share on other sites More sharing options...
sunshynecraftsbeads Posted June 6, 2011 Author Share Posted June 6, 2011 Good Day, <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1"); $reviews = tep_db_fetch_array($reviews_query); ?> Add this above <div id="piGal" style="float: right;"> <?php if ($product_info['products_quantity'] == 0) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = (($check['count'] > 0) ? true : false); } else { $notification_exists = false; } echo "<font color=red><B>*** Temporarily out of stock. ***</b></font><BR>"; if ($notification_exists == true) { echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">Notify me when this item is in stock.</a>'; } else { echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">Notify me when this item is in stock.</a>'; } } else { echo "This product is available from our warehouse and usually ships in one day!<br>Local customers can call 555-555-5555 to check in-store availability.<br>"; } ?> </div> I have tried the code above as stated however it did not work. It is a very simple change. Just adding information to the php page. I tried putting the information above the <php and underneath but it does not show on my website that I am out of stock ? Am I missing something ? Any advise or suggestions would greatly be appreciated. Tracie Link to comment Share on other sites More sharing options...
NodsDorf Posted June 6, 2011 Share Posted June 6, 2011 This mod checks the quantities not the "Out of Stock" label . Try changing / modding one of your products to "In Stock" but set the quantity to 0. See if that fixes your issues. I tested the code before posting it, it worked on a stock version of 2.3.1 as I described. Link to comment Share on other sites More sharing options...
sunshynecraftsbeads Posted June 7, 2011 Author Share Posted June 7, 2011 Hi Don, I double checked the addition and did what you suggested and it is working fine. Thank you so much for your help.It is greatly appreciated. Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted June 7, 2011 Share Posted June 7, 2011 or simply add this to : product_info.php (around line 198): // QUANTITY AVAILABLE if($product_info['products_quantity']>0 ) { echo TEXT_PRODUCT_STOCK_LEVEL . (($product_info['products_quantity'] > 0) ? ' (' . $product_info['products_quantity'] . ')' : ''); } elseif ($product_info['products_quantity']<=0 ) { echo TEXT_PRODUCT_STOCK_LEVEL . (($product_info['products_quantity'] <=0) ? ' (' . TEXT_OUT_OF_STOCK_LEVEL . ')' : ''); } ?> the TEXT_PRODUCT_STOCK_LEVEL and TEXT_OUT_OF_STOCK_LEVEL, can be updated by the language files adding, define('TEXT_OUT_OF_STOCK_LEVEL', '<font color="#ff0000">OUT OF STOCK</font>'); etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.