View Single Post
  #7  
Old 08-02-2007, 04:20 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Conditional Test for Text String

for the first condition remove the first $sales since its redundant...you check if an array exists and you call an array index

as for your main question, use
Code:
$sales[sale].name|truncate:5:"":true
this replaces the ellipses with a null string and truncates at exactly 5 characters instead of at the end of a word

if you use just truncate:5, what happens is that the string will get truncated to 5 characters INCLUDING the ellipses, ie: "Buy 3 blahblahblah" gets truncated to "Bu..." and fails the comparison to "Buy 3"
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote