I want to create a php if rule, that checks if a attribute got data and is not "zaterdag 1 januari 2000".

If it is not empty or does not have the value "zaterdag 1 januari 2000", it should display some text.

I currently display the attribute with this line:

<?php if($_product->getData('nieuwe_voorraad')) : ?>

How can I achieve that?

  • this is dropdown attribute or input? Jan 11, 2016 at 13:01
  • @QaisarSatti It is a input field.
    – JGeer
    Jan 11, 2016 at 15:45

1 Answer 1


if value is not empty and not equal too

<?php if($_product->getData('nieuwe_voorraad')!="" &&  $_product->getData('nieuwe_voorraad')!='zaterdag 1 januari 2000') : ?>
some text
<?php endif;?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.