Thread: "View All" link

Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 46
  1. #31
    Join Date
    Apr 2008
    Location
    NYC
    Posts
    4
    Plugin Contributions
    0

    Have a Drink Re: "View All" link

    Quote Originally Posted by triplexxx View Post
    hi

    iZilla_Pod how to hide the link "show all" when is only one page??

    I came up with a pretty easy solution to this. Simply change the following lines to hide the "show all" link from listings that fit on a single page.

    Change the code on around line 108 FROM:
    Code:
        if (!$this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>&nbsp;&nbsp;';
        else $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>&nbsp;&nbsp;';
    TO:
    PHP Code:
          if ((!$this->page_all) && ($this->number_of_pages 1)) $display_links_string .= '<a href="' zen_href_link($_GET['main_page'], $parameters $this->page_name '=' 'all'$request_type) . '" title=" ' SHOW_ALL_TITLE ' ">' SHOW_ALL_BUTTON '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
          elseif (
    $this->page_all$display_links_string .= '<a href="' zen_href_link($_GET['main_page'], $parameters$request_type) . '" title=" ' SHOW_PAGEVIEW_TITLE ' ">' SHOW_PAGEVIEW_BUTTON '</a>&nbsp;&nbsp;'
    Hope this helps!

    Dan - co-owner, SugarHill Works

  2. #32
    Join Date
    Jun 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: "View All" link

    I made the changes to the split_page_results.php and it worked great except for when I had a category with only one product in it, then nothing showed up on the page. No error, just an url with a blank page. Any advice? Thanks.

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

    Default Re: "View All" link

    You might get the Debug Tool from the Free Software Add Ons and load that to your site to see if it lists the problem 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: v1.5.5]
    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. #34
    Join Date
    Feb 2008
    Posts
    41
    Plugin Contributions
    0

    Default Re: "View All" link

    Is there a way to exclude specific categories? I have a couple of "All ____" categories that have way too many items to show on one page.

    JJd

  5. #35
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: "View All" link

    This works fine until you go to new products and featured products and click on all products.

    The link for the pages are

    index.php?main_page=products_new&disp_order=6&page=all

    and

    index.php?main_page=featured_products&disp_order=1&page=all

    but both display the following error message

    1065 Query was empty
    in:
    []

    Any ideas how to fix this?

  6. #36
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: "View All" link

    Has anyone else had the same problems?

  7. #37
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: "View All" link

    I sorted it!!

    If you find the code that was added from "sugarhill" post

    Code:
     if ((!$this->page_all) && ($this->number_of_pages > 1)) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
          elseif ($this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>&nbsp;&nbsp;';
    and replace it with

    Code:
    if ((!$this->page_all) && ($this->number_of_pages > 1) && ($_GET['main_page'] != 'products_all') && ($_GET['main_page'] != 'featured_products') && ($_GET['main_page'] != 'specials') && ($_GET['main_page'] != 'products_new')) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
          elseif ($this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>&nbsp;&nbsp;';
    This will stop the SHOW ALL button displaying on the following pages

    • products_all
    • featured_products
    • specials
    • products_new

  8. #38
    Join Date
    Sep 2010
    Posts
    129
    Plugin Contributions
    0

    Default Solution to combine single format product listings with view all link but exclude it

    Im absolutely dead tired and smashed! Ive been up all nite trying to figure out how to combine Ajeh's solution from page 1&2 of this thread

    (all the other solutions on this thread are WAY too buggy trust me)

    with Yellow1912 thread

    (http://www.zen-cart.com/forum/showth...single+display)

    about how to make your whole zen cart use 1 uniform way to display products which frankly is columnar to most of us. (who uses never ending lists of products cmon Zen Gods get with the 21st century! this should be out the box...)

    His solution basically (theres nothing basic about it to a programming dummy like me) "copies" the product listing template files into the new, featured, all, special etc etc template files so that once you got your product listing file configured into columnar display with this module

    http://www.zen-cart.com/index.php?ma...products_id=77

    All the other product pages would follow suit and the formatting would be uniform.

    PROBLEM IS that EVERYTHING else would also be the same!! So in this case how do you suppose I would switch off the "view all button"? I want it in my product listings but not in New or ALL products etc listings.

    For starters who wants a "view all" on their ALL PRODUCTS page, I mean if you got thousands+ items thats just insane...

    Anyway the View All button would display correctly on all pages inc NEW etc but when I click it it would throw me to the homepage.. This is because Ajeh's code is specifically for the product listing page and calls up the category path 'cPath=' which doesnt exist for the other product listings hence it would never work anyway so I had to remove it from those listings.

    Cut a long story short to EXCLUDE the "view all" button/link but leave all the other good things on the page like LIMELITES "dropdown page sorter" and the ability to choose how many products to display on the fly (that part still isnt working for me...)
    http://www.zen-cart.com/forum/showthread.php?t=37658

    REPLACE Ajeh's code

    PHP Code:

    <?php if ( ($listing_split->number_of_rows 0)  && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) )  { 
    ?>

    <div> 
    <?php 
      
    if ($_GET['override'] == 'more') { 
        
    // Split pages or comment out to not show link when already showing all 
        
    echo ($listing_split->number_of_rows MAX_DISPLAY_PRODUCTS_LISTING '<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $_GET['cPath']) . '">' 'PRODUCT_LISTINGS_SHOW_SPLIT_PAGES_PRODUCTS' '</a>' ''); 
      } else { 
        
    // only show link if more than one page 
        
    echo ($listing_split->number_of_rows MAX_DISPLAY_PRODUCTS_LISTING '<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $_GET['cPath'] . '&override=more') . '">' 'PRODUCT_LISTINGS_SHOW_ALL_PRODUCTS' '</a>' ''); 
      } 
    ?> 
    </div> 

    <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 

    ?>
    WITH


    PHP Code:
    <?php if ( ($listing_split->number_of_rows 0)  && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) )  { 
    ?> 


    <div>

    <?php if ( ($_GET['main_page'] != 'products_all') && ($_GET['main_page'] != 'featured_products') && ($_GET['main_page'] != 'specials') && ($_GET['main_page'] != 'products_new') ){ ?>


    <div> 
    <?php 
         
    if ($_GET['override'] == 'more') { 
               
             
    // Split pages or comment out to not show link when already showing all 
             
    echo ($listing_split->number_of_rows MAX_DISPLAY_PRODUCTS_LISTING '<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $_GET['cPath']) . '">' .   zen_image_submit (BUTTON_IMAGE_VIEW_SPLIT'View a few items per page') . '</a>' ''); 
      } else { 
        
    // only show link if more than one page 
        
    echo ($listing_split->number_of_rows MAX_DISPLAY_PRODUCTS_LISTING '<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $_GET['cPath'] . '&override=more') . '">' zen_image_submit (BUTTON_IMAGE_VIEW_ALL'View all Items in Category') . '</a>' ''); 
        } 
    ?> 



    </div> 

    <?php 

    ?>

    </div>

    <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 

    ?>
    Seems simple huh... took me forever...

    Look I'm so sorry about the crappy English and the unprofessional presentation but I really hope the point is clear and that someone else might also benefit from this without having a sleepless night.

    If you want to see my results go to www.majesticsilver.co.uk

    Im off to bed or PHP hospital or whatever.

  9. #39
    Join Date
    Feb 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: "View All" link

    Hi, Sorry but i am sort of noob! can't follow what was done, if it is not difficult for you, can you please describe steps 1.2.3... what must i do first and what files to edit in order to implement this idea. Like a final topic which will make everything clear about.
    Thank you very much in advance.

  10. #40
    Join Date
    May 2008
    Location
    Virginia Beach, Virginia, United States
    Posts
    52
    Plugin Contributions
    0

    Default Re: "View All" link

    Is there a way to make the default show all with the choice of picking show 10 per page?

    I think it's a bad idea to do it this way. But my client insists. I think it's going to be bad for loading time. But there isn't much more I can say against it. Her mind is set.

    I tried changing in split_page_results.php
    if ($debug) {
    echo 'original_query=' . $query . '<br /><br />';
    }
    if (isset($_GET[$page_holder])) {
    $page = $_GET[$page_holder];
    } elseif (isset($_POST[$page_holder])) {
    $page = $_POST[$page_holder];
    } else {
    $page = '';
    }

    to
    if ($debug) {
    echo 'original_query=' . $query . '<br /><br />';
    }
    if (isset($_GET[$page_holder])) {
    $page = $_GET[$page_holder];
    } elseif (isset($_POST[$page_holder])) {
    $page = $_POST[$page_holder];
    } else {
    $page = 'all';
    }


    but then the show 10 link no longer works.

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. View "All Products" and "New Products" in columns?
    By cchan in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 24 Feb 2011, 01:58 AM
  2. How to get a "View All" link per category?
    By cchan in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 Feb 2011, 06:15 PM
  3. How to remove "contact us", "My account" , and "view cart"?
    By thestampnomad in forum Basic Configuration
    Replies: 2
    Last Post: 13 Aug 2010, 07:55 PM
  4. Comment out "Check for Updates" Button, "Support Site" Link, & "Version" Link?
    By g00glethis1 in forum Customization from the Admin
    Replies: 4
    Last Post: 15 Mar 2010, 06:32 AM

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