Magento: Sort by newest
cp ./app/design/frontend/base/default/template/catalog/product/list.phtml ./app/design/frontend/default/default/template/catalog/product/list.phtml
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/list.phtml.diff";
echo "$URL";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
/*
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/sortby_newest.sql.txt";
echo "$URL";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
*/
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/toolbar.phtml.diff";
echo "$URL";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
OPTIONAL: change sort by for a attribute
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/Toolbar.php.diff";
echo "$URL";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
Images
/sites/default/files/magento/sortby/toolbar.phtml.diff
/sites/default/files/magento/sortby/up.png
Translations
echo '"Newest first","Сначала новые"' >> ./app/locale/ru_RU/Mage_Catalog.csv
List some products on top
UPDATE magento.catalog_product_entity
SET updated_at = now( ) + INTERVAL 1 year
WHERE catalog_product_entity.sku in ('YOUR_PRODUCT_SKU');
Links
http://www.magentocommerce.com/boards/v/viewthread/1176 - set the default sort order for catalog pages?
http://www.magentocommerce.com/boards/viewthread/37324/P15/#t285109