I hope everyone had a Happy New Year!
This code (tpl_search.php) isn't working correctly.
When I click on a price range I'd like it to stay within the current category.PHP 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_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 />';
?>
For example, if I click $0.00 - $49.99 for a specific category I'd like the $0.00 - $49.99 items of the specific category NOT ALL the $0.00 - $49.99 categories in the store.
Thanks!!





