Magento Module: SKUs by Coupon Report

A built-in reporting tool that provides SKU-level data for coupon usage.


This module was developed to provide a custom report on SKUs purchased by coupon code. By selecting a date range and a coupon code, the merchant can generate a report of all SKUs purchased with that coupon. This report was built on top of native Magento reporting tools, employing a consistent interface and filter options.


Generating reports

Technical Features

Code Sample

protected function _initSelect()
    $filterData = Mage::registry('groove_filter_data');

    if (!$filterData) {
        $filterData = new Varien_Object();

            array('main_table' => $this->getResource()->getMainTable()),
            array('sfo' => Mage::getSingleton('core/resource')->getTableName('sales/order')),
            'main_table.order_id = sfo.entity_id',

    if ($filterData->getCoupon()) {
            ->where('sfo.coupon_code = ?', $filterData->getCoupon());

    if ($this->isSubTotals()) {
    } else if (!$this->isTotals()) {

    return $this;

Static Analysis