Używam Magento CE 1.6.2.0.
Funkcja Online Klienci Magento jest świetna. Jedynym problemem jest to, że kolumna „Ostatni adres URL” może być bardziej pomocna, wyświetlając przepisanie (jeśli istnieje).
Zmieniłem app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php
od tego:
public function render(Varien_Object $row)
{
return htmlspecialchars($row->getData($this->getColumn()->getIndex()));
}
do tego:
public function render(Varien_Object $row)
{
$lastUrl = htmlspecialchars($row->getData($this->getColumn()->getIndex()));
$lastUrlRewrite = Mage::getModel("core/url_rewrite")
->setStoreId(1)
->loadByRequestPath($lastUrl);
$url = ($lastUrlRewrite) ? $lastUrlRewrite : $lastUrl;
return $url;
}
The StoreId
jest poprawne, ale wyjście pozostaje puste.
Każda pomoc byłaby bardzo mile widziana! Dziękuję Ci.
Odpowiedzi:
0 dla odpowiedzi № 1The loadByRequestPath()
metoda zwraca a Mage_Core_Model_Url_Rewrite
obiekt, nie łańcuch. Prawdopodobnie chcesz to zrobić:
$url = ($lastUrlRewrite->getId()) ? $lastUrlRewrite->getTargetPath() : $lastUrl;