Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    37
    Plugin Contributions
    0

    red flag Remove Category description on pages greater than 2

    Hello all PHP/Zen Cart gurus,

    My client wants the category description to display only on the first page of any group of products that has more than one page. Subsequent pages should only list the products from that category.

    I have done extensive searching of the forum and discovered that this functionality cannot be set from within the ZC admin and will require custom PHP coding by overriding the tpl_index_product_list.php file.

    While my PHP skills are not great, I believe I understand the logic that will need to be set up for this to work properly but I am unsure how I might set the script to trigger only on pages that number greater than 1.

    I think that if I wrap the $current_categories_description variable in a conditional statement that will identify the current page as greater than or equal to 2, I can get it to display on just the first product listing page of each category and no other.

    What I need help with is how to determine the condition I have specified. I believe that this can be accomplished with something like the following:

    Code:
     if (page_count_variable >=2) {echo $current_categories_description;}
    I have already successfully tested a similar script to see if this will work by testing a specific category number (to the exclusion of others) against the the $current_category_id variable but have not been able to figure out a straightforward way to capture current page number. The answer seems to be dependent on the number of products to be displayed on each page and displays only in the URL which is a string of several parameters. I would like the script to recognize any changes to the number of displayed products as specified in the admin.

    Any help would be greatly appreciated. I will post the solution as a "How to" in the downloads as this will help others who have searched for this feature.

    Thanks,

    cpk

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

    Default Re: Remove Category description on pages greater than 2

    You could just alter the tpl_index_product_listing.php
    // categories_description
    if ($current_categories_description != '') {
    To read:
    // categories_description
    if ($current_categories_description != '' and $_GET['page'] <= 1) {
    Now if the page is blank or page 1 of the listing you see it ... and if any other page you don't ...
    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: v1.5.5]
    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!

  3. #3
    Join Date
    Apr 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: Remove Category description on pages greater than 2

    Quote Originally Posted by Ajeh View Post
    You could just ...
    As usual, I over thought my solution to the problem. Thanks for coming to the rescue Linda.

    Keep up the good work!

    cpk

 

 

Similar Threads

  1. Remove Category Image/Description div on product pages
    By Webbo1969 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 12 Sep 2009, 02:05 PM
  2. Adding products greater than the quantity in stock.
    By namae in forum Managing Customers and Orders
    Replies: 1
    Last Post: 15 Jan 2009, 06:10 PM
  3. Show qty in stock if greater than 0
    By kbalona in forum Basic Configuration
    Replies: 5
    Last Post: 19 Sep 2008, 10:16 PM
  4. Please enter an amount greater than zero....
    By 2scrappychixdesigns in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 30 Dec 2006, 04:23 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR