Spartacus产品列表页面的分页默认为10个产品。
我希望PLP在分页中有24个产品。我在Java中定制了OCC/搜索服务,我在浏览器的Network下看到pageSize = 12,但页面仍然分页为10。
输入图片描述
自定义ProductListComponentService默认文件时,页面上的SORT操作不起作用
如何更改分页时页面默认显示的产品数量
是否存在像无限滚动这样的结构?观点:{infiniteScroll: {活动:假的,productLimit: 500,showMoreButton:假的,},},
还没有用于listing的配置。为了改变结果的数量,我做了以下操作:
我扩展了ProductListComponentService
,并且我能够覆盖defaultPageSize
属性以获得24个产品。在此之后,排序仍然可用。
import { Injectable } from '@angular/core';
import { ProductListComponentService } from '@spartacus/storefront';
@Injectable({ providedIn: 'root' })
export class MyProductListComponentService extends ProductListComponentService {
defaultPageSize = 24;
}
在我的app.module.ts:
[...]
providers: [{ provide: ProductListComponentService, useClass: MyProductListComponentService }],