Forums / Templates, Stylesheets, Page Layout / Where is the code to get and display banners?

Where is the code to get and display banners?

Locked

Views: 726

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 Sep 2010, 5:01 AM
#1
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Where is the code to get and display banners?

Does anyone know where is the code to get the banners and display them?

I am thinking to add a logic, that disables (hides) all the banners if there is item(s) in the shopping cart (so hope customer will go ahead and checkout, instead of wrongly click any banner. :-)

Thanks.

29 Sep 2010, 9:31 AM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Where is the code to get and display banners?

That code is present in /includes/functions/banner.php -- a core file. Be sure to make a backup before you commence with your changes!

29 Sep 2010, 11:32 AM
#3
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Where is the code to get and display banners?

Another option is to edit: includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

change

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}

to read

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'shopping_cart')) ) {
$flag_disable_banner = true;
}

Note: this will disable Banners on the Shopping Cart page regardless of whether something is in the cart or not.

The learning is in the doing.

Potent Products

30 Sep 2010, 4:55 AM
#4
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Re: Where is the code to get and display banners?

lat9:

That code is present in /includes/functions/banner.php -- a core file. Be sure to make a backup before you commence with your changes!

This does not work in the way I want: I find I can change zen_display_banner, so it always return ''. This removes the content of the banner, but it does not remove the banner (the banner title, box, are still there).

30 Sep 2010, 4:58 AM
#5
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Re: Where is the code to get and display banners?

Website Rob:

Another option is to edit: includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

change

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}

to read

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'shopping_cart')) ) {
$flag_disable_banner = true;
}

Note: this will disable Banners on the Shopping Cart page regardless of whether something is in the cart or not.

Somehow this does not work. :-(

By the way, where can I verify $flag_disable_banner is used? I can't find it anywhere else.

30 Sep 2010, 4:59 AM
#6
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Re: Where is the code to get and display banners?

By the way, the banner I want to conditionally hide is located at the left side box. In the "layout setting", it is "Banner Display Groups - Side Box banner_box".

Where can I find the code that display it?

Thanks.

30 Sep 2010, 5:01 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Where is the code to get and display banners?

Since it's "banner_box" you want to hide, the template would be: tpl_banner_box.php

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