ソースの公開有難う御座います
スムーズに実装まで至りました!
カテゴリの数が多い場合などは
サイトマップは
親カテゴリだけに留めた方が良いとどこかのサイトで見たのですが
確かに数が多いとCSSで調整しても長くなってしまうので
そこで親カテゴリだけの抽出をしたいのですが
書き換えしながら更新してみたのですが、
level1だけを表示させるだけかと思うのですが
levelの部分を level == 1 かなと思ったのですが
違うようで、アドバイス頂ければ幸いです。
宜しくお願い致します。
// メインカテゴリーの取得
function lfGetMainCat($count_check = false, &$objSubPage) {
$objQuery = new SC_Query();
$col = "*";
$from = "dtb_category left join dtb_category_total_count using (category_id)";
// メインカテゴリーとその直下のカテゴリーを取得する。
$where = 'level <= 2 AND del_flg = 0';
// 登録商品数のチェック
if($count_check) {
$where .= " AND product_count > 0";
}
$objQuery->setoption("ORDER BY rank DESC");
$arrRet = $objQuery->select($col, $from, $where);
// メインカテゴリーを抽出する。
$arrMainCat = array();
foreach ($arrRet as $cat) {
if ($cat['level'] != 1) {
continue;
}
// 子カテゴリーを持つかどうかを調べる。
$arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $cat['category_id']);
$cat['has_children'] = count($arrChildrenID) > 0;
$arrMainCat[] = $cat;
}
----------------
------------------------------------------------------------------------------------------
EC-CUBE 3.0.17
DBサーバー mariaDB
WEBサーバー apache (CentOS)
PHP 7.1
-----------------------...