Cookiebot / Pixel / Kategorien erweitern
This commit is contained in:
parent
36872100c6
commit
7d1ee844eb
28 changed files with 464 additions and 246 deletions
|
|
@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
|
|||
use App\Models\Category;
|
||||
use App\Models\IqSite;
|
||||
use App\Models\Product;
|
||||
use App\Models\ProductCategory;
|
||||
use App\Services\Util;
|
||||
|
||||
class SiteController extends Controller
|
||||
|
|
@ -41,7 +42,6 @@ class SiteController extends Controller
|
|||
}
|
||||
public function site($site, $subsite = false, $product_slug = false)
|
||||
{
|
||||
|
||||
$subsite = trim($subsite, '/');
|
||||
$product_slug = trim($product_slug, '/');
|
||||
if($product_slug){
|
||||
|
|
@ -71,13 +71,18 @@ class SiteController extends Controller
|
|||
$headline_image = $category->iq_image;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$product_categories = ProductCategory::where('category_id', $category->id)->whereHas('product', function ($query) use ($category) {
|
||||
$query->where('active', true)->where('show_at', '<=', 1);
|
||||
})->orderBy('pos', 'DESC')->get();
|
||||
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'subsite' => $subsite,
|
||||
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
|
||||
'products' => Product::whereHas('categories', function ($query) use ($category) {
|
||||
$query->where('category_id', '=', $category->id);
|
||||
})->where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'DESC')->get(),
|
||||
'categories' => Category::where('active', true)->orderBy('pos', 'DESC')->get(),
|
||||
'products' => false,
|
||||
'product_categories' => $product_categories,
|
||||
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
|
||||
'headline' => $category->getLang('headline'),
|
||||
'headline_image' => $headline_image,
|
||||
|
|
@ -89,8 +94,9 @@ class SiteController extends Controller
|
|||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'subsite' => 'alle-produkte',
|
||||
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
|
||||
'products' => Product::where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'ASC')->get(),
|
||||
'categories' => Category::where('active', true)->orderBy('pos', 'DESC')->get(),
|
||||
'products' => Product::where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'DESC')->get(),
|
||||
'product_categories' => false,
|
||||
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
|
||||
'headline' => 'Produktwelt',
|
||||
'headline_image' => false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue