opentype Posted March 12, 2022 Share Posted March 12, 2022 I am trying to generate a shorter preview text for a Commerce package in a plugin template, but I can’t figure it out. Doing a strip_tags on $item->description has no effect, since the product description is a translatable item. And $item->truncated(), which I see being used in some theme templates doesn’t seem to work from the plugin. (Call to undefined method IPS\nexus\Package\Product::truncated()) Anyone got any ideas? My Sharona 1 Link to comment Share on other sites More sharing options...
IPCommerceFan Posted March 12, 2022 Share Posted March 12, 2022 You could try: $desc = \IPS\Member::loggedIn()->language()->get("nexus_package_{$item->id}_desc"); strip_tags($desc); substr($desc,0,1024); etc opentype 1 Link to comment Share on other sites More sharing options...
Adriano Faria Posted March 12, 2022 Share Posted March 12, 2022 (edited) Probably $item->description() or ->content() will do it. Not tested. Edited March 12, 2022 by Adriano Faria opentype 1 Link to comment Share on other sites More sharing options...
Recommended Posts