Thread: "View All" link

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46
  1. #1
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default "View All" link

    hi everyone,

    above the "display items 1-6" link on the top of the product info page... i want to create a link that will display all items in that category on the same page.

    "View All Products"

    allowing the user to scroll down and view all items.

    i'm sure this is possible, just not sure where to start...

    any ideas?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: "View All" link

    If you want this to be a standard way of viewing your site, you can increase the # of products listed in the admin > config > maxium values> find Products Listing- Number Per Page and set to the number that you want. Now each will display the new # that you have specified.

    To custom code this into button would require that you determine what changes that the foregoing makes and use this in your custom code for a button.
    Zen-Venom Get Bitten

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

    Default Re: "View All" link

    You would need to make an override for the max display so that when selected, it would grab everything and not perform the split page ...

    This would take a bit of coding to accomplish, but it can be done ...
    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. #4
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: "View All" link

    thanks guys.

    coffee bought...


    can someone point me to the right file to override?

    i'm thinking, of duplicating and modifying the link for "view products 1-6"


    has anyone already done this? i wish i was better with code than i am.



    thanks again.

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

    Default Re: "View All" link

    This code is simplistic but can work ...

    Usually, when you hit the Product listing ... the URL reads:

    /index.php?main_page=index&cPath=53

    This then processes that Category to work with the Maximum display setting ...

    However ... if you want to override this, you can do so by creating an override of the file:

    /includes/modules/products_listing.php
    If you added a link ... for All to generate the URL:
    /index.php?main_page=index&cPath=53&override=more
    All you need do is edit the products_listing.php to include this IF to control what happens when your link adds that extra paramater ...

    Change the line:
    PHP Code:
      $listing_split = new splitPageResults($listing_sqlMAX_DISPLAY_PRODUCTS_LISTING'p.products_id''page'); 
    To the new IF statement ...

    PHP Code:
    if ($_GET['override'] == 'more') {
      
    $max_display_products_listing_override $db->Execute($listing_sql);
      
    $max_display_products_listing_override $max_display_products_listing_override->RecordCount();
      
    $listing_split = new splitPageResults($listing_sql$max_display_products_listing_override'p.products_id''page');
    } else {
      
    $listing_split = new splitPageResults($listing_sqlMAX_DISPLAY_PRODUCTS_LISTING'p.products_id''page');

    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!

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

    Default Re: "View All" link

    thanks again ajeh... as always, you're the best.


    i will let everyone know how it works out.





    adam.

  7. #7
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: "View All" link

    I really hate to do this, as I appreciate all the help so far...

    i cannot figure out how to create the link in php.

    everything Ajeh said made perfect sense, and i got it all to work perfectly.. (thank you again, Ajeh) created the if and when manually going to the link it all checks out.

    but i need to create the text link. that will say "View All Products" in the product listing page and will link to the 'more - override'

    can someone please either let me know the code, or where i can try and learn it. been working for hours on this one...


    thanks again.

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

    Default Re: "View All" link

    Okay ... last peice of the mystery ...

    Copy the file:
    /includes/templates/templates_default/tpl_modules_product_listing.php

    to your overrides directory ...

    Find around line 24-25 the code:
    PHP Code:
    <?php if ( ($listing_split->number_of_rows 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
    ?>

    Change to read:

    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
    }
    ?>
    Add your defines for the links in your /includes/languages/english/extra_defines ...
    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!

  9. #9
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: "View All" link

    oh, but the last piece of the mystery created one more...

    when i create the define page in my extra definitions folder, how do i tell the link to look at the correct page for the defines?


    i will keep researching relentlessly in the meantime...



    thanks.

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

    Default Re: "View All" link

    That is the Magic of Zen ...

    Just add the defines into a file in the:

    /includes/languages/english/extra_definitions/custom_product_listings_show_all.php

    Or any other name that you will remember ...

    You can associate the name with the code or use something like:

    my_custome_defines.php

    What ever works 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!

 

 
Page 1 of 5 123 ... 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