默认情况下,页面上的分页也会对10个产品进行分页。
我希望PLP有24种传呼产品。我用Java定制了OCC / search服务,在浏览器中的Network之下我看到了pageSize = 12,但是页面仍然用10进行分页。
自定义ProductListComponentService默认文件时,页上的排序操作不起作用。
如何更改分页时显示在页面上的默认产品数.
有像无限滚动的结构吗?视图:{ infiniteScroll:{ active: false,productLimit: 500,showMoreButton: false,},},
发布于 2021-01-18 19:14:54
目前还没有需要列出的配置。为了改变结果的数量,我做了以下工作:
我扩展了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 }],https://stackoverflow.com/questions/65774214
复制相似问题