-
Re: "View All" link
Hi, I'm trying to implement a "Show All" link on my products page as well, and have followed these instructions as best I could. I am recieving the following error:
Parse error: syntax error, unexpected T_STRING in /includes/modules/mytemplate/product_listing.php on line 20
This is what I put in my extra defines file, I wasn't sure if I had that quite right.
Code:
<?php
//
// Custom Define added by me to allow "Show All" Option to products page.
//
DEFINE('PRODUCT_LISTINGS_SHOW_ALL_PRODUCTS', 'Show All');
?>
The rest I copied and pasted from Ajeh's code on this thread, and put in the appropriate ovveride folders on my server. What am I missing?
-
Re: "View All" link
Creative,
You know, I actually got stopped at the same problem.
I tried that (and got the same error) and everywhere else I could think of.
Could not get the defines to show without an error.
Definitely a question for Ajeh.
I'd love to know too...
sorry, wish i could be more help.
-
Re: "View All" link
Do you have the closing ?> at the end of the code?
-
Re: "View All" link
I've triple checked all the code, and as far as I can tell, I have everything exactly as described. Any More thoughts?
Using 1.3.0.1
php 4.4.2
-
Re: "View All" link
Just bumping this up to see if anyone else has any thoughts on this...
-
Re: "View All" link
I will have to go dig up the code again ...
Meanwhile, you might upgrade to v1.3.0.2 as that is the latest release and there are a lot of fixes since v1.3 an v1.3.0.1 ...
-
Re: "View All" link
More than likely ... I did not make the code change clear enough for you:
Lines 24-32 read:
PHP Code:
<?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<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
}
?>
Change these to read:
PHP Code:
<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
}
?>
See if that doesn't correct the error that you are receiving ...
-
Re: "View All" link
I've been trying to tackle this same customization, but without any luck (no surprises there given that I have no idea what I'm doing!). I made the changes to the product_listing.php file as suggested, and all was fine. But, when I went on to make the changes to the tpl_modules_product_listing.php file, I get this error:
Parse error: parse error, unexpected '}' in /home/content/S/y/t/SyteGod/html/includes/templates/superbuzzy/templates/tpl_modules_product_listing.php on line 41
I've upgraded to 1.3.6, so I'm wondering if some of the language has changed since then? Or perhaps it's just that I'm clueless! This feature isn't a necessity for me, but it would be a really nice addition. I'd appreciate any help at all!
-
Re: "View All" link
It should work just fine in 1.36.
If you're getting a parse error, there's something missing in the code. Missing one paranthesis, or anything will make it fail.
Double check that you're copying and pasting the exact text one more time... if it still doesn't work out for you... PM me a copy of the file and i'll code compare it with mine...
hope all is good.
-
Re: "View All" link
Found an error in the coding supplied to change to showall in a category on one page versus multiple pages:
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>' : '');
And that really needs to be
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>' : '');
And the other line...
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>' : '');
Really needs to be
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>' : '');
Otherwise, it doesn't look up the strings to replace with the constants. It thinks the constants are the strings...
Just thought I'd point this out for others who may be searching for this, like I was this morning :)
Thanks!