Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Templates, Stylesheets, Page Layout / where can I add banners to the product pages?

where can I add banners to the product pages?

Started by jen_will on 17 Apr 2012, 3:53 AM · Views: 2,806

Results 1 to 13 of 13
17 Apr 2012, 3:53 AM
#1
jen_will avatar

jen_will

New Zenner

Join Date:
Jul 2006
Posts:
60
Plugin Contributions:
0

where can I add banners to the product pages?

Hi,
I wanted to know where can I add banners to the product pages? For example you click on a category and you are taken to the product page where it lists the individual products you have for that category, I want to be able to add a banner on those pages. I hope I make sense.

17 Apr 2012, 4:11 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: where can I add banners to the product pages?

What exactly do you mean by "banner"?

There are lots of different meanings of the word "banner" when it comes to websites and designers. A banner could be an ad. It could be a header image. It could be a wide picture. It could be lots of different things, and each would have a very different implementation. Please describe exactly what you mean when you use that word.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Apr 2012, 1:57 PM
#3
jen_will avatar

jen_will

New Zenner

Join Date:
Jul 2006
Posts:
60
Plugin Contributions:
0

Re: where can I add banners to the product pages?

banner ads

17 Apr 2012, 6:16 PM
#4
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,814
Plugin Contributions:
24

Re: where can I add banners to the product pages?

There is no built in feature that would allow you to do that. Zen Cart normally uses banners site-wide and has only a SSL/NONSSL switch.

Here's what you could do: take any of the existing banner positions and add it to your product page.

Let's say you'll be using header position 1. This is a step-by-step guide how to do it.

  1. Open your includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php file. Delete the following code:
<?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>
  1. Open your includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php and paste the code from above (the one you deleted) to a position where you want your banner to show up.

  2. go to "Admin -> Configuration -> Layout Settings -> Banner Display Groups - Header Position 1" and set that to ProductPage

  3. go to "Admin -> Banner Manager" and add a new banner. In the Banner Group field, manually type ProductPage

And that's it, your banner will now show on all product pages. You can add multiple banners to the same group and display a random banner each time.

My site - Pro ZC Help
My portfolio | My plugins

17 Apr 2012, 6:44 PM
#5
jen_will avatar

jen_will

New Zenner

Join Date:
Jul 2006
Posts:
60
Plugin Contributions:
0

Re: where can I add banners to the product pages?

I have banner on the homepage that I don't want to remove, but I will look at what you sent thank you!

17 Apr 2012, 7:06 PM
#6
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,814
Plugin Contributions:
24

Re: where can I add banners to the product pages?

The one I mentioned is usually located ABOVE the header, on the very top of the page. So, unless your template was designed differently, you should be safe to use it.

My site - Pro ZC Help
My portfolio | My plugins

17 Apr 2012, 7:45 PM
#7
jen_will avatar

jen_will

New Zenner

Join Date:
Jul 2006
Posts:
60
Plugin Contributions:
0

Re: where can I add banners to the product pages?

Yes it is different because I don't have this page tpl_product_info_display.php, but thank you for your help anyway.

17 Apr 2012, 8:13 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: where can I add banners to the product pages?

Jen Will:

I don't have this page tpl_product_info_display.php, but thank you for your help anyway.
Um ... yes, you do.

Your custom template may not yet have a customized version of the file, but if you copy it from the template_default and store your altered version of it in your own template folder, then you can make adjustments as necessary. That's all part of the template-override system. Details in the Tutorials/FAQs area.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Apr 2012, 4:23 PM
#9
sterlingmonkey avatar

sterlingmonkey

New Zenner

Join Date:
Apr 2012
Posts:
1
Plugin Contributions:
0

Re: where can I add banners to the product pages?

Hi,
I have a jewelry site and I'd like to post random banners on specific jewelry pictures (to say "special" or "sale through...").
How would I do this?
Thanks

10 Aug 2012, 7:07 AM
#10
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: where can I add banners to the product pages?

balihr:

There is no built in feature that would allow you to do that. Zen Cart normally uses banners site-wide and has only a SSL/NONSSL switch.

Here's what you could do: take any of the existing banner positions and add it to your product page.

Let's say you'll be using header position 1. This is a step-by-step guide how to do it.

  1. Open your includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php file. Delete the following code:
<?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> ``` > > 2. Open your includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php and paste the code from above (the one you deleted) to a position where you want your banner to show up. > > 3. go to "Admin -> Configuration -> Layout Settings -> Banner Display Groups - Header Position 1" and set that to ProductPage > > 4. go to "Admin -> Banner Manager" and add a new banner. In the Banner Group field, manually type ProductPage > > And that's it, your banner will now show on all product pages. You can add multiple banners to the same group and display a random banner each time.

This is a great how-to but I would like to have the banner on product listing page only and not on the product info page.

So basically, once you click on a category, the product listing is display which is where I would like the banner to be displayed

Which file should i insert the code into instead of tpl_product_info_display.php??

Thank you

10 Aug 2012, 7:56 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: where can I add banners to the product pages?

leave it in tpl_main_page.php and wrap it in a conditional statement such as:```
if ($current_page_base == 'index' && !$this_is_home_page) {

// regular banner code goes here;

}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jun 2013, 10:51 PM
#12
quality_refurbished avatar

quality_refurbished

New Zenner

Join Date:
Feb 2013
Posts:
41
Plugin Contributions:
0

Re: where can I add banners to the product pages?

Hi

This is just what I'm looking for... I want to place a banner 468x60 just below the add to cart button... When I follow your instructions it places the banner in the sidebar is there no way of doing it without the side bar?

Thanks for your help

14 Jun 2013, 10:59 PM
#13
quality_refurbished avatar

quality_refurbished

New Zenner

Join Date:
Feb 2013
Posts:
41
Plugin Contributions:
0

Re: where can I add banners to the product pages?

Quality Refurbished:

Hi

This is just what I'm looking for... I want to place a banner 468x60 just below the add to cart button... When I follow your instructions it places the banner in the sidebar is there no way of doing it without the side bar?

Thanks for your help

Hi sorry ignore last message I didn't name the banner group

Thank you