Hi all,

I'm setting up a store for a flower site that will likely be using Salemaker more than Specials. The unfortunate drawback of the Specials page is that it does not feature the Salemaker items and Salemaker doesn't advertise itself - you sort of have to stumble on the category that is on Sale. Sooo I decided to use the Banner Manager and modify my the Specials sidebox and page to display them.

I created sale banners and added them to the BannersAll group in Banner Manager. Then, added the following code to includes/templates/CUSTOM/templates/tpl_specials_default.php

Code:
<?php 
	if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/banner_box_all.php') ) {
  require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/banner_box_all.php');
} else {
	require(DIR_WS_MODULES . 'sideboxes/banner_box_all.php'); 
	}
	?>
But the Specials page won't display if there are no products on Special so I had to modify includes/modules/pages/specials/main_template_vars.php (backup your file!!)
in the last few lines you need to move the require statement down so it looks like this:
Code:
      
$specials->MoveNext();
    }
  }
  require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
}
?>

You can stop there but I also want my Specials sidebox to randomly show a banner if there are no Specials items so we have to create a banner_box module, I created includes/modules/sideboxes/banner_box_special.php

Code:
<?php
/**
 * banner_box_special sidebox - box used to display salemaker banners from BannersAll
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: banner_box2.php 3133 2006-03-07 23:39:02Z ajeh $
 */


    $banner_box_group= SHOW_BANNERS_GROUP_SET_ALL;

    if ($banner = zen_banner_exists('dynamic', $banner_box_group)) {
    $content .= zen_display_banner('static', $banner);
  }

// if no active banner in the specified banner group then the box will not show
// uses banners in the defined group $banner_box_group
    if ($banner->RecordCount() > 0) {

      $title =  '';
      $title_link = false;
      
    }
  
?>
Changed includes/modules/sideboxes/CUSTOM/specials.php to:
Code:
<?php
/**
 * banner_box2 sidebox - second box used to display "square" banners in sideboxes
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: banner_box2.php 3133 2006-03-07 23:39:02Z ajeh $
 */


    $banner_box_group= SHOW_BANNERS_GROUP_SET_ALL;

    if ($banner = zen_banner_exists('dynamic', $banner_box_group)) {
    $content .= zen_display_banner('static', $banner);
  }

// if no active banner in the specified banner group then the box will not show
// uses banners in the defined group $banner_box_group
    if ($banner->RecordCount() > 0) {

      $title =  '';
      $title_link = false;
      
    }
  
?>
Then changed includes/templates/CUSTOM/sideboxes/tpl_specials.php to:
Code:
<?php
/**
 * tpl_specials.php
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_specials.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
  
  if ($random_specials_sidebox_product->RecordCount() > 0)  {
  $content .= '<a href="' . zen_href_link(zen_get_info_page($random_specials_sidebox_product->fields["products_id"]), 'products_id=' . $random_specials_sidebox_product->fields["products_id"]) . '"><div class="specialsImg">' . zen_image(DIR_WS_IMAGES . $random_specials_sidebox_product->fields['products_image'], $random_specials_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</div>' . $random_specials_sidebox_product->fields['products_name'] . '</a><br />' . $specials_box_price;
  }
  
  if ($random_specials_sidebox_product->RecordCount() = 0)  {
  	require(DIR_WS_MODULES . 'sideboxes/banner_box_special.php');
  }
  $content .= '</div>';
?>
You can see the live store at: http://www.hawaiiantropicals.com/index.php

Alane