Search code examples
spartacus-storefront

What is the correct way to change the "items per slide" configuration in product carousel from 4 items per slide to 3 items per slide in Spartacus.4


I tried this -

export class CustomProductCarouselComponent extends ProductCarouselComponent {
    constructor(
    componentData: CmsComponentData<model>,
    productService: ProductService
  ) {
    super(componentData, productService);
  }
  getProduct(code: string): Observable<Product> {
    return this.productService.get(code);
  }
}

But Html template gives error of type. see screenshot for the same.


Solution

  • You can set the attribute itemWidth in your html template where you are integrated the carousel tag <cx-carousel ... itemWidth="33%"...>