首页遍历所有产品,如何让category_productSpuShowOnlyOneSku这个属性生效

问题咨询 · dream · 于 2年前 发布 · 823 次阅读

html5首页我想直接遍历所有产品出来,调用了:coll()方法:

 $filter['select'] = [
                'sku', 'spu', 'name', 'image',
                'price', 'special_price',
                'special_from', 'special_to',
                'brand_id','is_in_stock',
                'url_key', 'score','created_at','status',
            ];
            $filter['where'] = [['status'=> 1]];
            $filter['orderBy'] = ['created_at'=>SORT_DESC];
            $filter['fetchAll'] = true;

            $products = Yii::$service->product->coll($filter);

            $products = Yii::$service->category->product->convertToCategoryInfo($products['coll']);
            //var_dump($products);
            return $products;

但是后台设置html5的“规格产品只显示一个sku?yes”,没有生效,请问这个地方怎么做才更合理。

共收到 1 条回复
Fecmall#12年前 0 个赞

重写个方法就可以了。

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics