<?php

class MBProductsSlider extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-product-slider";
    $options->title = __("Slider produktov", "inoby");
    $options->icon = "fas fa-grip-horizontal";
    $options->render_template = get_theme_file_path("/components/product-slider/template.php");
    $options->fields = [
       [
        "type" => "number",
        "id" => "products-per-slide",
        'std'   => 1,
        "name" => __("Počet produktov za slide", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "is-infinite",
        "name" => __("Je slider nekonečný?", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "automatic-slider",
        "name" => __("Automaticky", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "show-arrows",
        "name" => __("Zobraziť šípky", "inoby"),
      ],
      [
        'name'        => __('Zobraziť produkty', 'inoby'),
        'id'          => 'custom_posts',
        'type'        => 'post',
        'post_type'   => 'product',
        'clone'  => true,
        'sort_clone' => true,
        'query_args'  => [
            'post_status'    => 'publish',
            'posts_per_page' => - 1,
        ],
    ],
    ];
  }
}