I need to print only like 1,3,5 values of foreach. I have foreach in my template (joomla - virtuemart)
foreach($product->customfields as $field){
echo $field->virtuemart_custom_id;
echo $field->custom_title;
echo $field->customfield_value;
echo "<br>";
}
Why this code in foreach not works ? ↓↓↓
if($field->virtuemart_custom_id == 1) {echo "get 1<br>";}
if($field->virtuemart_custom_id == 3) {echo "get 3";}
How get only 1,3,5,8,20 $customfield ?? in foreach.
Try this:
print_r( $field);
To see what $field holds
Jörgen @ Kreativ Fotografi
You will have to put some effort into this yourself. Try my suggestion and examine the output. Then You will see what to echo or print.
regards
Jörgen @ Kreativ Fotografi
Why not using a new position "my-position"
And render it with :
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'my-position'));