How would you code the PHP if you would like to show an extra image next to the standard image if the field "sold" has a value "Yes"?
In the link below I have modified the image itself but would like to just display a little image with the red dot next to it.
Any ideas? Should I do this manually?
See link below:
http://art.hagoole.com.au/products.php?q=Annalena
Hi,
No problem - within the main part of html/product.php, you can simply add code as follows:
<?php
if ($mainProduct["sold"] == "Yes")
{
print "<img src='/images/sold.gif' />";
}
?>
To make this appear alongside the main image, look for the following code starting at line 6:
<?php if ($mainProduct["image_url"]): ?>
<img width='180' src='<?php print $mainProduct["image_url"]; ?>' alt='<?php print $mainProduct["name"]; ?>' />
<?php endif; ?>
...and then insert the code above immediately afterward...
Cheers,
David.