Thread: Smarty Vars
View Single Post
  #2  
Old 01-05-2008, 05:44 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Smarty Vars

Here's one way of doing it...

Code:
{php} $foo = $this->get_template_vars( 'product' ); $bar = $foo['product']; $woof = $foo['productcode']; echo "<br />"; echo "$bar"; echo "<br />"; echo "$woof"; echo "<br /><br />"; $findme = 'Cheap'; $look = strpos($bar, $findme); if ($look == false) { echo "The string '$findme' was not found in the string '$bar'"; } else { echo "The string '$findme' was found in the string '$bar'"; echo " and exists at position $look"; } {/php}

There's probably an easier way using smarty alone, I'll keep looking...
__________________
xcartmods.co.uk
Reply With Quote