public function render(Varien_Object $row) { $html = ''; $orderId = $row->getEntityId(); $order = Mage::getModel('sales/order')->load($orderId); if (!$order->getId()) { return $html; } if (!$order->canShip() && $order->getStatus() !== Mage_Sales_Model_Order::STATE_CANCELED && $order->getStatus() !== Mage_Sales_Model_Order::STATE_CLOSED) { // Order has been shipped. Display shipped carriers. $carriers = array(); $tracks = Mage::getModel('sales/order_shipment_track')->getCollection()->addAttributeToSelect('title')->setOrderFilter($row->getEntityId()); foreach ($tracks as $track) { $carriers[] = $track->getTitle(); } $html = implode(', ', $carriers); if (Mage::getStoreConfigFlag('gridactions/general/add_trackingnumber_from_grid_shipped')) { if (count($tracks) > 0) { $html .= '<br/>'; } $html .= $this->getCarrierDropdown($row, $order); } } else { if ($order->canShip()) { // Order has not yet been shipped. Display drop down. $html .= $this->getCarrierDropdown($row, $order); } } return $html; }
protected function _getValue(Varien_Object $row) { $str = '<a href="' . $this->getUrl('*/*/disapprove', array('id' => $row->getEntityId())) . '">Disapprove</a>'; if ($row->getStatus() == 2 && $row->getVisibility() == 1) { $str = '<a href="' . $this->getUrl('*/*/approve', array('id' => $row->getEntityId())) . '">Approve</a>'; } return $str; }
protected function _getValue(Varien_Object $row) { $str = '<a href="' . $this->getUrl('*/*/approve', array('id' => $row->getEntityId())) . '">Approve</a>'; $p = Mage::getModel('catalog/product')->load($row->getEntityId()); if ($p->getData('frontendproduct_product_status') == 1) { $str = '<a href="' . $this->getUrl('*/*/disapprove', array('id' => $row->getEntityId())) . '">Disapprove</a>'; } return $str; }
public function render(Varien_Object $row) { $productId = intval($row->getEntityId()); $product = Mage::getModel('catalog/product')->load($productId); $printArr = Mage::getSingleton('core/session')->getPrintArr(); if (is_array($printArr) && count($printArr) > 0) { $qty = intval($printArr[$product->getId()]); } else { $qty = intval($row->getQty()); } return '<input type="text" name="product_' . $row->getEntityId() . '" value="' . $qty . '" class="input-text" style="text-align:center;" />'; }
public function render(Varien_Object $row) { $id = $row->getEntityId() ? $row->getEntityId() : $row->getId(); $modelClass = get_class($row); $entity = new $modelClass(); $entity->load($id); $categories = array(); $categoryIds = $entity->getCategoryIds(); foreach ($categoryIds as $categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); $categories[] = $category->getName(); } return implode(',<br>', $categories); }
public function render(Varien_Object $row) { if ($this->_column !== false) { $column = $this->_column; } else { $column = $this->getColumn(); } #$colId = $column->getName() ? $column->getName() : $column->getId(); $colId = 'tracking-input'; $orderId = $row->getEntityId(); $order = Mage::getModel('sales/order')->load($orderId); if (!$order->getId()) { return ''; } $html = ''; if ($order->canShip()) { $html = '<input name="' . $colId . '-' . $row->getId() . '" rel="' . $row->getId() . '" class="input-text ' . $colId . '" value="' . $row->getData($column->getIndex()) . '" style="width:97%;" onclick="xtentoOnClickJs(this)"/>'; } else { if (!$order->canShip() && $order->getStatus() !== Mage_Sales_Model_Order::STATE_CANCELED && $order->getStatus() !== Mage_Sales_Model_Order::STATE_CLOSED) { $trackingNumbers = array(); if (Mage::helper('xtcore/utils')->mageVersionCompare(Mage::getVersion(), '1.4.0.0', '>=')) { $trackingUrl = Mage::helper('shipping')->getTrackingPopupUrlBySalesModel($order); } else { $trackingUrl = Mage::helper('shipping')->getTrackingPopUpUrlByOrderId($order->getEntityId()); } // Starting from Magento 1.6, the trackingnumber field has been renamed from number to track_number if (Mage::helper('xtcore/utils')->mageVersionCompare(Mage::getVersion(), '1.6.0.0', '>=')) { $tracks = Mage::getModel('sales/order_shipment_track')->getCollection()->addAttributeToSelect('track_number')->setOrderFilter($row->getEntityId()); foreach ($tracks as $track) { $trackingNumbers[] = '<a href="#" onclick="popWin(\'' . $trackingUrl . '\',\'trackorder\',\'width=800,height=600,left=0,top=0,resizable=yes,scrollbars=yes\')" >' . $this->escapeHtml($track->getTrackNumber()) . '</a>'; } } else { $tracks = Mage::getModel('sales/order_shipment_track')->getCollection()->addAttributeToSelect('number')->setOrderFilter($row->getEntityId()); foreach ($tracks as $track) { $trackingNumbers[] = '<a href="#" onclick="popWin(\'' . $trackingUrl . '\',\'trackorder\',\'width=800,height=600,left=0,top=0,resizable=yes,scrollbars=yes\')" >' . $this->escapeHtml($track->getNumber()) . '</a>'; } } $html = implode(', ', $trackingNumbers); if (Mage::getStoreConfigFlag('gridactions/general/add_trackingnumber_from_grid_shipped')) { if (count($tracks) > 0) { $html .= '<br/>'; } $html .= '<input name="' . $colId . '-' . $row->getId() . '" rel="' . $row->getId() . '" class="input-text ' . $colId . '" value="' . $row->getData($column->getIndex()) . '" style="width:97%;" onclick="xtentoOnClickJs(this)"/>'; } } } return $html; }
public function render(Varien_Object $row) { if (!$row->getEntityId()) { $row->setEmail($row->getGuestEmail()); } echo $row->getEmail(); }
public function render(Varien_Object $row) { $product_id = $row->getEntityId(); $supplier_products = Mage::getModel('inventorypurchasing/supplier_product')->getCollection()->addFieldToFilter('product_id', $product_id); $content = ''; $check = 0; if (count($supplier_products) == 0) { $content = 'No Supplier'; } foreach ($supplier_products as $supplier_product) { $supplier_id = $supplier_product->getSupplierId(); $url = Mage::helper('adminhtml')->getUrl('inventorypurchasingadmin/adminhtml_supplier/edit', array('id' => $supplier_id)); $supplier = Mage::getModel('inventorypurchasing/supplier')->getCollection()->addFieldToFilter('supplier_id', $supplier_id)->getFirstItem(); $name = $supplier->getSupplierName(); if (in_array(Mage::app()->getRequest()->getActionName(), array('exportCsv', 'exportXml', 'exportCsvProductInfo', 'exportXmlProductInfo'))) { if ($check) { $content .= ', ' . $name; } else { $content .= $name; } } else { $content .= "<a href=" . $url . ">{$name};<a/>" . "<br/>"; } $check++; } return $content; }
public function render(Varien_Object $row) { if (!$row->getEntityId()) { $row->setLastname($this->__('Guest')); } echo $row->getLastname(); }
public function render(Varien_Object $row) { try { $size = Mage::helper('ampgrid')->getGridThumbSize(); if (!$row->getThumbnail()) { $product = Mage::getModel('catalog/product')->load($row->getEntityId()); if ($product) { if ($product->getThumbnail()) { $row->setThumbnail($product->getThumbnail()); } } } $url = Mage::helper('catalog/image')->init($row, 'thumbnail')->resize($size)->__toString(); $zoomUrl = ''; if (Mage::getStoreConfig('ampgrid/attr/zoom')) { $zoomUrl = Mage::helper('catalog/image')->init($row, 'thumbnail')->__toString(); } if ($url) { $html = ''; if ($zoomUrl) { $html .= '<a href="' . $zoomUrl . '" rel="lightbox[zoom' . $row->getId() . ']">'; } $html .= '<img src="' . $url . '" alt="" width="' . $size . '" height="' . $size . '" />'; $html .= '</a>'; return $html; } } catch (Exception $e) { /* no file uploaded */ } return ''; }
public function render(Varien_Object $row) { if ($row->getEntityId()) { $id = $row->getEntityId(); } else { $id = $row->getProductId(); } $html = ''; $_product = Mage::getModel('catalog/product')->load($id); try { $src1 = Mage::helper('catalog/image')->init($_product, 'image')->resize(90); $html .= '<img src="' . $src1->__toString() . '" />'; } catch (Exception $e) { } return $html; }
public function render(Varien_Object $row) { $product_id = $row->getEntityId(); if ($product_id) { $requestData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('top_filter')); if (empty($requestData)) { $requestData = Mage::Helper('inventoryreports')->getDefaultOptionsWarehouse(); } $warehouse = $requestData['warehouse_select']; $gettime = Mage::Helper('inventoryreports')->getTimeSelected($requestData); $datefrom = $gettime['date_from']; $dateto = $gettime['date_to']; $warehouse_product = Mage::getModel('inventoryplus/warehouse_product')->getCollection()->addFieldToFilter('warehouse_id', $warehouse); $supplyneeds = array(); $total_supplyneeds = 0; $method = Mage::getStoreConfig('inventory/supplyneed/supplyneeds_method'); if ($datefrom && $dateto && $method == 2 && strtotime($datefrom) <= strtotime($dateto)) { $max_needs = Mage::helper('inventorysupplyneeds')->calMaxAverage($product_id, $datefrom, $dateto, $warehouse); } elseif ($datefrom && $dateto && $method == 1 && strtotime($datefrom) <= strtotime($dateto)) { $max_needs = Mage::helper('inventorysupplyneeds')->calMaxExponential($product_id, $datefrom, $dateto, $warehouse); } else { $max_needs = 0; } if ($max_needs > 0) { $supplyneeds[$product_id] = $max_needs; $total_supplyneeds += $max_needs; } } if ($total_supplyneeds == 0) { return '0'; } else { return $total_supplyneeds; } }
public function render(Varien_Object $row) { $product_id = $row->getEntityId(); $sales_rate = Mage::helper('inventorywarehouse/salesrate')->calculateSalesRate($product_id); return '<p style="text-align:center"><label name="sales_rate" id="sales_rate_' . $product_id . '">' . $sales_rate . '</label></p> '; }
public function render(Varien_Object $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0) { $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4 = array(); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('adminhtml/customer/edit', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getEntityId())), 'target' => '_blank'), '#' => Mage::helper('sublogin')->__('Edit Customer')); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('sublogin/adminhtml_index/edit', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getId())), 'target' => '_self'), '#' => Mage::helper('sublogin')->__('Edit Sublogin')); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('sublogin/adminhtml_index/deleteSingleSublogin', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getId())), 'target' => '_self'), '#' => Mage::helper('sublogin')->__('Delete Sublogin')); return $this->_actionsToHtml($_b4b4ae1cce58b916954ba6a30ef73681af8a36c4); }
/** * Render approval link in each vendor row * @param Varien_Object $row * @return String */ public function render(Varien_Object $row) { $html = ''; if ($row->getEntityId() != '' && $row->getStatus() != Ced_CsMarketplace_Model_Vendor::VENDOR_APPROVED_STATUS) { $order = Mage::getModel('sales/order')->loadByIncrementId($row->getOrderId()); $url = $this->getUrl('*/*/massStatus', array('vendor_id' => $row->getEntityId(), 'status' => Ced_CsMarketplace_Model_Vendor::VENDOR_APPROVED_STATUS, 'inline' => 1)); $html .= '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Approve?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Approve') . '</a>'; } if ($row->getEntityId() != '' && $row->getStatus() != Ced_CsMarketplace_Model_Vendor::VENDOR_DISAPPROVED_STATUS) { if (strlen($html) > 0) { $html .= ' | '; } $order = Mage::getModel('sales/order')->loadByIncrementId($row->getOrderId()); $url = $this->getUrl('*/*/massStatus', array('vendor_id' => $row->getEntityId(), 'status' => Ced_CsMarketplace_Model_Vendor::VENDOR_DISAPPROVED_STATUS, 'inline' => 1)); $html .= '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Disapprove?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Disapprove') . "</a>"; } return $html; }
public function render(Varien_Object $row) { $url = $this->getUrl('marketplace/adminhtml_commission/pay', array('id' => $row->getEntityId())); $_approvedStatusId = Mage::getModel('marketplace/selleroptions')->getSellerApprovedStatusId(); $_sellerStatusId = $row->getStatus(); if (isset($_approvedStatusId) && $_approvedStatusId == $_sellerStatusId) { $html = '<a href="' . $url . '">Pay</a>'; } return $html; }
public function render(Varien_Object $row) { if ($row->getAction()) { return; } $productId = $row->getParentId() ? $row->getParentId() : $row->getEntityId(); $stockHistoryUrl = $this->getUrl('inventoryreportsadmin/adminhtml_product/chart', array('id' => $productId)); $html = "<a href='' onclick='window.open( " . "\"" . $stockHistoryUrl . "\"" . "," . "\"" . $this->__('Stock History') . "\"" . "," . "\"" . 'scrollbars=yes, resizable=yes, width=520, height=540, top=50, left=300' . "\"" . "); " . "return false;' target='_blank'>" . $this->__('Stock History') . '</a>'; return $html; }
public function render(Varien_Object $row) { $width = Mage::helper('categorygridfilter')->getThumbnailWidth(); $product = Mage::getModel('catalog/product')->load($row->getEntityId()); if ($product->getId()) { $image_url = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage()); } $out = "<img src=" . $image_url . " width='" . $width . "px' title='" . $product->getName() . "'/>"; return $out; }
public function render(Varien_Object $row) { $order = Mage::getModel('sales/order')->load($row->getEntityId()); $items = $order->getAllItems(); $warehouse = array(); foreach ($items as $item) { $wareobject = mage::getModel('awa_inventory/warehouse')->load($item->getWarehouseId()); $warehouse[] = $wareobject->getWarehouseName(); } return implode(',', $warehouse); }
/** * Render approval link in each vendor row * @param Varien_Object $row * @return String */ public function render(Varien_Object $row) { $html = ''; $url = ''; $vendor_id = Mage::helper('csmarketplace')->getTableKey('vendor_id'); $model = Mage::getModel('csmarketplace/vshop')->loadByField(array($vendor_id), array($row->getEntityId())); if ($model->getId() != '' && $model->getShopDisable() == Ced_CsMarketplace_Model_Vshop::ENABLED) { $url = $this->getUrl('*/*/massDisable', array('vendor_id' => $row->getEntityId(), 'shop_disable' => Ced_CsMarketplace_Model_Vshop::DISABLED, 'inline' => 1)); $html .= Mage::helper('csmarketplace')->__('Enabled') . ' ' . '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Disable?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Disable') . '</a>'; } else { if ($model->getId() != '' && $model->getShopDisable() == Ced_CsMarketplace_Model_Vshop::DISABLED) { $url = $this->getUrl('*/*/massDisable', array('vendor_id' => $row->getEntityId(), 'shop_disable' => Ced_CsMarketplace_Model_Vshop::ENABLED, 'inline' => 1)); $html .= Mage::helper('csmarketplace')->__('Disabled') . ' ' . '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Enable?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Enable') . "</a>"; } else { $url = $this->getUrl('*/*/massDisable', array('vendor_id' => $row->getEntityId(), 'shop_disable' => Ced_CsMarketplace_Model_Vshop::DISABLED, 'inline' => 1)); $html .= Mage::helper('csmarketplace')->__('Enabled') . ' ' . '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Disable?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Disable') . '</a>'; } } return $html; }
public function render(Varien_Object $row) { $productId = $row->getEntityId(); $supplierId = Mage::app()->getRequest()->getParam('id'); $supplier = Mage::helper('inventorypurchasing/supplier')->getAllSupplierName(); if (count($supplier) && !$supplierId) { $model = Mage::getModel('inventorypurchasing/supplier'); $firstItem = $model->getCollection()->getFirstItem(); $supplierId = $firstItem->getSupplierId(); } return '<p style="text-align:center"><a name="url" href="# return false;" onclick="showreport(' . $productId . ',' . $supplierId . '); return false;">' . Mage::helper('inventorypurchasing')->__('View') . '</a></p>'; }
public function getParentProduct(Varien_Object $product, $collection = null) { if (!isset($this->_parentProductsCache[$product->getEntityId()])) { $connection = Mage::getSingleton('core/resource')->getConnection('read'); $table = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation'); $parent_product = null; $parent_id = $connection->fetchOne('SELECT `parent_id` FROM ' . $table . ' WHERE `child_id` = ' . intval($product->getEntityId())); if ($parent_id > 0) { if ($collection) { $parent_product = $collection->getItemById($parent_id); } if (!$parent_product) { $parent_product = Mage::getModel('catalog/product')->load($parent_id); } $this->_parentProductsCache[$product->getEntityId()] = $parent_product; } else { $this->_parentProductsCache[$product->getEntityId()] = new Varien_Object(); } } return $this->_parentProductsCache[$product->getEntityId()]; }
public function render(Varien_Object $row) { $currentData = $row->getData($this->getColumn()->getIndex()); $currentData = trim($currentData, " \t\n\r\v;"); if ($currentData) { $values = explode(';', $currentData); } else { $values = false; } $block = $this->getLayout()->createBlock('adminhtml/template')->setTemplate('amorderattach/grid/file_multiple.phtml')->setData('field', $this->getColumn()->getId())->setData('order_id', $row->getEntityId())->setData('values', $values); return $block->toHtml(); }
public function createFromObject(Varien_Object $object) { try { $summary = Mage::getModel('points/summary')->setCustomerId($object->getEntityId())->setBalanceUpdateNotification($object->getSubscribedByDefault())->setPointsExpirationNotification($object->getSubscribedByDefault())->save(); } catch (Exception $e) { Mage::logException($e); } if (!isset($summary) || !$summary->getId()) { return false; } return $summary; }
public function render(Varien_Object $row) { $ret = ''; $category = Mage::getModel('catalog/category')->load($row->getEntityId()); $categoryIds = explode('/', $category->getPath()); foreach ($categoryIds as $categoryId) { if ($categoryId == 1) { continue; } $ret .= Mage::helper('rocketweb_search')->getCategoryName($categoryId) . ' > '; } $ret = preg_replace('/ > $/', '', $ret); return $ret; }
public function render(Varien_Object $row) { $order = Mage::getModel('sales/order')->load($row->getEntityId()); $str = ''; $k = 0; $class = ''; $_items = $order->getStatusHistoryCollection(true); $now = date("Y-m-d H:i:s"); $connection = Mage::getSingleton('core/resource')->getConnection('core_read'); foreach ($order->getStatusHistoryCollection(true) as $_item) { //$item = $_items[$k]; if ($_item->getStatusLabel() == "Complete") { foreach ($order->getShipmentsCollection() as $shipment) { $diff = date("Y-m-d H:i:s", strtotime($shipment->getCreatedAtDate())); if ($diff) { break; } } //$diff = date("Y-m-d H:i:s",strtotime($order->getCreatedAtDate())); //$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); $query = "select TIMESTAMPDIFF(HOUR,'{$diff}', '{$now}' ) as diff;"; $hours = $connection->fetchOne($query); if ($hours >= 48) { $str = "Not Delivered"; $class = "delevered"; } } if ($_item->getStatusLabel() == "Pending" || $_item->getStatusLabel() == "Processing") { $diff = date("Y-m-d H:i:s", strtotime($order->getCreatedAtDate())); //$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); $query = "select TIMESTAMPDIFF(HOUR,'{$diff}', '{$now}' ) as diff;"; $hours = $connection->fetchOne($query); if ($hours >= 24) { $str = "Delay in Shipping"; $class = "delayshiping"; } } if ($order->getConfirmOrder() == 1 && $_item->getStatusLabel() == "Pending" && $hours < 24) { $str = 'Order Confirm'; $class = "confirmed"; } if ($order->getConfirmOrder() == 2 && $_item->getStatusLabel() == "Pending" && $hours < 24) { $str = 'Arrage a Call'; $class = "arrangecall"; } break; } return '<span title="' . $str . '" class="' . $class . '">' . $str . '</span>'; }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $warehouse_id = Mage::app()->getRequest()->getParam('id'); if (!$warehouse_id) { $warehouse_id = 0; } $product_id = $row->getEntityId(); $allocated_qty = $row->getAllocated(); $url = Mage::helper('adminhtml')->getUrl('inventoryadmin/adminhtml_stock/customerchart'); if ($row->getAllocated()) { return '<p style="text-align:center"><a name="url" href="javascript:void(0)" onclick="showcustomer(' . $product_id . ',' . $warehouse_id . ')">' . $allocated_qty . '</a></p>'; } else { return '0'; } }
public function render(Varien_Object $row) { $return = $row->getRealOrderId(); /* @var $shipment Dhl_Intraship_Model_Shipment */ $shipment = Mage::getModel('intraship/shipment')->load($row->getEntityId(), 'order_id'); if (false === $shipment->isEmpty()) { if (true === $shipment->isProcessed()) { $return .= ' <img src="' . $this->getSkinUrl('images/dhl/icon_complete.png') . '" alt="| ' . Mage::helper('intraship')->__('DHL Intraship (successful)') . '" title="' . Mage::helper('intraship')->__('Successful') . '"/>'; } elseif (true === $shipment->isFailed()) { $return .= ' <img src="' . $this->getSkinUrl('images/dhl/icon_failed.png') . '" alt="| ' . Mage::helper('intraship')->__('DHL Intraship (failed)') . '>" title="' . Mage::helper('intraship')->__('Failed') . '"/>'; } else { $return .= ' <img src="' . $this->getSkinUrl('images/dhl/icon_incomplete.png') . '" alt="| ' . Mage::helper('intraship')->__('DHL Intraship (waiting)') . '" title="' . Mage::helper('intraship')->__('On hold') . '"/>'; } } return $return; }
public function render(Varien_Object $row) { $now = date("Y-m-d H:i:s"); $data = $row->getData($this->getColumn()->getIndex()); $htmlOut = ''; $isDate = ITwebexperts_Payperrentals_Helper_Date::isFilteredDate($data); if (!$isDate || $isDate && strtotime($data) < strtotime($now)) { $button = "<button id=" . $row->getEntityId() . " onclick=\"showLateFeePopup('popup_form_policy',this.id)\")'>Charge Fee</button>"; $lateFee = ITwebexperts_Payperrentals_Helper_LateFeesandReturns::calculateLateFeePriceForOrder($row->getOrderId(), null, null, $now); if ($lateFee > 0) { $lateFee = Mage::helper('core')->currency($lateFee); $htmlOut = $button . '<br />' . $lateFee; } else { $htmlOut = ''; } } return $htmlOut; }
public function render(Varien_Object $row) { $str = ''; $cid = $row->getEntityId(); if (Mage::helper('rewards/customer_points_index')->useIndex()) { // Should be using the customer points index. $points_amount = $row->getData('customer_points_usable'); $points_amount = intval($points_amount); $str = (string) Mage::getModel('rewards/points')->set(1, $points_amount); } else { if ($cid) { $customer = Mage::getModel('rewards/customer')->load($cid); if ($customer) { $str = $customer->getPointsSummary(); } } } return $str; }