26 Sep 2013, 3:22 PM
Totally Zenned
- Join Date:
- May 2006
- Location:
- Gardiner, Maine
- Posts:
- 2,383
- Plugin Contributions:
- 7
Show all / view all on new product pages
I have done the show all for the product pages but doing one for the new product pages is quite different since all categories are represented.
Here's the code for the product pages:
if (($_GET['override'] == 'more') && (!$_GET['cPath'])) {
// Split pages or comment out to not show link when already showing all
echo 'path '. $_GET['cPath'];
($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
if ($_GET['cPath'] != ''){
//show all link
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>' : '');
}
(in case anyone is interested) place that in a div to float right after ```php
if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
So no cPath in the new products.
What I've got so far is ```php
if ($_GET['override'] == 'more') {
// Split pages or comment out to not show link when already showing all
//how to show all?
MAX_DISPLAY_PAGE_LINKS == $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW);
} else
if ($products_new_split->number_of_rows > 0){
// only show link if more than one page
echo ($products_new_split->number_of_rows > MAX_DISPLAY_PRODUCTS_LISTING ? '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, '&override=more') . '">' . PRODUCT_LISTINGS_SHOW_ALL_PRODUCTS . '</a>' : '');
}
That doesn't change a thing. Good guess - but no dice. So how do I override the MAX_DISPLAY_PAGE_LINKS in this line to show all?
$products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page')));