Code:
require($template->get_template_dir('tpl_modules_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_product_listing.php');
this code
Code:
// MSL: Insert blanks into product list as required
if (defined('TEXT_PRODUCT_DUMMY_PRODUCT')) {
$rows = count($list_box_contents);
$cols = count($list_box_contents[0]);
//$cols = PRODUCT_LISTING_COLUMNS_PER_ROW;
$lastrowcols = count($list_box_contents[$rows-1]);
$insertcount = $cols - $lastrowcols;
$totalcount = $rows * $cols;
if ($insertcount) {
// Reorder the items, inserting some blanks to make the rows complete
$new_list_box_contents = array();
foreach($list_box_contents as $r=>$row) foreach($row as $i=>$item) {
$new_list_box_contents[] = $item;
// echo "if ($insertcount && (".rand(1,$totalcount)." > ".($totalcount-count($new_list_box_contents)-$insertcount).")) {";
if ($insertcount && (mt_rand(1,$totalcount) > ($totalcount-$insertcount-count($new_list_box_contents))*1.2)) {
$new_list_box_contents[] = array('align' => 'center',
'params' => 'class="productListing-data"',
'text' => TEXT_PRODUCT_DUMMY_PRODUCT
);
$insertcount--;
}
}
$r = $i = 0;
$list_box_contents = array();
foreach($new_list_box_contents as $item) {
$list_box_contents[$r][$i++] = $item;
if ($i >= $cols) { $i = 0; $r++; }
}
}
}
// END: MSL: Insert blanks into product list as required