php - Magento add a column to backend newsletter gridview -


in magento system, added columns subscriber_firstname , subscriber_lastname newsletter_subscriber db table.

in admin area of magento, want newsletter>newsletter subscribers grid table show:

  • customer first name if exists, otherwise show newsletter_subscriber.subscriber_firstname if exists, otherwise show nothing
  • customer last name if exists, otherwise show newsletter_subscriber.subscriber_lastname if exists, otherwise show nothing

which magento files need edit make work? how go editing files make work?

app/code/core/mage/adminhtml/block/newsletter/subscriber/grid.php

you'll want condition based off if subscriber_firstname or subscriber_lastname have values or not:

    $this->addcolumn('subscribername', array(         'header'    => mage::helper('newsletter')->__('subscriber first name'),         'index'     => 'subscriber_firstname',         'default'   =>    '----'     )); 

also, make sure make copy of core files , not edit them directly!


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -