Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
opentype Posted March 12, 2022 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
IPCommerceFan Posted March 12, 2022 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
Adriano Faria Posted March 12, 2022 Posted March 12, 2022 (edited) Probably $item->description() or ->content() will do it. Not tested. Edited March 12, 2022 by Adriano Faria opentype 1
Recommended Posts