You are here:  » Custom Product Description Not Folded

Active Forum Topics

Custom Product Description Not Folded

Submitted by DubaiCrazy on Tue, 2016-09-27 18:20 in

When I add in the custom product description, and then go to the product in the live site - it shows the full description. I want it to only show part with the READ MORE function, am I missing something? It works for normal descriptions that are fed from the affiliate feed but not using the custom product description mapping function.



Submitted by support on Wed, 2016-09-28 08:26

Hi Chris,

That's strange - the custom description replaces the feed description at import time, so it shouldn't be treated any differently by the front end. To implement the version used on the demo site, where you have the following code at line 44:

      <p><?php print $product_main["description"]; ?></p>

...REPLACE with:

        $shortDescription = tapestry_substr($product_main["description"],700);
        $shortDescriptionLen = strlen($shortDescription);
        print $shortDescription;
        if ($shortDescriptionLen < strlen($product_main["description"]))
          $hiddenDescription = substr($product_main["description"],$shortDescriptionLen);
          print " <span id='pt_rm' onClick='JavaScript:$(\"#pt_rm\").hide();$(\"#pt_hd\").show();'>[<a>".translate("Read more")."...</a>]</span>";
          print " <span id='pt_hd' style='display:none;'>".$hiddenDescription."</span>";

If that's what you have in place but still not appearing to truncate custom descriptions let me know and I'll check it out further with you..


Submitted by DubaiCrazy on Wed, 2016-09-28 08:58

That's fixed it - thanks David.