Hi Dave,
I been trying to add some code on the product page to check if the product description is under 100 charactors in length to print a deafault description and also is the description field is empty to print default description this what i got but its not working?
<?php if (count(count_chars($mainProduct["description"], 1)) < 20)
{
print $default_desc;
}
elseif ($mainProduct["description"] = NULL)
{
print $default_desc;
} else {
print $mainProduct["description"];
} ?>
Kind Regards
Darren
Hi Darren,
A single test should cover both scenarios (as description defaults to "" rather than NULL) - have a go with:
<?php
if (strlen($mainProduct["description"]) < 100)
{
print $default_desc;
}
else
{
print $mainProduct["description"];
}
?>
Cheers,
David.