Exemplo n.º 1
0
 public function _toHtml()
 {
     $script = '<script type="text/javascript">
                 if(typeof(jQueryIWD) == "undefined"){if(typeof(jQuery) != "undefined") {jQueryIWD = jQuery;}} $ji = jQueryIWD;
                 if($ji("#customer_orders_grid_table").length) {
                     IWD.OrderManager.Grid.ColorGridRow();
                     if($ji.isFunction($ji.fn.stickyTableHeaders)){$ji("#customer_orders_grid_table").stickyTableHeaders();}
                 }
              </script>';
     return parent::_toHtml() . $script;
 }
Exemplo n.º 2
0
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     $_39cc59a647aed4446ab8f3ef32b7135f664a845f = Mage::getModel('sublogin/sublogin')->getCollection();
     if (Mage::registry('current_customer')->getId()) {
         $_39cc59a647aed4446ab8f3ef32b7135f664a845f->addFieldToFilter('entity_id', Mage::registry('current_customer')->getId());
     }
     $_18254cfced00997c538772b34da78f09931948f4 = array();
     foreach ($_39cc59a647aed4446ab8f3ef32b7135f664a845f as $_17fe0f58f521a1d8d613a93097a5a22f2074c04f) {
         $_18254cfced00997c538772b34da78f09931948f4[$_17fe0f58f521a1d8d613a93097a5a22f2074c04f->getId()] = $_17fe0f58f521a1d8d613a93097a5a22f2074c04f->getEmail();
     }
     $this->addColumnAfter('sublogin_id', array('header' => Mage::helper('customer')->__('Sublogin Email'), 'index' => 'sublogin_id', 'type' => 'options', 'options' => $_18254cfced00997c538772b34da78f09931948f4), 'created_at');
     $this->sortColumnsByOrder();
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Prepare columns for orders grid in customer account (Admin side)
  *
  * @return $this
  * @throws Exception
  */
 protected function _prepareColumns()
 {
     $helper = Mage::helper('mageworx_orderspro');
     if (!$helper->isEnabled()) {
         return parent::_prepareColumns();
     }
     $listColumns = $helper->getCustomerGridColumns();
     //$currencyCode = $helper->getCurrentCurrencyCode();
     foreach ($listColumns as $column) {
         switch ($column) {
             // standard fields
             case 'increment_id':
                 $this->addColumn('increment_id', array('header' => Mage::helper('customer')->__('Order #'), 'width' => '80px', 'type' => 'text', 'index' => 'increment_id'));
                 break;
             case 'created_at':
                 $this->addColumn('created_at', array('header' => Mage::helper('customer')->__('Purchase On'), 'index' => 'created_at', 'type' => 'datetime', 'width' => '100px'));
                 break;
             case 'billing_name':
                 $this->addColumn('billing_name', array('header' => Mage::helper('customer')->__('Bill to Name'), 'index' => 'billing_name'));
                 break;
             case 'shipping_name':
                 $this->addColumn('shipping_name', array('header' => Mage::helper('customer')->__('Shiped to Name'), 'index' => 'shipping_name'));
                 break;
             case 'grand_total':
                 $this->addColumn('grand_total', array('header' => Mage::helper('customer')->__('Order Total'), 'index' => 'grand_total', 'type' => 'currency', 'currency' => 'order_currency_code'));
                 break;
             case 'store_id':
                 if (!Mage::app()->isSingleStoreMode()) {
                     $this->addColumn('store_id', array('header' => Mage::helper('customer')->__('Bought From'), 'index' => 'store_id', 'type' => 'store', 'store_view' => true));
                 }
                 break;
             case 'action':
                 $this->addColumn('action', array('header' => ' ', 'filter' => false, 'sortable' => false, 'width' => '100px', 'renderer' => 'adminhtml/sales_reorder_renderer_action'));
                 break;
                 // additional fields
             // additional fields
             case 'product_names':
                 $this->addColumn('product_names', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_products', 'header' => $helper->__('Product Name(s)') . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'index' => 'product_names'));
                 break;
             case 'product_skus':
                 $this->addColumn('product_skus', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_products', 'header' => $helper->__('SKU(s)'), 'index' => 'skus'));
                 break;
             case 'product_options':
                 $this->addColumn('product_options', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_products', 'header' => $helper->__('Product Option(s)'), 'index' => 'product_options', 'filter' => false, 'sortable' => false));
                 break;
             case 'customer_email':
                 $this->addColumn('customer_email', array('type' => 'text', 'header' => $helper->__('Customer Email'), 'index' => 'customer_email'));
                 break;
             case 'customer_group':
                 $this->addColumn('customer_group', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getCustomerGroups(), 'header' => $helper->__('Customer Group'), 'index' => 'customer_group_id', 'align' => 'center'));
                 break;
             case 'payment_method':
                 $this->addColumn('payment_method', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getAllPaymentMethods(), 'header' => $helper->__('Payment Method'), 'index' => 'method', 'align' => 'center'));
                 break;
             case 'base_total_refunded':
                 $this->addColumn('base_total_refunded', array('type' => 'currency', 'currency' => 'base_currency_code', 'header' => $helper->__('Total Refunded (Base)'), 'index' => 'base_total_refunded', 'total' => 'sum'));
                 break;
             case 'total_refunded':
                 $this->addColumn('total_refunded', array('type' => 'currency', 'currency' => 'order_currency_code', 'header' => $helper->__('Total Refunded (Purchased)'), 'index' => 'total_refunded', 'total' => 'sum'));
                 break;
             case 'shipping_method':
                 $this->addColumn('shipping_method', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getAllShippingMethods(), 'filter' => 'mageworx_orderspro/adminhtml_sales_order_grid_filter_shipping', 'header' => $helper->__('Shipping Method'), 'index' => 'shipping_method', 'align' => 'center'));
                 break;
             case 'tracking_number':
                 $this->addColumn('tracking_number', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_street', 'type' => 'text', 'header' => $helper->__('Tracking Number'), 'index' => 'tracking_number'));
                 break;
             case 'shipped':
                 $this->addColumn('shipped', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getShippedStatuses(), 'header' => $helper->__('Shipped'), 'index' => 'shipped', 'align' => 'center'));
                 break;
             case 'order_group':
                 $this->addColumn('order_group', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getOrderGroups(), 'header' => $helper->__('Group'), 'index' => 'order_group_id', 'align' => 'center'));
                 break;
             case 'qnty':
                 $this->addColumn('qnty', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_qnty', 'filter' => false, 'sortable' => false, 'header' => $helper->__('Qnty'), 'index' => 'total_qty'));
                 break;
             case 'weight':
                 $this->addColumn('weight', array('type' => 'number', 'header' => $helper->__('Weight'), 'index' => 'weight'));
                 break;
             case 'base_tax_amount':
                 $this->addColumn('base_tax_amount', array('type' => 'currency', 'currency' => 'base_currency_code', 'header' => $helper->__('Tax Amount (Base)'), 'index' => 'base_tax_amount'));
                 break;
             case 'tax_amount':
                 $this->addColumn('tax_amount', array('type' => 'currency', 'currency' => 'order_currency_code', 'header' => $helper->__('Tax Amount (Purchased)'), 'index' => 'tax_amount'));
                 break;
             case 'base_discount_amount':
                 $this->addColumn('base_discount_amount', array('type' => 'currency', 'currency' => 'base_currency_code', 'header' => $helper->__('Discount (Base)'), 'index' => 'base_discount_amount'));
                 break;
             case 'discount_amount':
                 $this->addColumn('discount_amount', array('type' => 'currency', 'currency' => 'order_currency_code', 'header' => $helper->__('Discount (Purchased)'), 'index' => 'discount_amount'));
                 break;
             case 'base_internal_credit':
                 if (Mage::getConfig()->getModuleConfig('MageWorx_CustomerCredit')->is('active', true)) {
                     $this->addColumn('base_internal_credit', array('type' => 'currency', 'currency' => 'base_currency_code', 'header' => $helper->__('Internal Credit (Base)'), 'index' => 'base_customer_credit_amount'));
                 }
                 break;
             case 'internal_credit':
                 if (Mage::getConfig()->getModuleConfig('MageWorx_CustomerCredit')->is('active', true)) {
                     $this->addColumn('internal_credit', array('type' => 'currency', 'currency' => 'order_currency_code', 'header' => $helper->__('Internal Credit (Purchased)'), 'index' => 'customer_credit_amount'));
                 }
                 break;
             case 'coupon_code':
                 $this->addColumn('coupon_code', array('type' => 'text', 'header' => $helper->__('Coupon Code'), 'align' => 'center', 'index' => 'coupon_code'));
                 break;
             case 'is_edited':
                 $this->addColumn('is_edited', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_registry', 'type' => 'options', 'options' => $helper->getEditedStatuses(), 'header' => $helper->__('Edited'), 'index' => 'is_edited', 'align' => 'center'));
                 break;
             case 'status':
                 $this->addColumn('status', array('header' => Mage::helper('sales')->__('Status'), 'index' => 'status', 'type' => 'options', 'width' => '70px', 'options' => Mage::getSingleton('sales/order_config')->getStatuses()));
                 break;
             case 'order_comment':
                 $this->addColumn('order_comment', array('renderer' => 'mageworx_orderspro/adminhtml_sales_order_grid_renderer_comments', 'header' => $helper->__('Order Comment(s)'), 'index' => 'order_comment'));
                 break;
         }
     }
     $this->sortColumnsByOrder();
     return $this;
 }
Exemplo n.º 4
0
 protected function _prepareColumns()
 {
     $enabledCustomGrid = Mage::getStoreConfig('orderview/general/enabled');
     if (isset($enabledCustomGrid) && $enabledCustomGrid == 1) {
         $selectedColumns = Mage::getStoreConfig('orderview/general/order_grid_col');
         $selectedColumnsArray = explode(",", $selectedColumns);
         /* Active payment methods*/
         $payments = Mage::getSingleton('payment/config')->getActiveMethods();
         $methods = array();
         foreach ($payments as $paymentCode => $paymentModel) {
             $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title');
             $methods[$paymentCode] = $paymentTitle;
         }
         /* Active payment methods ends*/
         foreach ($selectedColumnsArray as $orderColumn) {
             switch ($orderColumn) {
                 case 'real_order_id':
                     $this->addColumn('real_order_id', array('header' => Mage::helper('sales')->__('Order #'), 'width' => '80px', 'type' => 'text', 'index' => 'increment_id'));
                     break;
                 case 'store_id':
                     if (!Mage::app()->isSingleStoreMode()) {
                         $this->addColumn('store_id', array('header' => Mage::helper('sales')->__('Purchased From (Store)'), 'index' => 'store_id', 'type' => 'store', 'store_view' => true, 'display_deleted' => true));
                     }
                     break;
                 case 'created_at':
                     $this->addColumn('created_at', array('header' => Mage::helper('sales')->__('Purchased On'), 'index' => 'created_at', 'type' => 'datetime', 'width' => '100px'));
                     break;
                 case 'product_detail':
                     $this->addColumn('name', array('header' => Mage::helper('catalog')->__('Product Name'), 'index' => 'name', 'type' => 'text', 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Customertarget()));
                     break;
                 case 'product_options':
                     $this->addColumn('product_options', array('header' => Mage::helper('sales')->__('Product Option(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'), 'type' => 'text', 'width' => '1550px', 'index' => 'product_options', 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Options()));
                     break;
                 case 'product_sku':
                     $this->addColumn('sku', array('header' => Mage::helper('sales')->__('SKU'), 'index' => 'sku', 'type' => 'text'));
                     break;
                 case 'qty':
                     $this->addColumn('qty', array('header' => Mage::helper('sales')->__('Quantity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'), 'index' => 'qty', 'type' => 'text', 'filter' => false, 'sortable' => false, 'width' => '150px', 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Quantity()));
                     break;
                 case 'weight':
                     $this->addColumn('weight', array('header' => Mage::helper('sales')->__('Weight'), 'index' => 'weight', 'type' => 'number', 'filter_index' => 'sales_flat_order.weight'));
                     break;
                 case 'payment_method':
                     $this->addColumn('method', array('header' => Mage::helper('sales')->__('Payment Method'), 'index' => 'method', 'type' => 'options', 'width' => '70px', 'options' => $methods));
                     break;
                 case 'shipping_method':
                     $this->addColumn('shipping_method', array('type' => 'options', 'options' => $this->getAvailableShippingMethods(), 'header' => Mage::helper('sales')->__('Shipping Method'), 'index' => 'shipping_method', 'align' => 'center'));
                     break;
                 case 'customer_email':
                     $this->addColumn('customer_email', array('type' => 'text', 'header' => Mage::helper('sales')->__('Customer Email'), 'index' => 'customer_email'));
                     break;
                 case 'customer_group':
                     $this->addColumn('customer_group_id', array('type' => 'options', 'options' => $this->getCustomerGroup(), 'header' => Mage::helper('sales')->__('Customer Group'), 'index' => 'customer_group_id'));
                     break;
                 case 'coupon_code':
                     $this->addColumn('coupon_code', array('type' => 'text', 'header' => Mage::helper('sales')->__('Coupon Code'), 'align' => 'center', 'index' => 'coupon_code'));
                     break;
                 case 'billing_name':
                     $this->addColumn('billing_name', array('header' => Mage::helper('sales')->__('Bill to Name'), 'index' => 'billing_name'));
                     break;
                 case 'billing_company':
                     $this->addColumn('company', array('header' => Mage::helper('sales')->__('Bill Company'), 'index' => 'company', 'filter_index' => 'sfoab.company'));
                     break;
                 case 'billing_street':
                     $this->addColumn('street', array('header' => Mage::helper('sales')->__('Bill Street'), 'index' => 'street', 'filter_index' => 'sfoab.street'));
                     break;
                 case 'billing_postcode':
                     $this->addColumn('postcode', array('header' => Mage::helper('sales')->__('Bill Postcode'), 'index' => 'postcode', 'filter_index' => 'sfoab.postcode'));
                     break;
                 case 'billing_state':
                     $this->addColumn('region', array('header' => Mage::helper('sales')->__('Bill Region'), 'index' => 'region', 'filter_index' => 'sfoab.region'));
                     break;
                 case 'billing_country':
                     $this->addColumn('country_id', array('type' => 'country', 'header' => Mage::helper('sales')->__('Bill Country'), 'index' => 'country_id', 'filter_index' => 'sfoab.country_id'));
                     break;
                 case 'shipping_name':
                     $this->addColumn('shipping_name', array('header' => Mage::helper('sales')->__('Ship to Name'), 'index' => 'shipping_name'));
                     break;
                 case 'shipping_company':
                     $this->addColumn('shipcompany', array('header' => Mage::helper('sales')->__('Ship Company'), 'index' => 'shipcompany', 'filter_index' => 'sfoas.company'));
                     break;
                 case 'shipping_street':
                     $this->addColumn('shipstreet', array('header' => Mage::helper('sales')->__('Ship Street'), 'index' => 'shipstreet', 'filter_index' => 'sfoas.street'));
                     break;
                 case 'shipping_postcode':
                     $this->addColumn('shippostcode', array('header' => Mage::helper('sales')->__('Ship Postcode'), 'index' => 'shippostcode', 'filter_index' => 'sfoas.postcode'));
                     break;
                 case 'shipping_state':
                     $this->addColumn('shipregion', array('header' => Mage::helper('sales')->__('Ship Region'), 'index' => 'shipregion', 'filter_index' => 'sfoas.region'));
                     break;
                 case 'shipping_country':
                     $this->addColumn('shipcountry_id', array('type' => 'country', 'header' => Mage::helper('sales')->__('Ship Country'), 'index' => 'shipcountry_id', 'filter_index' => 'sfoas.country_id'));
                     break;
                 case 'base_tax_amount':
                     $this->addColumn('base_tax_amount', array('header' => Mage::helper('sales')->__('Tax (Base)'), 'index' => 'base_tax_amount', 'type' => 'currency', 'currency' => 'base_currency_code'));
                     break;
                 case 'tax_amount':
                     $this->addColumn('tax_amount', array('header' => Mage::helper('sales')->__('Tax (Purchased)'), 'index' => 'tax_amount', 'type' => 'currency', 'currency' => 'order_currency_code'));
                     break;
                 case 'base_discount_amount':
                     $this->addColumn('base_discount_amount', array('header' => Mage::helper('sales')->__('Discount (Base)'), 'index' => 'base_discount_amount', 'type' => 'currency', 'currency' => 'base_currency_code'));
                     break;
                 case 'discount_amount':
                     $this->addColumn('discount_amount', array('header' => Mage::helper('sales')->__('Discount (Purchased)'), 'index' => 'discount_amount', 'type' => 'currency', 'currency' => 'order_currency_code'));
                     break;
                 case 'base_total_refunded':
                     $this->addColumn('base_total_refunded', array('header' => Mage::helper('sales')->__('Total Refunded (Base)'), 'index' => 'base_total_refunded', 'type' => 'currency', 'currency' => 'base_currency_code'));
                     break;
                 case 'total_refunded':
                     $this->addColumn('total_refunded', array('header' => Mage::helper('sales')->__('Total Refunded (Purchased)'), 'index' => 'total_refunded', 'type' => 'currency', 'currency' => 'order_currency_code'));
                     break;
                 case 'base_grand_total':
                     $this->addColumn('base_grand_total', array('header' => Mage::helper('sales')->__('G.T. (Base)'), 'index' => 'base_grand_total', 'type' => 'currency', 'currency' => 'base_currency_code'));
                     break;
                 case 'grand_total':
                     $this->addColumn('grand_total', array('header' => Mage::helper('sales')->__('G.T. (Purchased)'), 'index' => 'grand_total', 'type' => 'currency', 'currency' => 'order_currency_code'));
                     break;
                 case 'status':
                     $this->addColumn('status', array('header' => Mage::helper('sales')->__('Status'), 'index' => 'status', 'type' => 'options', 'width' => '70px', 'options' => Mage::getSingleton('sales/order_config')->getStatuses()));
                     break;
                 case 'tracking_number':
                     $this->addColumn('tracking_number', array('header' => Mage::helper('catalog')->__('Tracking Number'), 'index' => 'tracking_number', 'filter' => false, 'sortable' => false, 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Tracking()));
                     break;
                 case 'order_type':
                     $orderGroups = array('1' => 'Archived', '0' => 'Active');
                     $this->addColumn('is_archieved', array('type' => 'options', 'options' => $orderGroups, 'header' => Mage::helper('sales')->__('Order Type'), 'index' => 'is_archieved', 'filter_index' => 'main_table.is_archieved', 'align' => 'center'));
                     break;
                     /*case 'order_invoiced':
                     		$orderInvoiced = array('1'=>'Yes','0'=>'No');		
                     		$this->addColumn('total_invoiced', array(                            
                     				'type'  => 'options',
                     				'options' => $orderInvoiced,
                     				'header' => Mage::helper('sales')->__('Invoiced'), 
                     				'index'=>'total_invoiced',
                     				 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Invoiced(), // show comments row
                     				'align' => 'center',
                     				));
                     	  break;
                     	  
                     	  case 'order_refunded':
                     		$orderRefunded = array('1'=>'Yes','0'=>'No');	
                     		$this->addColumn('total_refunded', array(                            
                     				'type'  => 'options',
                     				'options' => $orderRefunded,
                     				'header' => Mage::helper('sales')->__('Refunded'), 
                     				'index'=>'total_refunded',
                     				'align' => 'center',
                     				));
                     	  break;*/
                 /*case 'order_invoiced':
                 		$orderInvoiced = array('1'=>'Yes','0'=>'No');		
                 		$this->addColumn('total_invoiced', array(                            
                 				'type'  => 'options',
                 				'options' => $orderInvoiced,
                 				'header' => Mage::helper('sales')->__('Invoiced'), 
                 				'index'=>'total_invoiced',
                 				 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Invoiced(), // show comments row
                 				'align' => 'center',
                 				));
                 	  break;
                 	  
                 	  case 'order_refunded':
                 		$orderRefunded = array('1'=>'Yes','0'=>'No');	
                 		$this->addColumn('total_refunded', array(                            
                 				'type'  => 'options',
                 				'options' => $orderRefunded,
                 				'header' => Mage::helper('sales')->__('Refunded'), 
                 				'index'=>'total_refunded',
                 				'align' => 'center',
                 				));
                 	  break;*/
                 case 'is_edited':
                     $isEdited = array('1' => 'Yes', '0' => 'No');
                     $this->addColumn('is_edit', array('type' => 'options', 'options' => $isEdited, 'header' => Mage::helper('sales')->__('Is Edited'), 'index' => 'is_edit', 'filter_index' => 'main_table.is_edit', 'align' => 'center'));
                     break;
                 case 'comments':
                     $this->addColumn('comment', array('type' => 'text', 'header' => Mage::helper('sales')->__('Comment(s)'), 'index' => 'comment', 'align' => 'center', 'renderer' => new Magedev_Ordermanager_Block_Adminhtml_Ordermanager_Grid_Renderer_Comments()));
                     break;
                 case 'edit_reason':
                     $this->addColumn('edit_comments', array('type' => 'text', 'header' => Mage::helper('sales')->__('Order Note'), 'index' => 'edit_comments', 'filter_index' => 'main_table.edit_comments', 'align' => 'center'));
                     break;
                 case 'action':
                     if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
                         $this->addColumn('action', array('header' => Mage::helper('sales')->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => Mage::helper('sales')->__('Re-Order'), 'url' => array('base' => '*/sales_order/view'), 'field' => 'order_id')), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true));
                     }
                     break;
             }
         }
         $this->sortColumnsByOrder();
         return $this;
     } else {
         return parent::_prepareColumns();
     }
 }