First, you need to use the product names in the explode, not the section names.
As your product names are long and may include commas, they will be cumbersome if not fatal to use. It will be better to use product ids, which are short and unique.
PHP Code:
// Following code will be executed only if Column Layout (Grid Layout) option is chosen
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
$section_check = $listing->fields['products_id']; // subheadings - gjh42 20080913
$section_header = '';
if (in_array($section_check,explode(",",'list_ids_to_start_new_lines_here,separated_by_commas,and_no_spaces'))) {
$column != 0?$rows ++:'';
$column = -1;
switch ($section_check) {
case "first id":
$section_header = 'First Section';
break;
case "second id": //repeat case/$section/break for other ids to start headings
$section_header = 'Second Section';
break;
} //switch
$section_header = '<div class="sectionHeader">' . $section_header . '</div>';
} //if
$lc_text = $section_header . implode('<br />', $product_contents); // /subheadings
$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => $lc_text);
$column ++;
if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
$column = 0;
$rows ++;
}
}
// End of Code fragment for Column Layout (Grid Layout) option in add on module