commit 08-2025

This commit is contained in:
Kevin Adametz 2025-08-12 18:01:59 +02:00
parent 9ae662f63e
commit 480fdc65ed
404 changed files with 65310 additions and 2600431 deletions

View file

@ -26,9 +26,11 @@ class SiteController extends Controller
'products' => Product::whereIn('slug', $products)->where('active', true)->whereJsonContains('show_on', '1')->get(),
'set_products' => Product::whereIn('slug', $set_products)->where('active', true)->whereJsonContains('show_on', '1')->get(),
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange(),
'mylangs' => Shop::getLangChange('webshop'),
'site' => IqSite::find(1),
'yard_instance' => 'webshop',
];
return view('web.index', $data);
}
@ -39,13 +41,13 @@ class SiteController extends Controller
public function changeLang(){
$data = Request::all();
if(isset($data['change_country_id'])){
$mylangs = Shop::getLangChange();
$mylangs = Shop::getLangChange('webshop');
foreach($mylangs as $code => $country){
if(strtolower($data['change_country_id']) === strtolower($code)){
\Session::put('user_init_country', strtolower($code));
\Session::forget('user_init_country_options');
\Session::put('locale', strtolower($data['change_locale_id']));
Shop::initUserShopLang($country);
Shop::initUserShopLang($country, 'webshop');
return back();
}
}
@ -88,33 +90,33 @@ class SiteController extends Controller
}
//bestelland / versandland
if(array_key_exists($country, Shop::getLangChange())){
if(array_key_exists($country, Shop::getLangChange('webshop'))){
\Session::put('user_init_country_options', $country);
}else{
\Session::put('user_init_country_options', 'de');
}
return redirect(route('home'));
return redirect('/');
}
public function site($site, $subsite = false, $product_slug = false)
{
$this->setIPInfo();
$subsite = trim($subsite, '/');
$product_slug = trim($product_slug, '/');
if($product_slug){
$category = Category::where('slug', $subsite)->where('active', true)->first();
$product = Product::where('slug', $product_slug)->where('active', true)->whereJsonContains('show_on', '1')->first();
if ($category && $product) {
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange(),
'mylangs' => Shop::getLangChange('webshop'),
'subsite' => $subsite,
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
'product' => $product,
'p_count' => Product::where('active', true)->whereJsonContains('show_on', '1')->count(),
'yard_instance' => 'webshop',
];
return view('web.templates.produkte-show', $data);
}
@ -135,7 +137,7 @@ class SiteController extends Controller
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange(),
'mylangs' => Shop::getLangChange('webshop'),
'subsite' => $subsite,
'categories' => Category::where('active', true)->orderBy('pos', 'DESC')->get(),
'products' => false,
@ -143,6 +145,7 @@ class SiteController extends Controller
'p_count' => Product::where('active', true)->whereJsonContains('show_on', '1')->count(),
'headline' => $category->getLang('headline'),
'headline_image' => $headline_image,
'yard_instance' => 'webshop',
];
return view('web.templates.' . $site, $data);
@ -150,7 +153,7 @@ class SiteController extends Controller
}
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange(),
'mylangs' => Shop::getLangChange('webshop'),
'subsite' => 'alle-produkte',
'categories' => Category::where('active', true)->orderBy('pos', 'DESC')->get(),
'products' => Product::where('active', true)->whereJsonContains('show_on', '1')->orderBy('pos', 'DESC')->get(),
@ -158,12 +161,14 @@ class SiteController extends Controller
'p_count' => Product::where('active', true)->whereJsonContains('show_on', '1')->count(),
'headline' => __('website.productworld'),
'headline_image' => false,
'yard_instance' => 'webshop',
];
return view('web.templates.'.$site, $data);
}
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange(),
'mylangs' => Shop::getLangChange('webshop'),
'yard_instance' => 'webshop',
];
if($subsite){
if(!view()->exists('web.templates.'.$subsite)){