Mfred Posted March 16, 2006 Share Posted March 16, 2006 (edited) Hi, I am searching for a contribution which is to my understanding really easy to implement. In Advanced Search I wanna have a Checkbox with "Only list products on stock" a) Is there a contrib already? b) Who could write it? (Just a simple sql query - only I dont know how to implement it correctly in osc) thx, mfred Edited March 16, 2006 by Mfred Quote Link to comment Share on other sites More sharing options...
Mfred Posted April 11, 2006 Author Share Posted April 11, 2006 any1? Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted April 11, 2006 Share Posted April 11, 2006 Unless I am mistaken. The default OSC install already has a checkbox for "Search In Stock Products Only" on the advanced_search.php page. Unless you are meaning for some other type of search action. Quote Link to comment Share on other sites More sharing options...
boxtel Posted April 11, 2006 Share Posted April 11, 2006 Unless I am mistaken. The default OSC install already has a checkbox for "Search In Stock Products Only" on the advanced_search.php page. Unless you are meaning for some other type of search action. you are mistaken. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
boxtel Posted April 11, 2006 Share Posted April 11, 2006 Hi, I am searching for a contribution which is to my understanding really easy to implement. In Advanced Search I wanna have a Checkbox with "Only list products on stock" a) Is there a contrib already? B) Who could write it? (Just a simple sql query - only I dont know how to implement it correctly in osc) thx, mfred in advanced_search.php after this: $info_box_contents[] = array('align' => 'right', 'text' => tep_draw_checkbox_field('search_in_description', '1') . ' ' . TEXT_SEARCH_IN_DESCRIPTION); add: $info_box_contents[] = array('align' => 'right', 'text' => tep_draw_checkbox_field('iso', '1') . ' ' . 'In stock Only'); in advanced_search_results.php after this: if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } you add: if (isset($HTTP_GET_VARS['iso']) && ($HTTP_GET_VARS['iso'] == '1')) { $where_str .= " and p.products_quantity > 0 "; } and make sure you add p.products_quantity to the select statement as currently it is only added if display of it is selected: $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; Quote Treasurer MFC Link to comment Share on other sites More sharing options...
Mfred Posted April 11, 2006 Author Share Posted April 11, 2006 thx that did it! just for info for others: I implemented it in advanced_search on the bottom of search options: <tr> <td class="fieldKey"><?php echo ENTRY_ON_STOCK; ?></td> <td class="smallText"><?php echo tep_draw_checkbox_field('iso', '1'); ?></td> </tr> I think it fits there better :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.