I need to set $use_paypal to TRUE only if the $products array contains one or more objects with term_id property set to 36.
This code works if $products contains one or more 36-items, but it also sets $use_paypal to TRUE if $products contains other items.
$use_paypal = FALSE;
foreach ($products as $product) {
// The values could be 30, 31, 32, 33, 34, 35, 36
if ($product->term_id == 36) {
$use_paypal = TRUE;
}
}
return $use_paypal;
productclass?