Answer the question
In order to leave comments, you need to log in
The if else condition does not work. Where is the mistake?
There are no syntax errors. Tell me where am I making a mistake? Tk should, if condition 1 is not active, it should work 2. Does not work.
<?php if (is_array($this->product->extra_field)){?>
<?php foreach($this->product->extra_field as $extra_field){?>
<?php if ($extra_field["id"] == 1){?>
<?php print $extra_field['value'];?>
<?php }?>
<?php }?>
<?php }?>
<?php }else{ ?>
<?php print $this->product->description; ?>
<?php } ?>
Answer the question
In order to leave comments, you need to log in
Rewrite in normal language and see where the error is:
<?php
if (is_array($this->product->extra_field)){
foreach($this->product->extra_field as $extra_field){
if ($extra_field["id"] == 1){
print $extra_field['value'];
}
}
// } - here is error
}else{
print $this->product->description;
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question