I've created a custom sort module that I'm attempting to debug. I'm curious if it is possible to display this information somewhere in my catalog pages (e.g. app/code/design/package/theme/template/catalog/product/list.phtml
). Here is the observer portion of my custom module where I define the setOrder:
<?php
class MyExtension_CustomSort_Model_Observer
{
public function onLoadCollection($observer)
{
$collection = $observer->getCollection();
$collection->setOrder('created_at', 'desc');
->setOrder('name', 'asc');
return true;
}
}
I've tried echoing and using print_r
to display my information but it seems I'm doing wrong. Any advice? The end result would be for me to see created_at
and name
somewhere near the top of page.