且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过rand()查询magento限制+订单

更新时间:2023-11-30 13:55:16

setRandomOrder不适用于产品集合,仅适用于相关产品.您必须使用以下代码自己添加它:

setRandomOrder does not work for collections of products, only for related products. You'll have to add it yourself with this code:

$collection->getSelect()->order(new Zend_Db_Expr('RAND()'));

同时设置页面大小和页码的快捷方式是:

A shortcut for setting both page size and number at the same time is:

$collection->setPage($pageNum, $pageSize);