Forums / All Other Contributions/Addons / Seasonal Centerbox [support thread]

Seasonal Centerbox [support thread]

Views: 8,897

Results 21 to 37 of 37
9 Jun 2022, 2:33 AM
#21
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Seasonal Centerbox [support thread]

Quick question on this great plug-in:

How do i get to display between the special centerbox and the featured centerbox?

I know the order of special/featured/new product can be change via admin but no luck with seasonal centerbox.

I tried to move the display code between

?>
<?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
<?php } ?

and

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS') { ?>
<?php

it appears to work at first by displaying seasonal box between the two. However, i end up with the seasonal box being display 2 more times below again. ( so 3 seasonal box total on main page :( )

Any suggestion on this please?

Thank you

9 Jun 2022, 10:57 AM
#22
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

For clarification: the file being modified is
includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php

You added this block:

<?php require($template->get_template_dir('tpl_modules_seasonal.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_seasonal.php'); ?>

above
while (!$show_display_category->EOF) {

(per the instructions). Remove that.

Now place that block between

<?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>

and the following line

<?php } ?>

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

10 Jun 2022, 2:25 AM
#23
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

swguy:

For clarification: the file being modified is
includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php

You added this block:

<?php require($template->get_template_dir('tpl_modules_seasonal.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_seasonal.php'); ?>

above
while (!$show_display_category->EOF) {

(per the instructions). Remove that.

Now place that block between

<?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>

and the following line

<?php } ?>

Thank you for the prompt reply and assitance.

It works perfectly

10 Jun 2022, 11:25 AM
#24
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

You could of course add a SHOW_ key but I find that so complicated I didn't suggest it in my install documentation.
Glad it works for you.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

26 Sep 2022, 4:57 AM
#25
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

Hello everyone,

ZC 1.5.7
Bootstrap template

I installed this plug in on my website upgrade.

Installation went smooth and easy but i am getting some display issue.

Somehow the seasonal centerbox is not following the same "layout"as the featuredand/or special centerbox.

What do i need to do in order to fix it? site is at http://www.royal-fleur.com/upgrade

Thank you for the help

26 Sep 2022, 9:02 AM
#26
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

Be sure you are using ./includes/modules/bootstrap/seasonal_index.php from the zip file, and not ./includes/modules/custom/seasonal_index.php.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

26 Sep 2022, 4:51 PM
#27
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

swguy:

Be sure you are using ./includes/modules/bootstrap/seasonal_index.php from the zip file, and not ./includes/modules/custom/seasonal_index.php.

I don t have a ./includes/modules/bootstrap/seasonal_index.php in the plugin zip file.

I copied the file ./includes/modules/custom/seasonal_index.php. from the release into ./includes/modules/bootstrap/.

Excuse my ignorance but where do i find thecorrect file?

Also should the file be placed in ./includes/modules/bootstrap/ or ./includes/modules/bootstrap/centerboxes?

Thank you

26 Sep 2022, 5:26 PM
#28
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

You're right - I thought I had uploaded that change but I guess I didn't. Grab the new version and update ./includes/modules/bootstrap/seasonal_index.php.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

27 Sep 2022, 6:16 AM
#29
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

swguy:

You're right - I thought I had uploaded that change but I guess I didn't. Grab the new version and update ./includes/modules/bootstrap/seasonal_index.php.

Thank you very much for the fast reply and help.

The new file fixed the display layout to match the rest of thew centerboxes.

However , the pictures are really small. How can i fix that?

Thank you

27 Sep 2022, 11:04 AM
#30
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Oct 2022, 1:21 AM
#32
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

I am trying to have the seasonal box display 2 product per row on mobile with the bootstrap template.

I looked at the modification from post #554 in the bootstrap threads but i am not finding a similar file for the seasonal centerbox.

@@ -36,14 +36,14 @@ if (is_array($list_box_contents) > 0 ) {
     //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
 ?>

-<div class="card-deck text-center">
+<div class="card-deck text-center row row-cols-2">
 <?php
     for($col=0, $j=sizeof($list_box_contents[$row]); $col<$j; $col++) {
       $r_params = "";
       if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
      if (isset($list_box_contents[$row][$col]['text'])) {
 ?>
-    <?php echo '<div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] .  '</div>'; ?>
+    <?php echo '<span ' . $r_params . '>' . $list_box_contents[$row][$col]['text'] .  '</span>'; ?>
 <?php
       }
     }

How can i accomplish the same thing with this mod?

Thank you once again for your help

3 Oct 2022, 2:16 AM
#33
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,567
Plugin Contributions:
58

Re: Seasonal Centerbox [support thread]

Check the module file where the $list_box_contents variable is set

4 Oct 2022, 2:45 AM
#34
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

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

<?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.

<?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

16 Nov 2023, 1:49 AM
#35
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

I could use some help .

The modules was working fine then i switch categories to 0 to disable the module for awhile.

I switch it back to categories 48 for example, however, i am getting a blank frame.

I tried to remove and reinstall the plugin but no luck.

It is on the main page of royal-fleur.com right above the deal of the week section.

Anyone know how i can fix this?

thank you for your help.

4 Feb 2026, 11:37 PM
#36
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Seasonal Centerbox [support thread]

Does anyone successfully got this plugin to work with ZC 2.1?

Thanks

5 Feb 2026, 10:34 AM
#37
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: Seasonal Centerbox [support thread]

You have to add the null coalescing logic for newer PHP versions to includes/modules/bootstrap/seasonal_index.php (or includes/modules/custom/seasonal_index.php).

Change

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') ) {

to

if ((($manufacturers_id > 0 && empty($_GET['filter_id'])) || !empty($_GET['music_genre_id']) || !empty($_GET['record_company_id'])) || empty($new_products_category_id)) {

If you're getting a blank page or partial blank page, you have to post the logs.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.