Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Replacing "Filter Results by ABC" with "Sort by: Price, Date added"

    I have looked into this for a while and cant find an answer on how to replace "Filter Results by ABC" with "Sort by: Price, Date added" in the tpl_modules_product_listing.php. There seems to be no admin controls other than to turn it off.

    In the tpl_modules_products_all_listing.php it has the functionallity I want but it is work to take the tpl_modules_products_all_listing.php [FONT=Verdana]functionality [/FONT]and add it to the tpl_modules_product_listing.php

    tpl_modules_products_all_listing.php

    PHP Code:
    <?php
    require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_listing_display_order.php'); ?>
    ^ adds the box I want, but page still won't sort the items

    I am now looking for what code I need to that from tpl_modules_products_all_listing.php to tpl_modules_product_listing.php to get it to filter the results, I have not looked at the code for long as I dont think I can do it.

    tpl_modules_products_all_listing.php:

    PHP Code:
    <?php
    /**
     * Page Template
     *
     * @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_products_all_default.php 2603 2005-12-19 20:22:08Z wilt $
     */
    ?>
    <div class="centerColumn" id="allProductsDefault">
    <h1 id="allProductsDefaultHeading"><?php echo HEADING_TITLE?></h1>
    <?php
    require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_listing_display_order.php'); ?>
    <br class="clearBoth" />
    <?php
      
    if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART and $show_submit == true and $products_all_split->number_of_rows 0) {
    ?>
    <?php
        
    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
          echo 
    zen_draw_form('multiple_products_cart_quantity'zen_href_link(FILENAME_PRODUCTS_ALLzen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post''enctype="multipart/form-data"');
        }
      }
    ?>
    <?php
      
    if ($show_top_submit_button == true) {
    // only show when there is something to submit
    ?>
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CARTBUTTON_ADD_PRODUCTS_TO_CART_ALT'id="submit1" name="submit1"'); ?></div>
    <?php
      
    // top submit button
    ?>
    <br class="clearBoth" />
    <?php
      
    if (($products_all_split->number_of_rows 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
    ?>
      <div id="allProductsListingTopNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL); ?></div>
      <div id="allProductsListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE ' ' $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''x''y''main_page'))); ?></div>
    <?php
      
    }
    ?>
    <br class="clearBoth" />
    <?php
    /**
     * display the new products
     */
    require($template->get_template_dir('/tpl_modules_products_all_listing.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_products_all_listing.php'); ?>
    <?php
      
    if (($products_all_split->number_of_rows 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
    ?>
      <div id="allProductsListingBottomNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL); ?></div>
      <div id="allProductsListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE ' ' $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''x''y''main_page'))); ?></div>
    <?php
      
    }
    ?>
    <br class="clearBoth" />
    <?php
      
    if ($show_bottom_submit_button == true) {
    // only show when there is something to submit
    ?>
      <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CARTBUTTON_ADD_PRODUCTS_TO_CART_ALT'id="submit2" name="submit1"'); ?></div>
    <?php
      
    }  // bottom submit button
    ?>
    <?php
    // only end form if form is created
        
    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
    ?>
    </form>
    <?php // end if form is made ?>
    </div>

    tpl_modules_product_listing.php:

    PHP Code:
     
    <?php
    /**
     * Module Template
     *
     * @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_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $
     */
     
    include(DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCT_LISTING));
    ?>
    <div id="productListing">
    <?php
    // only show when there is something to submit and enabled
        
    if ($show_top_submit_button == true) {
    ?>
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CARTBUTTON_ADD_PRODUCTS_TO_CART_ALT'id="submit1" name="submit1"'); ?></div>
    <br class="clearBoth" />
    <?php
        
    // show top submit
    ?>
    <?php 
    if ( ($listing_split->number_of_rows 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
    ?>
    <div id="productsListingTopNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>
    <div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE ' ' $listing_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''x''y''main_page'))); ?></div>
    <br class="clearBoth" />
    <?php
    }
    ?>
    <?php
    /**
     * load the list_box_content template to display the products
     */
      
    require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_tabular_display.php');
    ?>
    <?php 
    if ( ($listing_split->number_of_rows 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
    ?>
    <div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>
    <div  id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE ' ' $listing_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''x''y'))); ?></div>
    <br class="clearBoth" />
    <?php
      
    }
    ?>
    <?php
    // only show when there is something to submit and enabled
        
    if ($show_bottom_submit_button == true) {
    ?>
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CARTBUTTON_ADD_PRODUCTS_TO_CART_ALT'id="submit2" name="submit1"'); ?></div>
    <br class="clearBoth" />
    <?php
        
    // show_bottom_submit_button
    ?>
    </div>
    <?php
    // if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) {
      
    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
    ?>
    </form>
    <?php ?>

  2. #2
    Join Date
    Apr 2009
    Posts
    35
    Plugin Contributions
    0

    Default Re: Replacing "Filter Results by ABC" with "Sort by: Price, Date added"

    im looking for this as well!
    is the one you changed working or not?
    my zencart got so many items, its really need a filter. but not by ABCD....

  3. #3
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Replacing "Filter Results by ABC" with "Sort by: Price, Date added"

    [FONT=Verdana]no not working[/FONT]

    [FONT=Verdana]the titles above the item lists e.g. title, price, etc. you can click on to sort by price, etc. I just removed the "alpha drop down" from the settings in the admin > configuration > product listing (I think) becuase it looks unprofessional. [/FONT]

    [FONT=Verdana]Perhaps you can put the text "sort by on the left of the titles. I believe they are coming out with zencart 2.0 sometime in the future so I dont have time to look into this as I dont know what the new version will be like.[/FONT]

    [FONT=Verdana]Also the ALL PRODUCTS Page has this option; so you could [FONT=Verdana]create [/FONT]some link somewhere call Sort by price and link it to the all products page set to sort by price.
    E.g. http://www.galaxybeads.com.au/index.php?main_page=products_all&disp_order=3
    [/FONT]

  4. #4
    Join Date
    Jul 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Replacing "Filter Results by ABC" with "Sort by: Price, Date added"

    Giving this a bump because I'm having the same issue. My client wants a dropdown on the product listing page that's like the one on the All Products page. I find it hard to believe that Zen Cart doesn't have a 'sort by price' feature built in... am I missing something?

    I tried the extension that also lists attributes, but it gives a price range rather than simply sorting by price, in sequence. Also, this site uses items priced by attributes, so it needs to give the lowest (or highest) base price first.

  5. #5
    Join Date
    Jul 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Replacing "Filter Results by ABC" with "Sort by: Price, Date added"

    Actually, I just found the solution:
    http://www.zen-cart.com/index.php?ma...oducts_id=1559

 

 

Similar Threads

  1. Replies: 5
    Last Post: 19 Mar 2013, 03:54 PM
  2. "'Filter Results by age"and'Filter Results by price range"
    By soso838 in forum General Questions
    Replies: 3
    Last Post: 5 Jul 2012, 06:49 PM
  3. Products "filter by" change to "sort by"
    By yamadan in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 2 Jun 2010, 12:07 AM
  4. "Filter Results by:" and "Displaying 1 to 3 (of 3 products)"
    By kateandpooch in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Oct 2009, 04:02 PM
  5. Want to change global sort default to "by date added"
    By ejhernandez in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 12 Oct 2006, 08:27 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR