CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • if condition not working in smarty template
Pages: [1]

Author Topic: if condition not working in smarty template  (Read 671 times)

ashok

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7
  • MySQL version: 5.5.24
  • PHP version: 5.3.10
if condition not working in smarty template
February 06, 2014, 12:06:35 am
Hi,
It is a strange thing that eq / == is not working in one of the template files.
my code looks like
{if $paymentProcessor.name eq 'MyPaymentProcessor'}
do something
{/if}

I tried printing {$paymentProcesso.name} which prints MyPaymentProcessor, no problem there.

I tried all the combinations of comparison operator (eq/EQ/==) but strangely none of them seems to be working.

Anybody have any ideas why eq operator is not working?

Thanks,
Negi

Rajesh

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 10
  • CiviCRM version: 4.2.x, 4.3.x, 4.4.x
  • CMS version: Drupal 7.xx, Wordpress 3.5.x - 3.6.x, Joomla 3.1
  • MySQL version: 5.5.20
  • PHP version: 5.3.10
Re: if condition not working in smarty template
February 06, 2014, 03:53:03 am
'eq'  comparison operator works fine.

Can you check your variable name in your script? Seems its different in the If condition from the one you printed.

- Rajesh

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • if condition not working in smarty template

This forum was archived on 2017-11-26.