- OK, the Price Range sidebox does not appear initially.
- If you click Shop By Brand or select a category from the top menu it appears
- If you click any range when categories has been selected you're brought here (Screenshot#1) Notice the "Limit to Category", "Search by Price Range" has values plugged into them.
- When you Shop By Brand the first two price ranges bring you to screenshot#1 with the appropriate price range plugged in. The last 3 price ranges seem to be working.
- I would wish to have only relevant price ranges appear according to brand and/or category. But, that could be the next step once this (code) is actually straightened out. Unless it can be accomplished simulatenaeously.
And here's the tpl_search code
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: tpl_search.php 277 2004-09-10 23:03:52Z wilt $
// $Id: tpl_search.php,v 1.0 2005/02/01 00:00:00 juxi zoza $
//
$content = '';
//------------------------------------------------------------------------ REMOVED
// $content .= '<span class="search_subtitle">' . BOX_SEARCH_QUICK_TEXT . '</span>';
// Optional silver.gif, used by Zencart in many places
// $content .= zen_draw_separator('pixel_silver.gif') . '<br />';
//------------------------------------------------------------------------ REMOVED
// Optional <HR> "Horizontal Rule"
// $content .='<HR />';
//
// $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
// $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
// $content .= zen_draw_hidden_field('search_in_description', '1');
// $content .= '<div align="center">' . zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />';
// $content .= "</div></form>";
//
// $content .= '<br /><span class="search_subtitle">' . BOX_SEARCH_QUICK_PRICE . '</span>';
//
//// Optional silver.gif, used by Zencart in many places
//// $content .= zen_draw_separator('pixel_silver.gif') . '<br />';
//
//// Optional <HR> "Horizontal Rule"
// $content .='<HR />';
//
//------------------------------------------------------------------------ REMOVED
// Advanced Search URLs are created
// Add or Delete $content rows, as needed
//------------------------------------------------------------------------ ADDED
// Define Search Price From and To ranges
define('SP_RANGE_1_F','0.00' ); define('SP_RANGE_1_T','49.99' );
define('SP_RANGE_2_F','50.00' ); define('SP_RANGE_2_T','99.99' );
define('SP_RANGE_3_F','100.00' ); define('SP_RANGE_3_T','499.99');
define('SP_RANGE_4_F','500.00' ); define('SP_RANGE_4_T','999.99');
define('SP_RANGE_5_F','1000.00' ); define('SP_RANGE_5_T','' );
// Use Search Price From & To Defines to Define text shown in sidebox
define('SP_RANGE_1', "\$" . SP_RANGE_1_F . " - \$" . SP_RANGE_1_T);
define('SP_RANGE_2', "\$" . SP_RANGE_2_F . " - \$" . SP_RANGE_2_T);
define('SP_RANGE_3', "\$" . SP_RANGE_3_F . " - \$" . SP_RANGE_3_T);
define('SP_RANGE_4', "\$" . SP_RANGE_4_F . " - \$" . SP_RANGE_4_T);
define('SP_RANGE_5', "\$" . SP_RANGE_5_F . " +");
//------------------------------------------------------------------------ ADDED
$content .= '<hr class="leg_hr_sidebox"/>';
$content .= '<div class="search_pricerange">';
$content .= '<a href="' . zen_href_link('advanced_search&keyword=&pfrom=' . SP_RANGE_1_F . '&pto=' . SP_RANGE_1_T . '&categories_id=' . $_GET['cPath']) . '">' . SP_RANGE_1 . '</a><br />';
$content .= '<a href="' . zen_href_link('advanced_search&keyword=&pfrom=' . SP_RANGE_2_F . '&pto=' . SP_RANGE_2_T . '&categories_id=' . $_GET['cPath']) . '">' . SP_RANGE_2 . '</a><br />';
$content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_3_F . '&pto=' . SP_RANGE_3_T . '&categories_id=' . $_GET['cPath']) . '">' . SP_RANGE_3 . '</a><br />';
$content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_4_F . '&pto=' . SP_RANGE_4_T . '&categories_id=' . $_GET['cPath']) . '">' . SP_RANGE_4 . '</a><br />';
$content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_5_F . '&pto=' . SP_RANGE_5_T . '&categories_id=' . $_GET['cPath']) . '">' . SP_RANGE_5 . '</a><br />';
echo 'PATH ' . $_GET['categories_id'] . ' - cpath ' . $_GET['cPath'] . ' - get $current ' . $_GET['current_categories_id'] . ' $current ' . $current_categories_id . '<br>';
// $content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_1_F . '&pto=' . SP_RANGE_1_T) . '">' . SP_RANGE_1 . '</a><br />';
// $content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_2_F . '&pto=' . SP_RANGE_2_T) . '">' . SP_RANGE_2 . '</a><br />';
// $content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_3_F . '&pto=' . SP_RANGE_3_T) . '">' . SP_RANGE_3 . '</a><br />';
// $content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_4_F . '&pto=' . SP_RANGE_4_T) . '">' . SP_RANGE_4 . '</a><br />';
// $content .= '<a href="' . zen_href_link('advanced_search_result&keyword=&pfrom=' . SP_RANGE_5_F . '&pto=' . SP_RANGE_5_T) . '">' . SP_RANGE_5 . '</a><br />';
$content .= '</div>';
$content .= '<br/>';
// Optional <HR> "Horizontal Rule"
$content .='<HR />';
// $content .= '<a id="advanced_search" href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
// Optional silver.gif, used by Zencart in many places
// $content .= zen_draw_separator('pixel_silver.gif') . '<br />';
?>