View Single Post
  #4  
Old 11-10-2013, 06:38 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: PHP Code in template to use date function?

Quote:
Originally Posted by jcorneli
{elseif $smarty.now|date_format:%A <> 'Dec'}
There are a few things horribly wrong with this snippet of code. First off, you can't use mathematical comparison operators on strings. You would only use less than or greater than comparisons on integers (numbers).

Second, you don't usually make two comparisons at once. You have less than/greater than, it would need to be is variable less than or is variable greater than.

I don;t see why you need the else if. Just say If = Dec do this else do this. If it is not december the else would fire.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote