Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011
    Posts
    5
    Plugin Contributions
    0

    Default How do i display certain banners on certain pages?

    I have been trying to figure out for a couple days how to display certain banners on certain pages. I am thinking i should use if statements. I'd like to have If Category A,B, or C display Banner_Group_Set5. If Category D, E, or F display Banner_Group_set6.

    any clues how i could reference the categories in the includes/templates/Custom/common/tpl_footer.php

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,718
    Plugin Contributions
    6

    Default Re: How do i display certain banners on certain pages?

    Let's say you want Products in categories_id 10, 12 and 15 to be in Footer 2 ... SHOW_BANNERS_GROUP_SET5 ... use the code in red to place that limit ...
    Code:
    <!--bof-banner #5 display -->
    <?php
    if ( in_array($current_category_id, array(10, 12, 15)) ) { // limit to 10, 12 and 15
      if (SHOW_BANNERS_GROUP_SET5 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET5)) {
        if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerFive" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
        }
      }
    } // limit to 10, 12 and 15
    ?>
    <!--eof-banner #5 display -->
    NOTE: the $current_categories_id is the immediate categories_id that you are in ... if the $cPath is showing that is the categories_id on the right side ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Aug 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: How do i display certain banners on certain pages?

    Thanks. That worked out great.

 

 

Similar Threads

  1. Where is the code to get and display banners?
    By Cindy2010 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 30 Sep 2010, 06:01 AM
  2. Banners Do Not Display
    By flex67 in forum General Questions
    Replies: 2
    Last Post: 8 Sep 2010, 10:46 PM
  3. Highlighting Banners for display
    By bwtharp in forum Basic Configuration
    Replies: 0
    Last Post: 1 Jan 2010, 08:08 PM
  4. Banners do not display
    By cristaltech in forum Basic Configuration
    Replies: 5
    Last Post: 12 Jul 2007, 05:57 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
  •