Here's one approach to do it from .php pages within your own website. (This was built based on a Zen Cart v1.3.0 setup):
Create a file like this (I called it single_sidebox.php) in the root of your store area (ie: same place as index.php and ipn_main_handler.php etc):
PHP Code:
<?php
/**
* single_sidebox.php used to display a Zen Cart sidebox on some external resource
*
* @package general
* @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: single_sidebox.php based on index.php 2942 2006-02-02 04:41:23Z drbyte $
*/
/**
* Load common library stuff
*/
require('includes/application_top.php');
/**
* PLEASE ENTER THE NAME OF THE SIDEBOX YOU WANT TO CALL HERE:
*/
$sidebox_name = 'featured.php';
//which sidebox template to use:
$column_box_default='tpl_box_default_left.php';
$column_width = BOX_WIDTH_LEFT;
/**
* Load required functions and processing to generate the sidebox:
*/
$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
$box_id = zen_get_box_id($sidebox_name);
if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_name) ) {
require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_name);
} else {
require(DIR_WS_MODULES . 'sideboxes/' . $sidebox_name);
}
/**
* Load general code which runs before page closes
*/
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
To use, on line 21 change "featured.php" to the name of the sidebox file you want displayed (see /includes/modules/sideboxes for the list).
Then do a <?php require ('single_sidebox.php'); ?> from the page you want the sidebox to appear on. (Your page will have to be a .php script or the <?php tags will simply display as-is, and not execute anything.)
UPDATE: This code has been updated and packaged for download in the contributions area:
http://www.zen-cart.com/index.php?ma...products_id=79
Bookmarks