title: Magento - Add custom Filter options (dropdown) for payment method
body: <p>I have a module that adds a <strong>payment method</strong> column to the Sales > Orders grid. </p>
  
  <pre><code>$this-&gt;addColumn('method', array(
                  'header' =&gt; Mage::helper('sales')-&gt;__('Payment&lt;br /&gt;Method'),
                  'index' =&gt; 'method',
                  'renderer'  =&gt; 'Artizara_Ordergridadditions_Block_Catalog_Product_Renderer_Payment',
                  'filter_index' =&gt; 'sfop.method', // refers to a declaration above
                  type'  =&gt; 'options',
                  'options' =&gt; array(0=&gt;'Option 1',1=&gt;'Option2'), // how would I get the keys to match to the renderer options???
          ));
  </code></pre>
  
  <p>Renderer code (below):</p>
  
  <pre><code>public function render(Varien_Object $row) {
      $value =  $row-&gt;getData($this-&gt;getColumn()-&gt;getIndex());
  
      switch ($value) {
      case 'authorizenet':
          $value = 'Credit Card (Authorize.net)';
          $span = '';
          break;
      case 'paypal_express':
          $value = 'Paypal Express';
          $span = '';
          break;
      case 'checkmo':
          $value = 'Check/Money Order';
          $span = '';
          break;
      case 'free':
          $value = 'No Payment Required';
          $span = '';
          break;
      default:
          $value = 'Unknow Payment Method';
          $span = 'style="color:red;"';
      }
  
      return '&lt;span ' . $span . '&gt;' . $value . '&lt;/span&gt;';
  }
  </code></pre>
  
  <p>Simply want to be able to make a <strong>dropdown prepopulated with the renderer options</strong> for <strong><em>filtering</em></strong> in the grid. </p>
  
  <p><strong>Note:</strong> If I add the text field method for filtering, you have to put in the original keys from the database (e.g. - checkmo, paypal_express, authorizenet, etc). </p>
  
  <p>I'd like to be able to show the renderer values for each in the dropdown...(how)?</p>
  
  <p><strong>EDIT 7/20/12</strong></p>
  
  <p>I've tried two following ways below but not working yet...</p>
  
  <pre><code>'options' =&gt; array(
                      array('value' =&gt; 'authorizenet', 'label' =&gt; 'Credit Card (Authorize.net)'),
                      array('value' =&gt; 'paypal_express', 'label' =&gt; 'Paypal Express'),
                      array('value' =&gt; 'checkmo', 'label' =&gt; 'Check/Money Order'),
                      array('value' =&gt; 'free', 'label' =&gt; 'No Payment Required'),
                  ),
  </code></pre>
  
  <p>Just gets me a dropdown populated with 4 options as follows:</p>
  
  <pre><code>Array
  Array
  Array
  Array
  </code></pre>
  
  <p>I've tried it also like this:</p>
  
  <pre><code>'options' =&gt; array(
                      array =&gt; ('value' =&gt; 'authorizenet', 'label' =&gt; 'Credit Card (Authorize.net)'),
                      array =&gt; ('value' =&gt; 'paypal_express', 'label' =&gt; 'Paypal Express'),
                      array =&gt; ('value' =&gt; 'checkmo', 'label' =&gt; 'Check/Money Order'),
                      array =&gt; ('value' =&gt; 'free', 'label' =&gt; 'No Payment Required'),
                  ),
  </code></pre>
  
  <p>But I get an error:</p>
  
  <p><code>Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting '('</code></p>