SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
736 stars 381 forks source link

Make defaultPageSize in PLP configurable in spartacus or in backend (even better) #7403

Open Platonn opened 4 years ago

Platonn commented 4 years ago

See: projects/storefrontlib/src/cms-components/product/product-list/container/product-list-component.service.ts

// TODO: make it configurable
  protected defaultPageSize = 10;

Firstly check, if we can get this info from backend.

Related to https://github.com/SAP/spartacus/issues/7263#issuecomment-615247157 by @ESchuderer

tobi-or-not-tobi commented 4 years ago

We do not have this configurable in the backend. I've provided an example to customise this:

export class CustomProductListComponentService extends ProductListComponentService  {
  protected defaultPageSize = 12;
}

providers: [
    {
      provide: ProductListComponentService,
      useClass: CustomProductListComponentService
}