本文整理汇总了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');
}
示例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());
}
}
}
示例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'));
}
}
}