Thread: Price Range

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Join Date
    Dec 2008
    Location
    New Jersey
    Posts
    52
    Plugin Contributions
    0

    Default Price Range

    I hope everyone had a Happy New Year!

    This code (tpl_search.php) isn't working correctly.

    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 />';    

    ?>
    When I click on a price range I'd like it to stay within the current category.

    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!!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    You need to add the: categories_id

    &categories_id = 12

    to the link ...

    This can be built from the: $cPath or $current_categories_id

    NOTE: $cPath will probably be $_GET['cPath'] depending on what you are doing ... $current_categories_id can be used to get the full path to the category ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Dec 2008
    Location
    New Jersey
    Posts
    52
    Plugin Contributions
    0

    Default Re: Price Range

    Thank you very much for your response I appreciate it very much!

    Would you be as so kind to get into more detail? I have an idea on what to do but I want to take the right path since I'm brand new to Zen Cart.

    Thank you.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    In your links you need to add in the:
    &categories_id=XX

    so something like:

    Code:
        $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 />';
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Dec 2008
    Location
    New Jersey
    Posts
    52
    Plugin Contributions
    0

    Default Re: Price Range

    OK so I have to add that line and 4 others :

    $content .= '<a href="' . zen_href_link('advanced_search_result&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_result&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_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 />';



    Earlier you mentioned that categories = 12. I think mine is 11 is this possible? You're probably right it's 12 and I'm wrong.

    Also, do I fill in the 12 or 11 in the line of code or is it system generated?

    Thanks. You're the best!

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    12 was just a stab in the dark ...

    The $_GET['cPath'] should call the current path to the categories_id that you are looking at when the price is selected ...

    You may need to doctor it a bit for other things, but see if that helps ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    Here is a problem ...

    The reference for the categories_id changes depending on how you move around the Catalog ...

    Toss this in the file just to see how these variables move about:
    echo 'PATH ' . $_GET['categories_id'] . ' - cpath ' . $_GET['cPath'] . ' - get $current ' . $_GET['current_categories_id'] . ' $current ' . $current_categories_id . '<br>';


    You can code for which of these is available to use as the:
    '&categories_id=' . $something

    You just need to write something to make the $something correct for more than one click ... easy smeazy, eh?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Dec 2008
    Location
    New Jersey
    Posts
    52
    Plugin Contributions
    0

    Default Re: Price Range

    Here's my code:

    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">';
        
        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 '&categories_id=' $_GET['cPath']) . '">' 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 '&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 />';

        
        
    $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 />';    

    ?>

    And this is what I got my friend:
    Attached Images Attached Images  
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    You have two sets of price ranges ... one with and one without the categories_id in the URL ...

    So that is what you will see in the sidebox ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Dec 2008
    Location
    New Jersey
    Posts
    52
    Plugin Contributions
    0

    Default Re: Price Range

    Yeah I commented that out my friend. I think what I want is the price range search filtering to be fixed with the current category. I explained my self incorrectly. Meaning the boxes up top.
    Attached Images Attached Images  
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. v153 Price Range Mod.
    By wmorris in forum General Questions
    Replies: 1
    Last Post: 25 Sep 2014, 12:13 AM
  2. Price range for price by attributes
    By tigergirl in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Sep 2007, 05:58 PM
  3. sale price range
    By burticusmaximus in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 20 Aug 2007, 05:51 PM
  4. Changing price range to time range (in Advanced Search)
    By jeffmic in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Sep 2006, 07:12 PM
  5. Price Range links??
    By Kevad in forum General Questions
    Replies: 4
    Last Post: 16 Sep 2006, 04:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg