예제 #1
0
 /**
  * @return \Magento\Backend\Block\Widget\Grid\Extended
  */
 protected function _prepareColumns()
 {
     $this->addColumn('entity_id', ['header' => __('ID'), 'align' => 'right', 'index' => 'entity_id', 'header_css_class' => 'col-id', 'column_css_class' => 'col-id']);
     $this->addColumn('name', ['header' => __('Product'), 'index' => 'name', 'header_css_class' => 'col-product', 'column_css_class' => 'col-product']);
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('price', ['header' => __('Price'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'price', 'renderer' => 'Magento\\Reports\\Block\\Adminhtml\\Grid\\Column\\Renderer\\Currency', 'rate' => $this->getRate($currencyCode), 'header_css_class' => 'col-price', 'column_css_class' => 'col-price']);
     $this->addColumn('carts', ['header' => __('Carts'), 'align' => 'right', 'index' => 'carts', 'header_css_class' => 'col-carts', 'column_css_class' => 'col-carts']);
     $this->addColumn('orders', ['header' => __('Orders'), 'align' => 'right', 'index' => 'orders', 'header_css_class' => 'col-qty', 'column_css_class' => 'col-qty']);
     $this->setFilterVisibility(false);
     $this->addExportType('*/*/exportProductCsv', __('CSV'));
     $this->addExportType('*/*/exportProductExcel', __('Excel XML'));
     return parent::_prepareColumns();
 }
예제 #2
0
 /**
  * @return \Magento\Backend\Block\Widget\Grid\Extended
  */
 protected function _prepareColumns()
 {
     $this->addColumn('entity_id', ['header' => __('ID'), 'width' => '50px', 'align' => 'right', 'index' => 'entity_id']);
     $this->addColumn('firstname', ['header' => __('First Name'), 'index' => 'firstname']);
     $this->addColumn('lastname', ['header' => __('Last Name'), 'index' => 'lastname']);
     $this->addColumn('items', ['header' => __('Items in Cart'), 'width' => '70px', 'sortable' => false, 'align' => 'right', 'index' => 'items']);
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('total', ['header' => __('Total'), 'width' => '70px', 'sortable' => false, 'type' => 'currency', 'align' => 'right', 'currency_code' => $currencyCode, 'index' => 'total', 'renderer' => 'Magento\\Reports\\Block\\Adminhtml\\Grid\\Column\\Renderer\\Currency', 'rate' => $this->getRate($currencyCode)]);
     $this->setFilterVisibility(false);
     $this->addExportType('*/*/exportCustomerCsv', __('CSV'));
     $this->addExportType('*/*/exportCustomerExcel', __('Excel XML'));
     return parent::_prepareColumns();
 }
예제 #3
0
파일: Grid.php 프로젝트: aiesh/magento2
 /**
  * @return \Magento\Backend\Block\Widget\Grid\Extended
  */
 protected function _prepareColumns()
 {
     $this->addColumn('customer_name', array('header' => __('Customer'), 'index' => 'customer_name', 'sortable' => false, 'header_css_class' => 'col-name', 'column_css_class' => 'col-name'));
     $this->addColumn('email', array('header' => __('Email'), 'index' => 'email', 'sortable' => false, 'header_css_class' => 'col-email', 'column_css_class' => 'col-email'));
     $this->addColumn('items_count', array('header' => __('Products'), 'index' => 'items_count', 'sortable' => false, 'type' => 'number', 'header_css_class' => 'col-number', 'column_css_class' => 'col-number'));
     $this->addColumn('items_qty', array('header' => __('Quantity'), 'index' => 'items_qty', 'sortable' => false, 'type' => 'number', 'header_css_class' => 'col-qty', 'column_css_class' => 'col-qty'));
     if ($this->getRequest()->getParam('website')) {
         $storeIds = $this->_storeManager->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
     } else {
         if ($this->getRequest()->getParam('group')) {
             $storeIds = $this->_storeManager->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
         } else {
             if ($this->getRequest()->getParam('store')) {
                 $storeIds = array((int) $this->getRequest()->getParam('store'));
             } else {
                 $storeIds = array();
             }
         }
     }
     $this->setStoreIds($storeIds);
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('subtotal', array('header' => __('Subtotal'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'subtotal', 'sortable' => false, 'renderer' => 'Magento\\Reports\\Block\\Adminhtml\\Grid\\Column\\Renderer\\Currency', 'rate' => $this->getRate($currencyCode), 'header_css_class' => 'col-subtotal', 'column_css_class' => 'col-subtotal'));
     $this->addColumn('coupon_code', array('header' => __('Applied Coupon'), 'index' => 'coupon_code', 'sortable' => false, 'header_css_class' => 'col-coupon', 'column_css_class' => 'col-coupon'));
     $this->addColumn('created_at', array('header' => __('Created'), 'type' => 'datetime', 'index' => 'created_at', 'filter_index' => 'main_table.created_at', 'sortable' => false, 'header_css_class' => 'col-created', 'column_css_class' => 'col-created'));
     $this->addColumn('updated_at', array('header' => __('Updated'), 'type' => 'datetime', 'index' => 'updated_at', 'filter_index' => 'main_table.updated_at', 'sortable' => false, 'header_css_class' => 'col-updated', 'column_css_class' => 'col-updated'));
     $this->addColumn('remote_ip', array('header' => __('IP Address'), 'index' => 'remote_ip', 'sortable' => false, 'header_css_class' => 'col-ip', 'column_css_class' => 'col-ip'));
     $this->addExportType('*/*/exportAbandonedCsv', __('CSV'));
     $this->addExportType('*/*/exportAbandonedExcel', __('Excel XML'));
     return parent::_prepareColumns();
 }