定制OpenCart首页和分类页展示的产品

OpenCart早已把常用的功能写好提供给我们了,直接拿来使用即可。

比如我们想修改首页产品图片为显示8个最畅销产品,只需要调用:
$this->model_catalog_product->getBestSellerProducts(8)

如果想显示最新的6个产品,可以这样使用:
$this->model_catalog_product->getLatestProducts(6)

显示指定的商品:
$this->model_catalog_product->getProducts()

最受欢迎的商品:
$this->model_catalog_product->getPopularProducts()

特价商品:
$this->model_catalog_product->getProductSpecials()

以上方法都返回一个数组,自己根据情况编写视图模板文件即可。

标签


Warning: error_log(/www/wwwroot/www.ctrol.cn/wp-content/plugins/spider-analyser/#log/log-0213.txt): failed to open stream: No such file or directory in /www/wwwroot/www.ctrol.cn/wp-content/plugins/spider-analyser/spider.class.php on line 2900