Forums / General Questions / Filter results

Filter results

Locked

Started by datoshway on 13 Jun 2007, 1:20 AM · Views: 3,070

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
13 Jun 2007, 1:20 AM
#1
datoshway avatar

datoshway

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Filter results

Mine is not appearing, even though it's set to true in the admin panel, Why? Where is this drop down located?

14 Jun 2007, 12:36 PM
#2
lib99 avatar

lib99

Totally Zenned

Join Date:
Dec 2004
Location:
New York, USA
Posts:
965
Plugin Contributions:
0

Re: Filter results

datoshway:

Mine is not appearing, even though it's set to true in the admin panel, Why? Where is this drop down located?

It's helpful to be more specific when posting a question and include a link to your site for illustration. Presumably you refer to the filter for product listing? Have you tried switching to the classic template to see if it is works with the default ZC template? If classic works, then you need to back track with your custom template.

14 Jun 2007, 3:37 PM
#3
datoshway avatar

datoshway

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Re: Filter results

Ok, so I tested with standard template and the sort drop down appeared on the top of the page, switched back to custom template and it's not showing, so what file exactly should I be looking and what snippit should I be looking for?? Thanks.

14 Jun 2007, 4:23 PM
#4
lib99 avatar

lib99

Totally Zenned

Join Date:
Dec 2004
Location:
New York, USA
Posts:
965
Plugin Contributions:
0

Re: Filter results

Manually compare or try using a file comparison tool such as winmerge and compare default template copy of tpl_index_product_list.php to your custom template equivalent.

FAQ's :: Using WinMerge

edit:
look for this part```

<?php $check_for_alpha = $listing_sql; $check_for_alpha = $db->Execute($check_for_alpha); if ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true') { $form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>'; ?>
14 Jun 2007, 4:35 PM
#5
datoshway avatar

datoshway

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Re: Filter results

I inserted that code into that file and got this error..

Parse error: syntax error, unexpected $end in /home/modani/public_html/store/includes/templates/theme028/templates/tpl_index_product_list.php on line 88

Heres my code for that file.

<?php /** * Page Template * * Loaded by main_page=index<br /> * Displays product-listing when a particular category/subcategory is selected for browsing * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_index_product_list.php 2975 2006-02-05 19:33:51Z birdbrain $ */ ?> <div id="indexProductList"> <?=tm_head($breadcrumb->last())?> <div class="main_block"> <?php if ($do_filter_list) { $form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>'; ?> <?php echo $form; ?> <?php if (!$getoption_set) { echo zen_draw_hidden_field('cPath', $cPath); } else { echo zen_draw_hidden_field($get_option_variable, $_GET[$get_option_variable]); } if (isset($_GET['typefilter'])) echo zen_draw_hidden_field('typefilter', $_GET['typefilter']); if ($_GET['manufacturers_id']) { echo zen_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']); } echo zen_draw_hidden_field('sort', $_GET['sort']); echo zen_draw_hidden_field('main_page', FILENAME_DEFAULT); echo zen_draw_pull_down_menu('filter_id', $options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"'); echo zen_hide_session_id(); ?> </form> <?php } ?> <br class="clearBoth" /> <?php // categories_description if ($current_categories_description != '') { ?> <div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <?php /** * require the code for listing products */ require($template->get_template_dir('tpl_modules_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_product_listing.php'); ?> <?php //// bof: categories error if ($error_categories==true) { // verify lost category and reset category $check_category = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_id='" . $cPath . "'"); if ($check_category->RecordCount() == 0) { $new_products_category_id = '0'; $cPath= ''; } ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MISSING); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_UPCOMING') { include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> <?php } //// eof: categories error ?> <?php //// bof: categories $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_LISTING_BELOW); if ($error_categories == false and $show_display_category->RecordCount() > 0) { ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_LISTING_BELOW); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_UPCOMING') { include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> <?php } //// eof: categories ?> </div><?=tm_head_end();?> </div> <?php $check_for_alpha = $listing_sql; $check_for_alpha = $db->Execute($check_for_alpha);

if ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true') {
$form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>';
?>

14 Jun 2007, 5:35 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Filter results

The idea was not to just stick that code onto the end of your file; it was to look for it in the stock file as a guide for how/where to modify yours.

Without examining the original, I would guess that it is supposed to be near the top, around (and probably integrated with) this:```php

<?php if ($do_filter_list) { $form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>'; ?>
14 Jun 2007, 6:29 PM
#8
datoshway avatar

datoshway

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Re: Filter results

BTW here is my code with the snippit intergrated.

<?php /** * Page Template * * Loaded by main_page=index<br /> * Displays product-listing when a particular category/subcategory is selected for browsing * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_index_product_list.php 2975 2006-02-05 19:33:51Z birdbrain $ */ ?> <div id="indexProductList"> <?=tm_head($breadcrumb->last())?> <div class="main_block"> <?php $check_for_alpha = $listing_sql; $check_for_alpha = $db->Execute($check_for_alpha); if ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true') { $form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>'; ?> <?php echo $form; ?> <?php if (!$getoption_set) { echo zen_draw_hidden_field('cPath', $cPath); } else { echo zen_draw_hidden_field($get_option_variable, $_GET[$get_option_variable]); } if (isset($_GET['typefilter'])) echo zen_draw_hidden_field('typefilter', $_GET['typefilter']); if ($_GET['manufacturers_id']) { echo zen_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']); } echo zen_draw_hidden_field('sort', $_GET['sort']); echo zen_draw_hidden_field('main_page', FILENAME_DEFAULT); echo zen_draw_pull_down_menu('filter_id', $options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"'); echo zen_hide_session_id(); ?> </form> <?php } ?> <br class="clearBoth" /> <?php // categories_description if ($current_categories_description != '') { ?> <div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <?php /** * require the code for listing products */ require($template->get_template_dir('tpl_modules_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_product_listing.php'); ?> <?php //// bof: categories error if ($error_categories==true) { // verify lost category and reset category $check_category = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_id='" . $cPath . "'"); if ($check_category->RecordCount() == 0) { $new_products_category_id = '0'; $cPath= ''; } ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MISSING); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_UPCOMING') { include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> <?php } //// eof: categories error ?> <?php //// bof: categories $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_LISTING_BELOW); if ($error_categories == false and $show_display_category->RecordCount() > 0) { ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_LISTING_BELOW); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_LISTING_BELOW_UPCOMING') { include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> <?php } //// eof: categories ?> </div><?=tm_head_end();?> </div>
14 Jun 2007, 6:59 PM
#9
lib99 avatar

lib99

Totally Zenned

Join Date:
Dec 2004
Location:
New York, USA
Posts:
965
Plugin Contributions:
0

Re: Filter results

Looks like you are on the path to victory! :flex:

A couple of things....

It's not necessary to keep posting your code, unless there is something specific you would like the forum community to examine with you. If you do post code, use the CODE wrapper (you'll see the little hash (pound) symbol above). Not a big deal, just a helpful tip. :wink:

More Important -
In that link you posted to your site, for future reference, always omit the ** &zenid=85d2.......snip.........2c4d **

That is a unique identifier that allows the server to differentiate one visitor from another. Two people sharing that same id, will be treated as the same visitor. It's a security issue. Keep that in mind when posting links to your site. You can read more about by doing a search on session id or zenid.

Quick look at your site, and it looks very nice!!!

14 Jun 2007, 7:16 PM
#10
datoshway avatar

datoshway

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Re: Filter results

Ok sorry about that. i'll make sure I follow those guildlines from this point foward, any suggustions as to why the drop downs aren't fullfiled? I posted the code so you can all see where I inserted that snippit and if I did somthing wrong with what is already there.