Thread: "View All" link

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 46
  1. #11
    Join Date
    Jul 2005
    Posts
    87
    Plugin Contributions
    0

    Default 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?

  2. #12
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default 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.

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

    Default Re: "View All" link

    Do you have the closing ?> at the end of the code?
    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!]
    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. #14
    Join Date
    Jul 2005
    Posts
    87
    Plugin Contributions
    0

    Default 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

  5. #15
    Join Date
    Jul 2005
    Posts
    87
    Plugin Contributions
    0

    Default Re: "View All" link

    Just bumping this up to see if anyone else has any thoughts on this...

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

    Default 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 ...
    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!]
    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!

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

    Default 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_LINKSzen_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_LINKSzen_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 ...
    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!]
    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!

  8. #18
    Join Date
    May 2006
    Posts
    98
    Plugin Contributions
    0

    Default 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!

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

    Default 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.

  10. #20
    Join Date
    Aug 2006
    Posts
    38
    Plugin Contributions
    0

    Default 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!

 

 
Page 2 of 5 FirstFirst 1234 ... 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

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