最近在弄Prestashop , 不过总是有些地方不太合心意,有些小修小改,拿出来跟大家分享一下。其中首页特色商品那里,总是显示最新那几个有点闷,改为读最近的16或24个, 再随机显示,改动如下:prestashop 版本 1.5.4.1
打开\modules\homefeatured\homefeatured.php, 把:$nb = (int)(Configuration::get(‘HOME_FEATURED_NBR’));
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb1 ? $nb1 : 10));
改成:
$nb = (int)(Configuration::get(‘HOME_FEATURED_NBR’));
$nb1 = 16;
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb1 ? $nb1 : 10));
if ($products) { shuffle($products); array_splice($products, ($nb ? $nb : 10)); }
$nb1 = “读取最前的多少个记录”
(责任编辑:好模板) |