Originally Posted by
numinix
Check the module file where the $list_box_contents variable is set
There is no file for this mod in template/bootstrap/centerboxes.
The only file named tpl_modules_seasonal.php in includes/templates/bootstrap/templates looks nothing like the others.
here is the code
Code:
<?php
/**
* Module 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_modules_featured_products.php 2935 2006-02-01 11:12:40Z birdbrain $
*/
$zc_show_seasonal = false;
include(DIR_WS_MODULES . zen_get_module_directory('seasonal_index'));
?>
<?php if ($zc_show_seasonal) { ?>
<!-- bof: seasonal products -->
<div class="centerBoxWrapper" id="featuredProducts">
<?php
/**
* require the list_box_content template to display the product
*/
require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
?>
</div>
<!-- eof: seasonal products -->
<?php } ?>
The other file with the variable in it ( i think) is in modules/bootstrap/seasonal_index.php.
Code:
<?php
/**
* kitbuilder module - prepares content for display
*
* @package modules
* @copyright Copyright 2003-2007 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: featured_products.php 6424 2007-05-31 05:59:21Z ajeh $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// initialize vars
$categories_products_id_list = '';
$list_of_products = '';
$seasonal_products_query = '';
$display_limit = '';
$zc_show_seasonal = false;
if (SEASONAL_CENTERBOX_CATEGORY != 0) {
$zc_show_seasonal = true;
}
if ($zc_show_seasonal) {
if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
$seasonal_products_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
from (" . TABLE_PRODUCTS . " p
left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
where p.products_id = pd.products_id
and p.products_status = 1
and p.master_categories_id = " . SEASONAL_CENTERBOX_CATEGORY . "
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
} else {
// get all products and cPaths in this subcat tree
$productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);
if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
// build products-list string to insert into SQL query
foreach($productsInCategory as $key => $value) {
$list_of_products .= $key . ', ';
}
$list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
$seasonal_products_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
from (" . TABLE_PRODUCTS . " p
left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id)
where p.products_id = pd.products_id
and p.products_status = 1
and p.master_categories_id = " . SEASONAL_CENTERBOX_CATEGORY . "
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id in (" . $list_of_products . ")";
}
}
if ($seasonal_products_query != '') {
$seasonal_products = $db->ExecuteRandomMulti($seasonal_products_query, MAX_DISPLAY_SEASONAL_CENTERBOX);
}
$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';
$num_products_count = ($seasonal_products_query == '') ? 0 : $seasonal_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SEASONAL_CENTERBOX || SHOW_PRODUCT_INFO_COLUMNS_SEASONAL_CENTERBOX == 0) {
$col_width = floor(100/$num_products_count);
} else {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SEASONAL_CENTERBOX);
}
while (!$seasonal_products->EOF) {
$products_price = zen_get_products_display_price($seasonal_products->fields['products_id']);
if (!isset($productsInCategory[$seasonal_products->fields['products_id']])) $productsInCategory[$seasonal_products->fields['products_id']] = zen_get_generated_category_path_rev($seasonal_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContents card mb-3 p-3 text-center" id="centerBoxContentsFeatured"',
'text' => (($seasonal_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($seasonal_products->fields['products_id']), 'cPath=' . $productsInCategory[$seasonal_products->fields['products_id']] . '&products_id=' . $seasonal_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $seasonal_products->fields['products_image'], $seasonal_products->fields['products_name'], IMAGE_SEASONAL_CENTERBOX_LISTING_WIDTH, IMAGE_SEASONAL_CENTERBOX_LISTING_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($seasonal_products->fields['products_id']), 'cPath=' . $productsInCategory[$seasonal_products->fields['products_id']] . '&products_id=' . $seasonal_products->fields['products_id']) . '">' . $seasonal_products->fields['products_name'] . '</a><br />' . $products_price);
$col ++;
if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SEASONAL_CENTERBOX - 1)) {
$col = 0;
$row ++;
}
$seasonal_products->MoveNextRandom();
}
if ($seasonal_products->RecordCount() > 0) {
if (isset($new_products_category_id) && $new_products_category_id !=0) {
$category_title = zen_get_categories_name((int)$new_products_category_id);
$title = '<h4 id="featuredCenterbox-card-header" class="centerBoxHeading card-header">' . TITLE_SEASONAL_CENTERBOX . ($category_title != '' ? ' - ' . $category_title : '') . '</h4>';
} else {
$title = '<h4 id="featuredCenterbox-card-header" class="centerBoxHeading card-header">' . TITLE_SEASONAL_CENTERBOX . '</h4>';
}
$zc_show_seasonal = true;
} else {
$zc_show_seasonal = false;
}
}
}
?>
Any ideas on how i can make this work please?
Thank you
Bookmarks