Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 'Sort by' box help needed

    Hello,

    If you look at this page on my site ( http://www.handcrafteduk.com/paganan...31.html?sort=0 ) you will see that I have managed to transfer the 'sorter' code from: /public_html/includes/templates/CUSTOM/templates/tpl_modules_listing_display_order.php

    to: public_html/includes/templates/CUSTOM/templates/tpl_modules_product_listing.php

    This function isn't working on this page though! Whenever I try to use the sort option I keep getting 'SUCCESS_ADDED_TO_CART_PLEASE_CHECKOUT_WHEN_READY' appearing at the top of my screen instead! Is there a way I can change the code to get this sort function to work within categories?

    Any help would be greatly appreciated!

    Thanks,

    Gary

  2. #2
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default Re: 'Sort by' box help needed

    If it helps this is the code I pasted into public_html/includes/templates/CUSTOM/templates/tpl_modules_product_listing.php


    <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('disp_order', $_GET['disp_order']);
    echo zen_hide_session_id();
    ?>
    <select name="disp_order" onchange="this.form.submit();" id="disp-order-sorter">
    <?php if ($disp_order != $disp_order_default) { ?>
    <option value="<?php echo $disp_order_default; ?>" <?php echo ($disp_order == $disp_order_default ? 'selected="selected"' : ''); ?>><?php echo PULL_DOWN_ALL_RESET; ?></option>
    <?php } // reset to store default ?>
    <option value="1" <?php echo ($disp_order == '1' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME; ?></option>
    <option value="2" <?php echo ($disp_order == '2' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME_DESC; ?></option>
    <option value="3" <?php echo ($disp_order == '3' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE; ?></option>
    <option value="4" <?php echo ($disp_order == '4' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE_DESC; ?></option>
    <option value="5" <?php echo ($disp_order == '5' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_MODEL; ?></option>
    <option value="6" <?php echo ($disp_order == '6' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_DATE_DESC; ?></option>
    <option value="7" <?php echo ($disp_order == '7' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_DATE; ?></option>
    </select></form></div>



    I hope someone can give me an idea of where I need to be changing the code as I have no idea! Any help would be appreciated....No matter how small!

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

    Default Re: 'Sort by' box help needed

    Putting in code for sorting and having other code respond to the results is two different things ...

    What are you ideally trying to accomplish?
    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!

  4. #4
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default Re: 'Sort by' box help needed

    Hello Linda,

    Thanks for the reply. Ok what I'm trying to accomplish is;

    In the crystal balls category (which I posted the link to above) when one of the 'sort by' options is selected then it will automatically sort the items in the crystal balls category into the selected order.

    Hope that made sense!!

    Gary

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

    Default Re: 'Sort by' box help needed

    I see ... well got a problem in that the Products Listing does not work in the same manner as the New Listing, Featured Listing and All Listing ... which is what that code is for ...

    It would require quite a bit to customise it as you have a customized file for the listing, and are not using the fields in the same manner as the code for the original method of sorting ...

    The original method was based on the menu bar just above the Product Listing where you could click on the header name of a column ...

    This would generate a reference to the sort order based on a variable that matched your selected fields and the order that they were set to display ...

    Now you do not have that listing nor the header or anything related to the original display and are trying to make code work that was not designed to do this ...

    It could be done ... but I would probably end up having to write it to explain it all ...
    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!

 

 

Similar Threads

  1. v139h Sort order help needed
    By jgold723 in forum General Questions
    Replies: 11
    Last Post: 22 Feb 2013, 07:25 PM
  2. Help needed to implement a search box
    By niffy in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 29 Jun 2009, 03:56 PM
  3. Layout box help needed
    By arcanesanctuary in forum General Questions
    Replies: 5
    Last Post: 24 Dec 2006, 03:43 AM
  4. Help Needed-Dividers in Categories Box
    By John-E in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Sep 2006, 07:41 AM

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