<?php

use App\MultisiteHelper;
use Mtc\Shop\Category;
use Mtc\Core\PaginationTemplate;

$parent_categories = MultisiteHelper::getCategoriesToDisplay(0, function($query) {
    $query->where('is_online_doctor', true);
});

foreach ($parent_categories as $parent_category) {
    $temp_cats = MultisiteHelper::getCategoriesToDisplay($parent_category->id, function($query) {
        $query->where('is_online_doctor', true);
    });
    $parent_category->sub_categories = $temp_cats;
}

$twig_variables['parent_categories'] = $parent_categories;
