Thread: Price Range

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price Range

    On the links in the sidebox you made ... if there is a cPath known, then it will filter that way ...

    Click on a Category so you have a listing ...

    Now click on one of your price links with the categories_id= $_GET['cPath']

    You should stay in that category and filter those products that you are looking at with that price range ...
    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!

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

    Default Re: Price Range

    It jumps right to

    Advanced Search?

    "There is no product that matches the search criteria."


    Maybe my code is in the wrong place??
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    I'm right at the door dude.

    I see it's picking up the categories, I see it's picking up the 'cPath' (PATH - cpath 3 - get $current $current , see screenshot) though I believe it's in the wrong spot. Obviously it shouldn't render on screen.

    When I click a price in "Price By Range" it seems to go to "Advanced Search" which you can see with the screenshot I provided is right underneath (1000.00+).
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	1-5-2009 10-21-45 AM.png 
Views:	263 
Size:	81.4 KB 
ID:	5112   Click image for larger version. 

Name:	1-5-2009 10-30-07 AM.png 
Views:	230 
Size:	12.6 KB 
ID:	5113  
    Last edited by RobertR; 5 Jan 2009 at 04:31 PM. Reason: Added another screenshot
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    Quote Originally Posted by Ajeh View Post
    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?
    Maybe here below where I went wrong?


    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?



    What do I do exactly?

    Thanks!!
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    You currently can navigate between the Categories ... and this gives the Product Listing ...

    But, you have a lot of Products and Customers may want to see what in the current Category is in one of the price ranges in the sidebox ...

    If you include the:
    &categories_id = $_GET['cPath']

    in the URL then they will see that filtered price range for the current Category in the Listing ...

    Where you might run into a problem is that now the $_GET['cPath'] isn't available after that first click ...

    If they try to click another price range, it will filter all Products ...

    So, you need to adapt this code to work all of the time by tracking when to use the right paramaters ...

    I would literally have to sit down and write all of this to make the links always capable of working right when navigating between the Categories on the Product Listing and allowing for 1 to many times of picking the price range ...

    If you try this a few times with what you have, you will see where you lose the relationship of the current category and current price filter with a new price filter on the same category ...

    This is the spot where doing some custom coding would be of help to keep things easy on the customer ...
    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!

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

    Default Re: Price Range

    I keep seeing this on the screen

    PATH 2 - cpath - get $current $current
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    Can you at least tell me if I have this code in the right place?

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


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

    ?>
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    It looks like it would work if I were on a Product Listing for a category and wanted to see a filtered list of products ...

    What will not work is if I try to filter the same Product List a second time as there won't be a cPath available to set the list from ...

    This is where something like a price filter can take some work to build ...

    It needs to work the first time it is used as well as the second time it is used ...

    So right now, I think it will work the first time to filter a Product Listing by a price range, it will not be able to be used twice in a row and will always need a fresh Product Listing made ...

    Try it out and see how it works for you ...
    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!

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

    Default Re: Price Range

    The ########## changed his mind again. He thinks the Best Buy website was written in a week? LOL!

    Would this be easier Ajeh? See screenshots. Please help. If I don't conquer (make progress today with this) this for lack of a better phrase I'm done (fired).

    Within the categories dropdown only the prices associated with the chosen item show. For example you'd never have $20.00 - $30.00 for a can of Pepsi. For a can of Pepsi it could be $0.50 - $5.00 per say.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	1-6-2009 12-00-11 PM.png 
Views:	209 
Size:	1.7 KB 
ID:	5125   Click image for larger version. 

Name:	1-6-2009 12-01-03 PM.png 
Views:	225 
Size:	2.1 KB 
ID:	5126  
    [FONT="Book Antiqua"]Ajeh is the best!![/FONT]

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

    Default Re: Price Range

    This gets complicated with the number of products in each range and filtering high/low ... to only show relevant price ranges ...

    It all can be done ... but I would really have to sit down and write it to make it all work ...
    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!

 

 
Page 2 of 4 FirstFirst 1234 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