Hi there
This is my first time using the forum so please bear with me
Im trying to get all the products to appear in a rows of 4. So every set of 4 product items would be containted in a <div class="product_row">. I figured it would need to use modulus for this so i made a function:
function startRow() {
if(($this->Pos() % 4)==1) {
return true;
}
}
that works fine to start the row. however if i use the same idea to end it
function endRow() {
if(($this->Pos() % 4)==0) {
return true;
}
}
and i dont have an amount of products that is a multiple of 4 (4, 8, 12, 16 etc), it wont close the div.
Can anyone help?
Cheers,
Aaron
EDIT - SOLVED. the answer was right infront of me. if(($this->Pos() % 4)==0 || $this->Last())