You can change the direction from layout XML of your theme.
Below is the code of the local.xml
file for your reference.
<?xml version="1.0"?>
<layout version="0.1.0">
<!-- Change default direction for simple searches -->
<catalogsearch_result_index>
<reference name="search_result_list">
<action method="setDefaultDirection"><dir>desc</dir></action>
</reference>
</catalogsearch_result_index>
<!-- Change default direction for advanced searches -->
<catalogsearch_advanced_result>
<reference name="search_result_list">
<action method="setDefaultDirection"><dir>desc</dir></action>
</reference>
</catalogsearch_advanced_result>
<!-- Change default direction for a category without layered navigation -->
<catalog_category_default>
<reference name="product_list">
<action method="setDefaultDirection"><dir>desc</dir></action>
</reference>
</catalog_category_default>
<!-- Change default direction for a category with layered navigation -->
<catalog_category_layered>
<reference name="product_list">
<action method="setDefaultDirection"><dir>desc</dir></action>
</reference>
</catalog_category_layered>
<!-- Change default direction for category with ID 3 -->
<CATEGORY_3>
<reference name="product_list">
<action method="setDefaultDirection"><dir>desc</dir></action>
</reference>
</CATEGORY_3>
</layout>
Also, you can add layout XML as a Custom Design of your category in the admin. This setting will overwrite the local.xml configuration.
You can use the below code to get the list of products from a store.
$_productCollection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSort('created_at', 'DESC')
->addAttributeToSelect('*')
->load();
foreach ($_productCollection as $_product){
echo $_product->getName();
}
Hope it helps!!!