Hi! I am just testing VM 3.0.3 and Joomla 3.3.6.
I have some problem with the code in my file products_korpedagogen.php. The code works with VM 2.6.14 but not with VM 3.0.3.
The code did I get with great help from this forum. So why does not this code work with VM 3.0.3. What have changed?
I get this message in the front end:
Warning: Invalid argument supplied for foreach() in /customers/3/3/9/korpedagogen.no/httpd.www/korpedagogen4/templates/yoo_avenue/html/com_virtuemart/sublayouts/products_korpedagogen.php on line 101
And in line 101 I can read this:
foreach($product->customfields as $field) {
The full code is:
<?php $theseones = array(13,15,17,18,20,21,22);
foreach($product->customfields as $field) {
if(in_array ($product->virtuemart_custom_id,$theseones)) {
?>
<div class="customfields">
<?php if($field->virtuemart_custom_id == '13') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '15') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '17') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '18') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '20') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '21') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } elseif($field->virtuemart_custom_id == '22') { ?>
<span class="vm-custom-title"><?php echo JText::_($field->custom_title); ?></span>
<span class="vm-display"><?php echo JText::_($field->custom_value); ?></span>
<?php } ?>
</div>
<?php }
?>
<?php }
?>
How can I solve this problem?
Regards
Ketil