Hi David,
Is there a way to limit the description on product pages to 300 words, but if the description goes past 300 words there is a link saying "More..." where if the user clicks it, they will be directed to the buy URL in the merchants site (so via jump.php)?
Thanks very much,
Jamie
Thank you very much for the excellent support (and product) you give David - very much appreciated
Hello Jamie,
Sure - in html/product.php look for the following code at line 44:
<p><?php print $product_main["description"]; ?></p>
...and REPLACE with:
<?php if ($product_main["description"]): ?>
<p>
<?php
$limit = 1000;
if (strlen($product_main["description"]) > $limit)
{
print tapestry_substr($product_main["description"],$limit,"<a href='".tapestry_buyURL($product_main)."'>More...</a>");
}
else
{
print $product_main["description"];
}
?>
</p>
<?php endif; ?>
Adjust $limit as required. The tapestry_substr() function is a "tidy" substring method that splits at the next space following the length, with the final parameter being text to append if truncated, in this case the "More..." link as the Buy URL.
Cheers,
David.
--
PriceTapestry.com