Skip to content

Commit

Permalink
fix for adding new category
Browse files Browse the repository at this point in the history
  • Loading branch information
samberrry committed Mar 19, 2021
1 parent 254b4c3 commit 2d984de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/BinshopsCategoryAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function store_category(Request $request){
]);

foreach ($language_list as $key => $value) {
if ($value['lang_id'] != -1){
if ($value['lang_id'] != -1 && $value['category_name'] !== null){
//check for slug availability
$obj = BinshopsCategoryTranslation::where('slug',$value['slug'])->first();
if ($obj){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
@foreach($category_tree as $category)
<li>
@php
$ct = $category->categoryTranslations->where('lang_id', $language_id)->first();
@endphp
@if(isset($ct))
<li>
<span value='{{$category->category_id}}'>
{{$category->categoryTranslations->where('lang_id', $language_id)->first()->category_name}}
</span>
@if( count($category->siblings) > 0)
<ul>
@include("binshopsblog_admin::categories._category_partial", ['category_tree' => $category->siblings])
</ul>
@endif
</li>
@if( count($category->siblings) > 0)
<ul>
@include("binshopsblog_admin::categories._category_partial", ['category_tree' => $category->siblings])
</ul>
@endif
</li>
@endif
@endforeach

0 comments on commit 2d984de

Please sign in to comment.