Forums / Templates, Stylesheets, Page Layout / Displaying products in the header like featured, new products sidebox

Displaying products in the header like featured, new products sidebox

Locked

Views: 1,235

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
24 Dec 2009, 11:59 AM
#1
namsingh avatar

namsingh

Zen Follower

Join Date:
Sep 2006
Location:
Leeds, UK
Posts:
165
Plugin Contributions:
0

Displaying products in the header like featured, new products sidebox

Hi,

I am trying to display the contents of a sidebox like the featured sidebox automatically in the header. For example where the banner would display.

This is the code from the /includes/templates/template_default/sideboxes/tpl_featured.php

file:

<?php /** * Side Box Template * * @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: tpl_featured.php 2982 2006-02-07 07:56:41Z birdbrain $ */ $content = ""; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">'; $content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_featured_product->fields['products_name'] . '</a><br />' . $featured_box_price; $content .= '</div>'; ?>

Thanks

25 Dec 2009, 2:24 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Displaying products in the header like featured, new products sidebox

Insert wanted code into a copy of tpl_header.php
Place into your template common folder

Zen-Venom Get Bitten