/   /   /  OroCommerce For developers: customize slick carousel options from layout

Note:

For more extensions and themes visit our store

OroCommerce For developers: customize slick carousel options from layout


Slick js library already included by default with OroCommerce , So the carousel which present  - Feature Products , New Arrival , Top Selling , Related Products , UpSell Products – is customizable , and you can change many options from YAML files with layout systems .

Let’s start by adding a products_carousel.ymlfor example inside Resources/views/layouts/blank/page/products_carousel.yml and start by customize  Feature Products carousel , push this lines inside the file :

  1.  
  2. layout:
  3.     actions:
  4.         - '@setOption':
  5.             id: featured_products
  6.             optionName: slider_options
  7.             optionValue:                     
  8.                     slidesToShow: 5
  9.                     arrows: true
  10.                     responsive:
  11.                         - {breakpoint: 1199, settings: {slidesToShow: 4, arrows: true}}
  12.                         - {breakpoint: 993, settings: {slidesToShow: 3, arrows: true}}
  13.                         - {breakpoint: 641, settings: {slidesToShow: 2, arrows: true}}
  14.                         - {breakpoint: 415, settings: {slidesToShow: 1, arrows: true}}
  15.  

You can change here slidesToShow & arrows generally or by  devices size  other thing you choose between enable or not the slick on featured_products block :
  1.  
  2.         - '@setOption':
  3.             id: featured_products
  4.             optionName: use_slider
  5.             optionValue: true
  6.  

and this is other example for to selling products:

  1.  
  2.         - '@setOption':
  3.             id: top_selling_products
  4.             optionName: slider_options
  5.             optionValue:                     
  6.                     slidesToShow: 5
  7.                     arrows: true
  8.                     responsive:
  9.                         - {breakpoint: 1199, settings: {slidesToShow: 4, arrows: true}}
  10.                         - {breakpoint: 993, settings: {slidesToShow: 3, arrows: true}}
  11.                         - {breakpoint: 641, settings: {slidesToShow: 2, arrows: true}}
  12.                         - {breakpoint: 415, settings: {slidesToShow: 1, arrows: true}}
  13.  


And you show or hide the full container related to specific configuration like this:

  1.  
  2.         - '@setOption':
  3.             id: top_selling_items_container
  4.             optionName: visible
  5.             optionValue: '=data["ibnab_customview"].isTPEnable()' 

other thing you can move or remove by using @move  @remove layout system prefix.

 

Comments

Related Posts

make your store more efficient

Solving problems. With open source technology. Professional results. That’s what makes Ibnab your best choice

IBNAB is a company made of a group of professionals whose work is providing secure open source solutions. Our company strives for reaching magnificent results with each experience and provides professional open source solutions that cover every part of the business process.