0

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.

WordPress Mike
  • 448
  • 2
  • 6
  • 21
  • What you do you mean by 'the report is broken'?? Can you add the details before adding the comment and after adding the comments? – Pavan Kumar Jan 07 '15 at 07:15
  • Sorry I wasn't clear. I meant, the report loads fine until I add the joinLeft for order comments. After I add that joinLeft, the report no longer loads and gives me no error. I think its not the proper way to call or load a comment. – WordPress Mike Jan 07 '15 at 22:17

0 Answers0