当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Event_Observer::getOrderGridCollection方法代码示例

本文整理汇总了PHP中Varien_Event_Observer::getOrderGridCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Event_Observer::getOrderGridCollection方法的具体用法?PHP Varien_Event_Observer::getOrderGridCollection怎么用?PHP Varien_Event_Observer::getOrderGridCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Event_Observer的用法示例。


在下文中一共展示了Varien_Event_Observer::getOrderGridCollection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fillRecommendationColumn

 public function fillRecommendationColumn(Varien_Event_Observer $evt)
 {
     $resource = Mage::getSingleton('core/resource');
     $tabel_nam = $resource->getTableName('score/score');
     $collection = $evt->getOrderGridCollection();
     $collection->getSelect()->joinLeft($tabel_nam . ' as score', 'main_table.entity_id = score.order_no');
 }
开发者ID:bvzdigital,项目名称:magento,代码行数:7,代码来源:Observer.php

示例2: modifyOrderCollection

 /**
  * Join columns to the Orders Collection.
  *
  * @param Varien_Event_Observer $observer
  */
 public function modifyOrderCollection($observer)
 {
     $permissibleActions = array('index', 'grid', 'exportCsv', 'exportExcel');
     if (false === strpos(Mage::app()->getRequest()->getControllerName(), 'sales_order') || !in_array(Mage::app()->getRequest()->getActionName(), $permissibleActions)) {
         return;
     }
     $collection = $observer->getOrderGridCollection();
     $tableNameCustomerEntity = Mage::getSingleton('core/resource')->getTableName('customer_entity');
     $tableNameGuestEntity = Mage::getSingleton('core/resource')->getTableName('amcustomerattr/guest');
     $attributesCollection = Mage::getModel('customer/attribute')->getCollection();
     $filters = array("is_user_defined = 1", "attribute_code != 'customer_activated'");
     $attributesCollection = Mage::helper('amcustomerattr')->addFilters($attributesCollection, 'eav_attribute', $filters);
     $filters = array("used_in_order_grid = 1");
     $attributesCollection = Mage::helper('amcustomerattr')->addFilters($attributesCollection, 'customer_eav_attribute', $filters);
     if ($attributesCollection->getSize() > 0) {
         foreach ($attributesCollection as $attribute) {
             if ($this->_isJoined($collection->getSelect()->getPart('from'), '_table_' . $attribute->getAttributeCode())) {
                 continue;
             }
             $collection->getSelect()->joinLeft(array('_table_' . $attribute->getAttributeCode() => $tableNameCustomerEntity . "_" . $attribute->getBackendType()), "_table_" . $attribute->getAttributeCode() . ".entity_id = main_table.customer_id " . " AND _table_" . $attribute->getAttributeCode() . ".attribute_id = " . $attribute->getAttributeId(), array($attribute->getAttributeCode() => "COALESCE(`_table_" . $attribute->getAttributeCode() . "`.`value`," . "`_table_guest_" . $attribute->getAttributeCode() . "`.`" . $attribute->getAttributeCode() . "`)"))->joinLeft(array("_table_guest_" . $attribute->getAttributeCode() => $tableNameGuestEntity), "_table_guest_" . $attribute->getAttributeCode() . ".order_id = main_table.entity_id", array());
         }
     }
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:28,代码来源:Observer.php

示例3: modifyOrderCollection

 /**
  * Join columns to the Orders Collection.
  * @param Varien_Event_Observer $observer
  */
 public function modifyOrderCollection($observer)
 {
     $permissibleActions = array('index', 'grid');
     if (false === strpos(Mage::app()->getRequest()->getControllerName(), 'sales_order') || !in_array(Mage::app()->getRequest()->getActionName(), $permissibleActions)) {
         return;
     }
     $collection = $observer->getOrderGridCollection();
     $tableNameCustomerEntity = Mage::getSingleton('core/resource')->getTableName('customer_entity');
     $attributesCollection = Mage::getModel('customer/attribute')->getCollection();
     $alias = Mage::helper('amcustomerattr')->getProperAlias($attributesCollection->getSelect()->getPart('from'), 'eav_attribute');
     $attributesCollection->getSelect()->where($alias . 'is_user_defined = ?', 1)->where($alias . 'attribute_code != ?', 'customer_activated');
     $alias = Mage::helper('amcustomerattr')->getProperAlias($attributesCollection->getSelect()->getPart('from'), 'customer_eav_attribute');
     $attributesCollection->getSelect()->where($alias . 'used_in_order_grid = ?', 1);
     if ($attributesCollection->getSize() > 0) {
         foreach ($attributesCollection as $attribute) {
             if ($this->_isJoined($collection->getSelect()->getPart('from'), '_table_' . $attribute->getAttributeCode())) {
                 continue;
             }
             $collection->getSelect()->joinLeft(array('_table_' . $attribute->getAttributeCode() => $tableNameCustomerEntity . '_' . $attribute->getBackendType()), '_table_' . $attribute->getAttributeCode() . '.entity_id = main_table.customer_id ' . ' AND _table_' . $attribute->getAttributeCode() . '.attribute_id = ' . $attribute->getAttributeId(), array($attribute->getAttributeCode() => '_table_' . $attribute->getAttributeCode() . '.value'));
         }
     }
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:26,代码来源:Observer.php


注:本文中的Varien_Event_Observer::getOrderGridCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。