Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2016
    Location
    Georgia USA
    Posts
    31
    Plugin Contributions
    0

    Default Remove the sort by item name / price from the product listing

    i want to remove the "Item Name / Price" sort navbar from the products listing page. Where is it? I've been searching for a few hours now and can't find it. i'm using the responsive classic template with no real enhancements.

    appalachianaudio.com

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,402
    Plugin Contributions
    2

    Default Re: Remove the sort by item name / price from the product listing

    there are a number of ways to do it. each would have it's own benefits.

    i am not sure if there is a configuration setting to turn it off. if there is one, that would ideally be the easiest.

    another way would be to remove it using jquery. this would remove the element after loading and it would only work when your users are using a modern browser that supports javascript. you could create a file here:

    includes/templates/AppAudio_Responsive/jscript/jscript_custom.js

    with the following contents:

    Code:
    $(function() {
      $("div").remove(".productListing-rowheading");
    });
    alternatively, you can change the code. it looks like this bit of code is created here:

    includes/templates/template_default/common/tpl_tabular_display.php

    i would copy that file to:

    includes/templates/AppAudio_Responsive/common/tpl_tabular_display.php

    and i "think" if you change the following line (~line 23) it should work:

    Code:
    // from
      for($row=0; $row<sizeof($list_box_contents); $row++) {
    // to
      for($row=1; $row<sizeof($list_box_contents); $row++) {
    let us know how that works.

    good luck!
    no good deed goes unpunished. help out with the green....

  3. #3
    Join Date
    Aug 2016
    Location
    Georgia USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Remove the sort by item name / price from the product listing

    I found it... i think.... still testing to find out if i blew away anything else. not real clean but it appears to work.... so far.

    i modified /includes/modules/CUSTOM/product_listing.php by commenting out the case statement and the sort setup

    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    $show_submit = zen_run_normal();
    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
    $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
    $how_many = 0;

    $list_box_contents[0] = array('params' => 'class="productListing-rowheading"');

    $zc_col_count_description = 0;
    $lc_align = '';
    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
    switch ($column_list[$col]) {

    /* case 'PRODUCT_LIST_MODEL':
    $lc_text = TABLE_HEADING_MODEL;
    $lc_align = '';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_NAME':
    $lc_text = TABLE_HEADING_PRODUCTS;
    $lc_align = '';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $lc_text = TABLE_HEADING_MANUFACTURER;
    $lc_align = '';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_PRICE':
    $lc_text = TABLE_HEADING_PRICE;
    $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_QUANTITY':
    $lc_text = TABLE_HEADING_QUANTITY;
    $lc_align = 'right';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_WEIGHT':
    $lc_text = TABLE_HEADING_WEIGHT;
    $lc_align = 'right';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_IMAGE':
    $lc_text = TABLE_HEADING_IMAGE;
    $lc_align = 'center';
    $zc_col_count_description++;
    break;
    */

    }

    /* if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
    $lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
    }
    */

  4. #4
    Join Date
    Jul 2012
    Posts
    14,567
    Plugin Contributions
    17

    Default Re: Remove the sort by item name / price from the product listing

    Umm, there's an admin switch in the configuration section of the product listing area: admin/configuration.php?gID=8&cID=230 in a default install that is to disable/not display the filter. Then there are a few other settings to completely disable the filter, for example there's the display Category/Manufacturer Filter in the same product listing area: admin/configuration.php?gID=8&cID=222

    It appears that if both of those are off, then there will not be a filter presented on the product listing page(s). No code edits or need to remember why something doesn't work/isn't available and upgrades are A LOT easier...

    As to areas affected by the above edit, it looks like the advanced search could be impacted.
    Last edited by mc12345678; 4 Apr 2017 at 01:48 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  5. #5
    Join Date
    Aug 2016
    Location
    Georgia USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: Remove the sort by item name / price from the product listing

    OK, so that was a bad idea. i knew about the sorter and had it off but what i want to turn off is the sort buttons "Item Name" & "Price" that has text between the two "Product Image". i don't mind the two active buttons but the text in the middle just looks bad.

    Now I've introduced a new bug, on tablets and mobile devices when i drill down to an individual item it gives me the site map and not the item level?? it's only on mobile/tablet devices and I've not made changes to my configure files.

  6. #6
    Join Date
    Jul 2012
    Posts
    14,567
    Plugin Contributions
    17

    Default Re: Remove the sort by item name / price from the product listing

    Quote Originally Posted by ColtSAA View Post
    OK, so that was a bad idea. i knew about the sorter and had it off but what i want to turn off is the sort buttons "Item Name" & "Price" that has text between the two "Product Image". i don't mind the two active buttons but the text in the middle just looks bad.

    Now I've introduced a new bug, on tablets and mobile devices when i drill down to an individual item it gives me the site map and not the item level?? it's only on mobile/tablet devices and I've not made changes to my configure files.
    Maybe instead of completely commenting out
    Code:
    switch ($column_list[$col]) {
        case 'PRODUCT_LIST_MODEL':
        $lc_text = TABLE_HEADING_MODEL;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_NAME':
        $lc_text = TABLE_HEADING_PRODUCTS;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_text = TABLE_HEADING_MANUFACTURER;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_PRICE':
        $lc_text = TABLE_HEADING_PRICE;
        $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_QUANTITY':
        $lc_text = TABLE_HEADING_QUANTITY;
        $lc_align = 'right';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_WEIGHT':
        $lc_text = TABLE_HEADING_WEIGHT;
        $lc_align = 'right';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_IMAGE':
        $lc_text = TABLE_HEADING_IMAGE;
        $lc_align = 'center';
        $zc_col_count_description++;
        break;
      }
    
      if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
        $lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
      }
    What if you just assigned $lc_text = ''; for each of those? Or another thought is if a different sequence of names would be better suited, or a shortened "word" where you could modify the define for each of the applicable words? Can't exactly identify why selecting a product from a product listing would try to take the visitor to say the "not found" location of the sitemap, but that modification certainly affects things. What other modifications have been made since/during the last time that you were navigating the site? Sometimes/some changes won't appear until the session is cleared/renewed.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  7. #7
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    292
    Plugin Contributions
    0

    Default Re: Remove the sort by item name / price from the product listing

    Quote Originally Posted by mc12345678 View Post
    Maybe instead of completely commenting out
    Code:
    switch ($column_list[$col]) {
        case 'PRODUCT_LIST_MODEL':
        $lc_text = TABLE_HEADING_MODEL;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_NAME':
        $lc_text = TABLE_HEADING_PRODUCTS;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_text = TABLE_HEADING_MANUFACTURER;
        $lc_align = '';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_PRICE':
        $lc_text = TABLE_HEADING_PRICE;
        $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_QUANTITY':
        $lc_text = TABLE_HEADING_QUANTITY;
        $lc_align = 'right';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_WEIGHT':
        $lc_text = TABLE_HEADING_WEIGHT;
        $lc_align = 'right';
        $zc_col_count_description++;
        break;
        case 'PRODUCT_LIST_IMAGE':
        $lc_text = TABLE_HEADING_IMAGE;
        $lc_align = 'center';
        $zc_col_count_description++;
        break;
      }
    
      if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
        $lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
      }
    What if you just assigned $lc_text = ''; for each of those? Or another thought is if a different sequence of names would be better suited, or a shortened "word" where you could modify the define for each of the applicable words? Can't exactly identify why selecting a product from a product listing would try to take the visitor to say the "not found" location of the sitemap, but that modification certainly affects things. What other modifications have been made since/during the last time that you were navigating the site? Sometimes/some changes won't appear until the session is cleared/renewed.
    PHP 7.2
    ZC 1.5.6 responsive_classic
    New install with the latest EP4 plugin.
    Alpha Sorter turned OFF

    ZC 1.3.9 thru 1.5.5f never had the "Product Image Item Name- Price " sorter show up.
    Now on ZC 1.5.6 it suddenly pops up. Does anyone know what triggers that setting or is this the new default setting. (Possible oversite?)
    I can see where it is a desirable feature for some sites but not everyone want's it
    Surprised that there is not an Admin setting available to turn that feature off without hacking the code.
    Without an Admin setting what's the best way to not display/turn it off?

    Spent a several hours researching and experimenting including 3 different (older) posts on hacking the code but none of them seem stable.

    Any information/update would be greatly appreciated.

  8. #8
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    292
    Plugin Contributions
    0

    Default Re: Remove the sort by item name / price from the product listing

    Quote Originally Posted by linuxguy2 View Post
    PHP 7.2
    ZC 1.5.6 responsive_classic
    New install with the latest EP4 plugin.
    Alpha Sorter turned OFF

    ZC 1.3.9 thru 1.5.5f never had the "Product Image Item Name- Price " sorter show up.
    Now on ZC 1.5.6 it suddenly pops up. Does anyone know what triggers that setting or is this the new default setting. (Possible oversite?)
    I can see where it is a desirable feature for some sites but not everyone want's it
    Surprised that there is not an Admin setting available to turn that feature off without hacking the code.
    Without an Admin setting what's the best way to not display/turn it off?

    Spent a several hours researching and experimenting including 3 different (older) posts on hacking the code but none of them seem stable.

    Any information/update would be greatly appreciated.

    Figure the best way to not display the "includes/templates/responsive_classic/css/stylesheet.css" feature is to turn it off in CSS

    includes/templates/responsive_classic/css/stylesheet.css
    Search on productListing-rowheading and around line 900 Add display: none;
    Code:
    .productListing-rowheading {
    	padding:10px 10px;
    	text-align:center;
    	display:none; /* Prevent display of Product Image Item Name- Price sorter */
    }
    NOTE:
    Depending on your device may have to repeat in mobile and tablet css

  9. #9
    Join Date
    Jul 2019
    Location
    Occitanie
    Posts
    1
    Plugin Contributions
    0

    Default Re: Remove the sort by item name / price from the product listing

    Quote Originally Posted by linuxguy2 View Post
    Figure the best way to not display the "includes/templates/responsive_classic/css/stylesheet.css" feature is to turn it off in CSS
    Impeccable, elegant solution.
    Thank you!

 

 

Similar Threads

  1. Product listing: move the price before the description of the item
    By ilmarchez in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 6 May 2012, 01:02 AM
  2. Replies: 1
    Last Post: 23 Dec 2011, 03:42 PM
  3. Removing the Sort(Top) Row from the Product Listing
    By slee in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 2 Sep 2010, 03:31 PM
  4. Replies: 3
    Last Post: 2 Apr 2007, 10:34 AM
  5. Remove the (-) from Item Name-
    By DiZZ in forum General Questions
    Replies: 2
    Last Post: 9 Feb 2007, 04:41 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