导出到“CSV”在销售中不可见 - >订购

时间:2014-07-15 07:53:11

标签: php magento magento-1.7 export-to-excel

我使用的是Magento 1.7.0.2和管理员 - >销售 - >订单,我没有看到“导出到:CSV”按钮。我想弄清楚这个按钮的位置。如果有任何开发人员知道这一点,

是否有配置或是否<block>无法正确配置?

请帮帮我。谢谢

以下是<?php Zend_Debug::dump($this->getExportTypes()) ?>

的输出
array(2) {
  [0] => object(Varien_Object)#480 (7) {
    ["_data":protected] => array(2) {
      ["url"] => string(59) "http://192.168.1.24/index.php/admins/sales_order/exportCsv/"
      ["label"] => string(3) "CSV"
    }
    ["_hasDataChanges":protected] => bool(false)
    ["_origData":protected] => NULL
    ["_idFieldName":protected] => NULL
    ["_isDeleted":protected] => bool(false)
    ["_oldFieldsMap":protected] => array(0) {
    }
    ["_syncFieldsMap":protected] => array(0) {
    }
  }
  [1] => object(Varien_Object)#584 (7) {
    ["_data":protected] => array(2) {
      ["url"] => string(61) "http://192.168.1.24/index.php/admins/sales_order/exportExcel/"
      ["label"] => string(9) "Excel XML"
    }
    ["_hasDataChanges":protected] => bool(false)
    ["_origData":protected] => NULL
    ["_idFieldName":protected] => NULL
    ["_isDeleted":protected] => bool(false)
    ["_oldFieldsMap":protected] => array(0) {
    }
    ["_syncFieldsMap":protected] => array(0) {
    }
  }
}

1 个答案:

答案 0 :(得分:1)

&#39;导出到&#39;按钮添加在app/design/adminhtml/default/default/template/widget/grid.phtml第98-108行:

<?php if($this->getExportTypes()): ?>
    <td class="export a-right">
        <img src="<?php echo $this->getSkinUrl('images/icon_export.gif') ?>" alt="" class="v-middle"/>&nbsp; <?php echo $this->__('Export to:') ?>
        <select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" style="width:8em;">
        <?php foreach ($this->getExportTypes() as $_type): ?>
            <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option>
        <?php endforeach; ?>
        </select>
        <?php echo $this->getExportButtonHtml() ?>
    </td>
<?php endif; ?>

检查文件中是否包含此代码。它应放在:

之前
<td class="filter-actions a-right">
    <?php echo $this->getMainButtonsHtml() ?>
</td>

另外:$this->getExportTypes()(第98行)必须返回true才能显示导出按钮。