gpt4 book ai didi

pagination - 如何在 Spartacus 产品列表页面上更改分页中的默认产品数量?

转载 作者:行者123 更新时间:2023-12-04 08:14:33 24 4
gpt4 key购买 nike

默认情况下,Spartacus 产品列表页面上的分页也会对 10 个产品进行分页。
我希望 PLP 在分页中有 24 个产品。我在 Java 中自定义了 OCC/搜索服务,我在浏览器的网络下看到 pageSize = 12,但页面仍然是 10 的分页。
enter image description here
自定义ProductListComponentService默认文件时,页面上的SORT操作不起作用。
分页时如何更改要在页面上显示的默认产品数量。
有没有像无限滚动这样的结构?
看法: {
无限滚动: {
事件:假,
productLimit: 500,
显示更多按钮:假,
},
},

最佳答案

暂无配置上市。为了更改结果数量,我执行了以下操作:
我延长了 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 }],

关于pagination - 如何在 Spartacus 产品列表页面上更改分页中的默认产品数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65774214/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com