<?php

add_filter("rwmb_meta_boxes", function ($meta_boxes) {
  if (!ESHOP_ENABLED) {
    return $meta_boxes;
  }

  $meta_boxes[] = [
    "title" => __("Produkt karta", "inoby"),
    "id" => "featured-product",
    "description" => __("Produkt - Banner", "inoby"),
    "type" => "block",
    "icon" => "fas fa-file-image",
    "category" => "widgets",
    "context" => "side",
    "render_template" => get_theme_file_path("/components/featured-product/templates/featured-product.php"),
    "supports" => [
      "align" => true,
    ],

    // Block fields.
    "fields" => [
      [
        "type" => "post",
        "post_type" => "product",
        "id" => "product",
        "name" => __("Produkt", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "show_stock_status",
        "name" => __("Zobraziť stav skladu", "inoby"),
      ],
    ],
  ];
  return $meta_boxes;
});