I am hoping you figured this out by now, but I have been searching for a couple days for this answer and ended up figuring it out myself based off what I found at https://www.zen-cart.com/tutorials/index.php?article=249 and a little web research. Hopefully it will provide help for someone else.
I wanted to show a sidebox ONLY for a specific chapter. I will use the search sidebox for these examples. Make sure the search box (or any boxes you want to apply this to) is turned on in Admin > Tools > Layout Boxes Controller.
Go to includes/modules/sideboxes and copy search.php (or any sideboxes you want to show/not show on specific chapters) to your template folder (includes/modules/sideboxes/YOUR_TEMPLATE).
Open the search.php file in your template folder and find:
require($template->get_template_dir('tpl_search.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_search.php');
$title = '<label>' . BOX_HEADING_SEARCH . '</label>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
```To show the sidebox everywhere EXCEPT specific chapters, wrap this in a conditional statement so it looks like:
if (!in_array($chapter_id,explode(",",'1'))) {
require($template->get_template_dir('tpl_search.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_search.php');
$title = '<label>' . BOX_HEADING_SEARCH . '</label>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
To make the sidebox show ONLY for specific chapters, just remove the "!" in front of !in_array, so it looks like:
if (in_array($chapter_id,explode(",",'1'))) {
require($template->get_template_dir('tpl_search.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_search.php');
$title = '<label>' . BOX_HEADING_SEARCH . '</label>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
If you have a sidebox that is only going to show for ONE chapter only, another way to do it would be to wrap the code so it looks like:
if ($chapter_id == 1) {
require($template->get_template_dir('tpl_search.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_search.php');
$title = '<label>' . BOX_HEADING_SEARCH . '</label>';
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}