<?php

class MBPopularCategories extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-popular-categories";
    $options->title = __("Populárne kategórie", "inoby");
    $options->icon = "align-none";
    $options->render_template = get_theme_file_path("components/popular-categories/template.php");
    $options->fields = [
      [
        'name'          => __('Nadpis', 'inoby'),
        'id'            => 'popular_categories_headline',
        'type'          => 'text',
        'sanitize_callback' => 'none',
      ],
      [
        'group_title'   => __('Kategória - {category}', 'inoby'),
        'id'            => 'popular_categories',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšiu kategóriu', 'inoby'),
        'fields' => array(
          [
            'id'       => 'category',
            'title'    => __('Kategória', 'inoby'),
            'type'     => 'taxonomy_advanced',
            'taxonomy' => 'product_cat',
            'ajax'     => true,
          ],
        )
      ],
    ];
  }
}