Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Show Adsense ads when product is sold out?

Show Adsense ads when product is sold out?

Locked

Started by romac35 on 28 Oct 2009, 9:24 PM · Views: 739

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
28 Oct 2009, 9:24 PM
#1
romac35 avatar

romac35

New Zenner

Join Date:
Aug 2009
Posts:
5
Plugin Contributions:
0

Post #1 by romac35

Hello,

When a product is sold out and only when it is sold out I would like to show Google Adsense ads beneath the product details and the sold out button.
Can anyone tell me how I go about doing this? Ive seen it on some online stores and it feels natural to click on an ad when the product is sold out. That way I still make some money when I have to turn a customer away.

28 Oct 2009, 11:24 PM
#2
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Post #2 by tino_schlegel

In /includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php

Add the following code at the position where you wanna show you ads

<?php if ($products_quantity <= 0) {
              // show adsense for sold out products
?>              

Replace this with your Adsense code!

<?php
            } 
?>
28 Oct 2009, 11:58 PM
#3
romac35 avatar

romac35

New Zenner

Join Date:
Aug 2009
Posts:
5
Plugin Contributions:
0

Post #3 by romac35

Thanks very much for the fast answer. It works great. :smile: