Skip to content

Commit 2d984de

Browse files
committed
fix for adding new category
1 parent 254b4c3 commit 2d984de

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/Controllers/BinshopsCategoryAdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function store_category(Request $request){
9393
]);
9494

9595
foreach ($language_list as $key => $value) {
96-
if ($value['lang_id'] != -1){
96+
if ($value['lang_id'] != -1 && $value['category_name'] !== null){
9797
//check for slug availability
9898
$obj = BinshopsCategoryTranslation::where('slug',$value['slug'])->first();
9999
if ($obj){
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
@foreach($category_tree as $category)
2-
<li>
2+
@php
3+
$ct = $category->categoryTranslations->where('lang_id', $language_id)->first();
4+
@endphp
5+
@if(isset($ct))
6+
<li>
37
<span value='{{$category->category_id}}'>
48
{{$category->categoryTranslations->where('lang_id', $language_id)->first()->category_name}}
59
</span>
6-
@if( count($category->siblings) > 0)
7-
<ul>
8-
@include("binshopsblog_admin::categories._category_partial", ['category_tree' => $category->siblings])
9-
</ul>
10-
@endif
11-
</li>
10+
@if( count($category->siblings) > 0)
11+
<ul>
12+
@include("binshopsblog_admin::categories._category_partial", ['category_tree' => $category->siblings])
13+
</ul>
14+
@endif
15+
</li>
16+
@endif
1217
@endforeach

0 commit comments

Comments
 (0)