What about this:
foreach($products as $product) {
process(product);
}
if (somecondition) {
foreach($products as $product) {
doSomething(product);
}
}
This way you instantly know that if somecondition is true, doSomething will be executed on each product (I think that this is subtle, but useful) and also you don't have to ask for somecondition every time in the foreach loop.