You are here:  » Add banners to specific pages?


Add banners to specific pages?

Submitted by suffolk66 on Wed, 2012-03-07 15:31 in

Is there a way of adding banners so that they display above or below products that appear in certain categories? I'm trying to increase income using some CPA offers and this functionality would help.

Submitted by support on Wed, 2012-03-07 15:37

Sure!

In html/product.php you can check for a specific category and display relevant banner code HTML as follows - simply add this code to the beginning or end of the file as required...

<?php
switch($product["products"][0]["category"])
{
case "Category 1":
?>
<!-- Category 1 Banner HTML here -->
<?php
break;
case "Category 2":
?>
<!-- Category 2 Banner HTML here -->
<?php
break;
case "Category 3":
?>
<!-- Category 3 Banner HTML here -->
<?php
break;
}
?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by suffolk66 on Sun, 2012-03-18 16:41

Thanks David. Would it be possible to have code so that html displays on the product page regardless of the category.

Submitted by support on Sun, 2012-03-18 20:27

Hi,

Sure - you can add a default case as follows:

<?php
switch($product["products"][0]["category"])
{
case "Category 1":
?>
<!-- Category 1 Banner HTML here -->
<?php
break;
case "Category 2":
?>
<!-- Category 2 Banner HTML here -->
<?php
break;
case "Category 3":
?>
<!-- Category 3 Banner HTML here -->
<?php
break;
default:
?>
<!-- Default Category Banner HTML here -->
<?php
break;
}
?>

Cheers,
David.
--
PriceTapestry.com

Submitted by stonecold111 on Mon, 2013-08-12 20:40

Hello,
I just bought your script today.
Can I add a specific banner for a specific brand? Can I just replace Category 1 with Brand 1? Also, where can I see the category id and brand id?
I'm not sure where the code should be added to product.php, do I need to add the whole code including <?php and ?> to the very end of the file?

Should I place the image html after <!-- Category 1 Banner HTML here --> or replace <!-- Category 1 Banner HTML here --> with the image html?

Any help is much appreciated

Submitted by support on Tue, 2013-08-13 07:55

Hi stonecold111 and welcome to the forum!

Yes - simply replace category with brand, and when pasting the code into html/product.php you do need to include the PHP tags. Your image HTML can go after or replace the comment, it doesn't matter at all - here's a full example with img HTML included:

<?php
switch($product["products"][0]["brand"])
{
case "Brand A":
?>
<a href='BANNER_A_AFFILIATE_URL'><img src='BANNER_A_IMAGE_URL' /></a>
<?php
break;
case "Brand B":
?>
<a href='BANNER_B_AFFILIATE_URL'><img src='BANNER_B_IMAGE_URL' /></a>
<?php
break;
case "Brand C":
?>
<a href='BANNER_C_AFFILIATE_URL'><img src='BANNER_C_IMAGE_URL' /></a>
<?php
break;
default:
?>
<!-- Default Brand Banner HTML here -->
<?php
break;
}
?>

Many advertising network creatives are delivered via JavaScript these days so if that's the case with any of yours simply insert the exact code provided by the network in place of the A and IMG tags in the above.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com