spadez
02-22-2010, 03:38 PM
Hi,
Im trying to create an if statement. This is the code I was using:
<a href="#" class="buttonx"><span class="<?php echo $_product->gettesting() ?>"><?php echo $_product->gettesting() ?></span></a>
Im trying to make it into an If statement. This is my attempt:
<?php
if ($_product->gettesting()=="Optional");
<a href="#" class="buttonx"><span class="Optional">Optional</span></a>;
else
<a href="#" class="buttonx"><span class="Mandatory">Mandatory</span></a>;
?>
However, it seems to cause problems on my site, the code doesnt work and also stops a lot of content from displaying. Can anyone point me in the right direction with this?
Im trying to create an if statement. This is the code I was using:
<a href="#" class="buttonx"><span class="<?php echo $_product->gettesting() ?>"><?php echo $_product->gettesting() ?></span></a>
Im trying to make it into an If statement. This is my attempt:
<?php
if ($_product->gettesting()=="Optional");
<a href="#" class="buttonx"><span class="Optional">Optional</span></a>;
else
<a href="#" class="buttonx"><span class="Mandatory">Mandatory</span></a>;
?>
However, it seems to cause problems on my site, the code doesnt work and also stops a lot of content from displaying. Can anyone point me in the right direction with this?