0
votes

Actually I created a new ProductListComponent and a new ProductListComponentService, they have the same code as the original, I only changed the value protected defaultPageSize at ProductListComponentService but it doesn't have effect.

Any Ideas?

My Product List Component

export class CustomProductListComponent {
  model$: Observable<ProductSearchPage> = this.productListComponentService
    .model$;

   constructor(private pageLayoutService: PageLayoutService, private productListComponentService: ProductListComponentService, private cd: ChangeDetectorRef,
    private scrollConfig?: ViewConfig) {
    }
}

Original Source Code: https://sap.github.io/cloud-commerce-spartacus-storefront/components/ProductListComponent.html#source

My Product List Component Service

@Injectable({ providedIn: 'root' })
export class ProductListComponentService {
  protected defaultPageSize = 12;

Original Source Code: https://sap.github.io/cloud-commerce-spartacus-storefront/injectables/ProductListComponentService.html#source

1
Please elaborate your question with more details and possibly some code.riazosama
Can you add some code?Tzimpo
Done, I added more code.Alejandro Martinez

1 Answers

0
votes

Just for more clarification, you created a CustomProductListComponent and a CustomProductListComponentService, which has the same source code as the original one correct? If yes, it should work ootb, when as you mentioned, modified the value of defaultPageSize to 12.

Only thing I can think of is how you might of configured Spartacus for your needs by having things on the queryParams. If so, you can look at the function getCriteriaFromRoute in ProductListComponentService, which says to use the value for the queryParams if it exists, or the default value if not.

Hope this helps