the piece of code below is from product_info.php. It is to show an instock out of stock sign and a link to the contact page which includes which product the enquiry is about. This code works
The code looks very messy to me and I think there are more <?php tags than are needed ?> and also I think it should be if and else not elseif.
Also I don't think the second stock check is necessary as it is an either or situation.
Could someone give me a hand as I keep breaking it and getting things in the wrong place.
i would just like to clean it up.
<!--bof stock announcement-->
<?php
if ((STOCK_CHECK == 'true')&&($product_info['products_quantity'] < 1)) { ?>
<b><font color='red'size='5'>Sorry We Have Sold Out</font></b><br>
<?php echo '<b><a href="' . tep_href_link(FILENAME_CONTACT_US,'products_name=' .$product_info['products_name']) . '">' .tep_image_button('button_ask_a_question.gif',IMAGE_BUTTON_ASK_A_QUESTION) .'</a>'; ?>
<?php
}elseif ((STOCK_CHECK == 'true')&&($product_info['products_quantity'] > 0)) { ?>
<font color='green'size='4'><b>In Stock </b></font>
<?php
} ?>
<!--eof stock announcement-->










