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_LINKS, zen_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_LINKS, zen_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.
Bookmarks