NEW ALTERNATIVE HACK: just another solution for same problem
Tonite I was not sleeping as I should....so I spent a little bit of my time playing with another solution to this problem).
I don't know if it's less or more heavy to compute....for sure it allows you to modify just one line of involved files without declaring or using new variables:
Fisrt, copy new_products.php and specials_index.php from /includes/modules to /includes/modules/CUSTOM_TEMPLATE
(where CUSTOM_TEMPLATE is your current template name)
In specials_index.php file, find:
PHP Code:
while (!$specials_index->EOF) {
and change it to:
PHP Code:
while ( (!$specials_index->EOF) && (((($row * $col) + ((SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - $col) * ($row - 1))) + SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS) < $num_products_count) ) {
Next in new_products.php file, find:
PHP Code:
while (!$new_products->EOF) {
and change it to:
PHP Code:
while ((!$new_products->EOF) && (((($row * $col) + ((SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - $col) * ($row - 1))) + SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS) < $num_products_count) ) {
That's all folks... (you may want to apply similar hacks to featured products box also...I'm pretty sure you have to modify featured_products.php the very same way)[/QUOTE]
SOME EXPLANATIONS
Every matrix element can be represented by row and column values.
Its numerical order in the matrix can be computed ad follows:
Code:
(R * C) + ((MAXC - C) * (R - 1))
Where:
Code:
R is the row
C is the column
MAXC is the number of columns in our matrix
In my hack:
Code:
R is $row variable
C is $col variable
MAXC is SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS and SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS constants
In ZC matrix first row and column have a value of zero, so I had to slightly modify the formula to:
Code:
((R * C) + ((MAXC - C) * (R - 1))) + MAXC