1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Product rows
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 480 Views |
-
Product rows

8 October 2009 at 2:06pm Last edited: 8 October 2009 2:26pm
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,
AaronEDIT - SOLVED. the answer was right infront of me. if(($this->Pos() % 4)==0 || $this->Last())
| 480 Views | ||
|
Page:
1
|
Go to Top |

