Добрый день комрады! Задался вопросом выводить на главной странице сайта 6 последних добавленных товаров в ИМ (неважно в какой категории). В стандартном шаблоне нашел код на вывод последних спецпредложений:
<?php
if (Core::moduleIsActive('shop'))
{
$Shop_Controller_Show = new Shop_Controller_Show(
Core_Entity::factory('Shop', 1)
);
$Shop_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('МагазинКаталогТоваровНаГлавнойСпецПред')
)
->groupsMode('none')
//->itemsForbiddenTags(array('text'))
->group(FALSE)
->limit(3);
$Shop_Controller_Show
->shopItems()
->queryBuilder()
->join('shop_item_discounts', 'shop_item_discounts.shop_item_id', '=', 'shop_items.id')
->join('shop_discounts', 'shop_discounts.id', '=', 'shop_item_discounts.shop_discount_id')
->where('shop_discounts.active', '=', 1)
->where('shop_discounts.start_datetime', '<', Core_Date::timestamp2sql(time()))
->where('shop_discounts.end_datetime', '>', Core_Date::timestamp2sql(time()))
->where('shop_discounts.deleted', '=', 0)
->where('shop_items.modification_id', '=', 0)
->clearOrderBy()
->orderBy('RAND()');
$Shop_Controller_Show->show();
}
Как мне его перестроить чтобы выводились последние добавленные товары интернет-магазина ?