kid,
what version of zen are you using? where did you replace the $max_results= ??
kid,
what version of zen are you using? where did you replace the $max_results= ??
Small point:
elseif($step = 'All') {
should be
elseif($step == 'All') {
And really, the logic seems odd...
If $step is '6', neither part will be executed, and if $step is 'All", it will not be '6' and only the first part will be executed. The second part can never be executed.
Last edited by gjh42; 18 Nov 2010 at 03:32 AM.
Hi Guys
We are using v1.3.9h
The max display comes from:
includes/functions/extra_functions/max_display.php
It is the same kind of module as http://www.zen-cart.com/index.php?ma...roducts_id=716
Thanks for your help
in my includes/functions/extra_functions/ i do not have a max_display.php file. is that where you input the $max_results line? the instructions say to edit /includes/modules/YOUR_TEMPLATE/product_listing.php am I missing something/don't know how to read? let me know.
Thanks
Sorry, I am using an older version of this module, all thats different is the name of the files. The file in the new version is named set_num_products.php. both the new and old module use $max_display
the original code that came with the module is below:
and I am trying to turn the links into images with the following code:Code:$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'">'.$step.'</a> ';
but my intention with this is:Code:if($step != '6') { $result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show All Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_showall.png" width="150" height="20" alt="Show All Products" /></a> '; } elseif($step = 'All') { $result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show 6 Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_show6.png" width="150" height="20" alt="Show 6 Products" /></a> '; } }
1. When you arrive on the page, it is displayed as 6 prods per page and only the "Show All" button is displayed plus the page navigation i.e. 1 2 3 4 [Next >>]
2. If the visitor clicks "Show All" the Image for "Show 6" is displayed
3. If the Visitor is in "Show All" Mode, then the "Show 6" Button will display
But I'm stuck. Any help much appreciated.
I understand that you are trying to put images instead of the text but how did you get it to work? how did you complete this step
Edit /includes/modules/YOUR_TEMPLATE/product_listing.php with the following code
Find:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
Replace by:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];
where did you find the $max_results line? there is no $ max_results in my Edit /includes/modules/YOUR_TEMPLATE/product_listing.php file.
I already have the following code in my override folder for product_listing.php
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];
The module is working as it was intented to, but I want to change text links to images but only show the option relevant.
i.e.
if six products are displayed - show the "display all products" image only
if all products displayed - show the "display 6 products" image only