2

I have a custom report based on the tutorial at http://wrightcreativelabs.com/create-a-custom-magento-report-product-skus-in-new-orders/. The report is working well as is. Now I'm trying to add a customer comments column to the report. The customer comments are coming from the One Page Checkout extension. I have the column added with:

    $this->addColumn('comment', array(
        'header' => Mage::helper('reportneworders')->__('Special Instructions'),
        'align' => 'left',
        'sortable' => false,
        'index' => 'comment'
    ));

The problem is in the collection. The gift message works, but when the comment is added, the report is broken. I know I must be using the wrong id or reference to the comment.

    ->joinLeft(
            array('c' => 'order_comment'),
                  'c.order_comment = order_items.order_comment',
                  array(
                          'comment' => 'comment'
                  ))

    ->joinLeft(
            array('g' => 'gift_message'),
                  'g.gift_message_id = order_items.gift_message_id',
                  array(
                          'message' => 'message'
                  ))

The One Page Checkout textarea for the comment looks like this:

<textarea name="order-comment" id="order-comment"><?php echo trim(Mage::getSingleton('customer/session')->getOrderCustomerComment()) ?></textarea>

I appreciate any advice.

0 Answers0