Filter Null

Permalink
Can anyone help me? I've come code that filters on a particular attribute. It works well, but I need to filter out status' that are null, which doesn't work. What should it be?

<?php if(!$order->getAttribute('catalyst_order_status') || $order->getAttribute('catalyst_order_status') == 'Canceled'){ ?>
                  <div class="alert block-message alert-error">
                 <p><?php echo Config::get('ORDER_CANCEL'); ?></p>
                 </div>
                 <?php }elseif(!$order->getAttribute('catalyst_order_status') || $order->getAttribute('catalyst_order_status') == 'Open'){ ?>
                 <?php }elseif(!$order->getAttribute('catalyst_order_status') || $order->getAttribute('catalyst_order_status') == ''){ ?>
                 <div class="alert-actions">
               </div>   
      <?php } ?>

 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Possibly something like this (Untested)
<?php if(is_object($order)) $attrvalue = $order->getAttribute('catalyst_order_status'); if $attrvalue == 'Canceled'){ ?>
                 <div class="alert block-message alert-error">
                 <p><?php echo Config::get('ORDER_CANCEL'); ?></p>
                 </div>
                 <?php }elseif(is_object($order)) $attrvalue = $order->getAttribute('catalyst_order_status'); if $attrvalue == 'Open'){ ?>
                 <div class="alert-actions">
                 </div>   
<?php } ?>
justynpride replied on at Permalink Reply
Thanks. I’ve put the code in and get the following error:

Parse error: syntax error, unexpected '$attrvalue' (T_VARIABLE), expecting '(' in /home/catalyst/public_html/testsystem/packages/catalyst/single_pages/dashboard/catalyst/orders.php on line 55

Line 55 is the first line of your code. Thoughts?

> On 17 Feb 2018, at 06:52, concrete5 Community <discussions@concretecms.com> wrote: