Page 3 of 11 FirstFirst 12345 ... LastLast
Results 21 to 30 of 101
  1. #21
    Join Date
    Oct 2005
    Posts
    97
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Quote Originally Posted by manada View Post
    OK, i just look on this problem closely. I think we could go around like this:

    At the beggining of tpl_modules_product_listing.php I entered as follow:

    For ascending sorting link

    Code:
    echo '<a href="' . zen_href_link(FILENAME_DEFAULT , "cPath=$cPath") . "&sort=2a" . '">' . "Sort By Price (Asc)" . '</a><br>';
    For descending sort. link;

    Code:
    echo '<a href="' . zen_href_link(FILENAME_DEFAULT , "cPath=$cPath") . "&sort=2d" . '">' . "Sort By Price (Asc)" . '</a><br>';
    I know , its a little bit "off-zen" but it works.

    Adam
    Hmm. I tried this, but it doesn't actually sort the products as intended. It seems almost random. I wonder if I need to have the product listing settings set to something in particular to get it to work?

    http://craftsbury.lbdclients.com/ind...dex&cPath=4_12

  2. #22
    Join Date
    Oct 2005
    Posts
    97
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Yay, I got it working! It was, in fact, that I didn't have my listing settings the same. I had the price set to 3 and not 2, so when I changed the code to 3a and 3b, that fixed it. =) Just in case that's helpful to someone else!

  3. #23
    Join Date
    Dec 2005
    Posts
    34
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Yup, you right. Forgot to mentioned about price desc/asc code.
    :-)

  4. #24
    Join Date
    Oct 2005
    Posts
    97
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Oh, almost forgot. Both links specify that they're for "(asc)", so you have to change the second to (desc) when you implement the code. FYI!

    Thanks so much, manada, for posting that code, by the way. It's super helpful. =)

  5. #25
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Sort by price with column display....

    To have a drop down box sorter:

    In includes/templates/YOUR_CURRENT_TEMPLATE
    Add a file called tpl_modules_additional_listing_display_order.php (actually you can call it however you want) with this content

    PHP Code:
    <?php
    /**
     * Module Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 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_additional_listing_display_order.php 3369 2006-04-03 23:09:13Z drbyte $
     */
    ?>
    <?php
    // NOTE: to remove a sort order option add an HTML comment around the option to be removed
    ?>

    <div id="sorter">
    <label for="disp-order-sorter"><?php echo TEXT_INFO_SORT_BY?></label>
    <?php
      
    echo zen_draw_form('sorter_form'zen_href_link($_GET['main_page']), 'get');
      echo 
    zen_draw_hidden_field('main_page'$_GET['main_page']);
      echo 
    zen_draw_hidden_field('cPath'$cPath);
      
    // draw cPath if known
      
    if (!$getoption_set)
        echo 
    zen_draw_hidden_field('cPath'$cPath);
      echo 
    zen_hide_session_id();
    ?>
        <select name="sort" onchange="this.form.submit();" id="disp-order-sorter">
    <?php if ($_GET['sort'] != PRODUCT_LISTING_DEFAULT_SORT_ORDER) { ?>
        <option value="<?php echo PRODUCT_LISTING_DEFAULT_SORT_ORDER?><?php echo ($_GET['sort'] == PRODUCT_LISTING_DEFAULT_SORT_ORDER 'selected="selected"' ''); ?>><?php echo PULL_DOWN_ALL_RESET?></option>
    <?php // reset to store default ?>
        <option value="1a" <?php echo ($_GET['sort'] == '1a' 'selected="selected"' ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME?></option>
        <option value="1d" <?php echo ($_GET['sort'] == '1d' 'selected="selected"' ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME_DESC?></option>
        <option value="3a" <?php echo ($_GET['sort'] == '3a' 'selected="selected"' ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE?></option>
        <option value="3d" <?php echo ($_GET['sort'] == '3d' 'selected="selected"' ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE_DESC?></option>
        </select></form></div>
    Then in the file tpl_index_product_list.php in the same folder, edit to add this line:
    PHP Code:
    require($template->get_template_dir('/tpl_modules_additional_listing_display_order.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_additional_listing_display_order.php'); 
    You can add it wherever you want to dispkay the sorter, for me I added it right above this line:
    PHP Code:
     require($template->get_template_dir('tpl_modules_product_listing.php'DIR_WS_TEMPLATE$current_page_base,'templates'). '/' 'tpl_modules_product_listing.php'); 


    Good luck
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #26
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Yellow,

    Thanks so much for this. I seem to be having a problem that others do too. The sorts seem to be random. I've tried it with columns and rows. both the same.

    ie. prices low > high - doesn't actually sort them in order. just seems to mix them up.

    same with all others except product names

    any ideas?

    thanks again...

  7. #27
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Sort by price with column display....

    Quote Originally Posted by pensive612 View Post
    Yellow,

    Thanks so much for this. I seem to be having a problem that others do too. The sorts seem to be random. I've tried it with columns and rows. both the same.

    ie. prices low > high - doesn't actually sort them in order. just seems to mix them up.

    same with all others except product names

    any ideas?

    thanks again...
    Can you pm me your site?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #28
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Yellow...

    I PM'd you.

    let me know if you have any thoughts on it.

    thanks.

    Adam.

  9. #29
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Sort by price with column display....

    Admin->configuration->product listing->set Display Product Listing Default Sort Order to 1d and then see if the sorting works.

    Minor bug:
    in the file tpl_modules_additional_listing_display_order.php, remove the line
    PHP Code:
    echo zen_draw_hidden_field('cPath'$cPath); 
    There are 2 lines like that in the file, remove the first one
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  10. #30
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Sort by price with column display....

    Thanks for the bugfix.

    I changed it to 1d. and it didn't really seem to change anything.

    but i was never aware of the abcd after the numbers...

    am i maybe missing something somewhere else?

    Display Product Image 1
    Display Product Manufacturer Name 3
    Display Product Model 4
    Display Product Name 2
    Display Product Price/Add to Cart 5
    Display Product Quantity 0
    Display Product Weight 0 Info
    Display Product Price/Add to Cart Column Width 125
    Display Category/Manufacturer Filter (0=off; 1=on) 1
    Prev/Next Split Page Navigation (1-top, 2-bottom, 3-both) 3
    Display Product Listing Default Sort Order 1d
    Display Product Add to Cart Button 1
    Display Multiple Products Qty Box Status and Set Button Location 3
    Display Product Description 0
    Product Listing Ascending Sort Order +
    Product Listing - Layout Style columns
    Product Listing Descending Sort Order -
    Product Listing - Columns Per Row 4
    Include Product Listing Alpha Sorter Dropdown true
    Include Product Listing Sub Categories Image true
    Include Product Listing Top Categories Image true
    Show SubCategories on Main Page while navigating
    thanks again for all the help.

 

 
Page 3 of 11 FirstFirst 12345 ... LastLast

Similar Threads

  1. Change Display price with attribute LARGEST price not lowest
    By bubbadan in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Feb 2020, 05:37 AM
  2. Problems with Sort by Price
    By JohnBoyCR in forum General Questions
    Replies: 32
    Last Post: 29 Nov 2010, 02:59 AM
  3. Column layout grid view - add sort by price
    By mattys in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Sep 2010, 11:41 AM
  4. how to sort products listings with price
    By pavka in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Apr 2008, 08:11 PM
  5. Category view: changing product display column width - image, description, price?
    By azenuser in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 8 Feb 2007, 10:31 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