option attribute in layred navigation & category changes
This commit is contained in:
parent
2674fbb9ca
commit
8d64ba656a
|
|
@ -156,7 +156,7 @@ class AttributeRepository extends Repository
|
|||
*/
|
||||
public function getFilterAttributes()
|
||||
{
|
||||
return $this->model->where('is_filterable', 1)->get();
|
||||
return $this->model->where('is_filterable', 1)->with('options')->get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ class CategoryRepository extends Repository
|
|||
public function getCategoryTree($id = null)
|
||||
{
|
||||
return $id
|
||||
? Category::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
|
||||
: Category::orderBy('position', 'ASC')->get()->toTree();
|
||||
? $this->model::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
|
||||
: $this->model::orderBy('position', 'ASC')->get()->toTree();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ class CategoryRepository extends Repository
|
|||
*/
|
||||
public function getRootCategories()
|
||||
{
|
||||
return Category::withDepth()->having('depth', '=', 0)->get();
|
||||
return $this->model::withDepth()->having('depth', '=', 0)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,9 +104,9 @@ class CategoryRepository extends Repository
|
|||
if(array_key_exists($id, $categories))
|
||||
return $categories[$id];
|
||||
|
||||
return $categories[$id] = $id
|
||||
? Category::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
|
||||
: Category::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
|
||||
return $categories[$id] = $id
|
||||
? $this->model::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
|
||||
: $this->model::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue