update 20.10.2025

This commit is contained in:
Kevin Adametz 2025-10-20 17:42:08 +02:00
parent 8c11130b5d
commit a939cd51ef
616 changed files with 84821 additions and 4121 deletions

66
app/Http/Controllers/Web/SiteController.php Executable file → Normal file
View file

@ -20,7 +20,7 @@ class SiteController extends Controller
{
$this->setIPInfo();
$products = ['aloe-vera-gel-99', 'aloe-vera-saft-500-ml', 'aloe-vera-lippenbalsam'];
// $set_products = ['aloe-vera-cleaner-set', 'aloe-vera-koerper-set', 'aloe-vera-repair-set'];
// $set_products = ['aloe-vera-cleaner-set', 'aloe-vera-koerper-set', 'aloe-vera-repair-set'];
$set_products = ['aloe-vera-koerper-set', 'baby-set', 'aloe-vera-gel-set'];
$data = [
'products' => Product::whereIn('slug', $products)->where('active', true)->whereJsonContains('show_on', '1')->get(),
@ -34,16 +34,18 @@ class SiteController extends Controller
return view('web.index', $data);
}
public function domainCheck(){
public function domainCheck()
{
die("checked");
}
public function changeLang(){
public function changeLang()
{
$data = Request::all();
if(isset($data['change_country_id'])){
if (isset($data['change_country_id'])) {
$mylangs = Shop::getLangChange('webshop');
foreach($mylangs as $code => $country){
if(strtolower($data['change_country_id']) === strtolower($code)){
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']));
@ -58,41 +60,41 @@ class SiteController extends Controller
{
//wurde schon gesetzt //cache
$country = strtolower(Shop::getIPDatabaseInfo());
if(\Session::has('user_init_country')){
if (\Session::has('user_init_country')) {
return;
}
if(config('app.ipinfo')){
if (config('app.ipinfo')) {
$country = strtolower(Shop::getIPDatabaseInfo());
if($country === 'de'){ //$locale de - init AT
if ($country === 'de') { //$locale de - init AT
\Session::put('user_init_country', $country);
return;
}
if($country === 'error'){ //$locale at - init AT
if ($country === 'error') { //$locale at - init AT
$country = 'de';
}
}else{
} else {
$country = 'de';
}
}
//$locale = strtolower(\App::getLocale());
//ist default
//sprache
if(array_key_exists($country, \App\Services\UserService::getTransChange())){
if (array_key_exists($country, \App\Services\UserService::getTransChange())) {
\Session::put('user_init_country', $country);
\Session::put('locale', $country);
\App::setLocale($country);
}else{
} else {
//default EN
\Session::put('user_init_country', 'de');
\Session::put('locale', 'de');
\App::setLocale('de');
}
}
//bestelland / versandland
if(array_key_exists($country, Shop::getLangChange('webshop'))){
if (array_key_exists($country, Shop::getLangChange('webshop'))) {
\Session::put('user_init_country_options', $country);
}else{
} else {
\Session::put('user_init_country_options', 'de');
}
@ -101,11 +103,10 @@ class SiteController extends Controller
public function site($site, $subsite = false, $product_slug = false)
{
$this->setIPInfo();
$subsite = trim($subsite, '/');
$product_slug = trim($product_slug, '/');
if($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) {
@ -121,13 +122,12 @@ class SiteController extends Controller
return view('web.templates.produkte-show', $data);
}
}
if($site === 'produkte'){
if($subsite || $subsite !== 'alle-produkte') {
if ($site == 'produkte') {
if ($subsite || $subsite !== 'alle-produkte') {
$category = Category::where('slug', $subsite)->where('active', true)->first();
if ($category) {
$headline_image = false;
if($category->headline_image_id && $category->iq_image && $category->iq_image->active){
if ($category->headline_image_id && $category->iq_image && $category->iq_image->active) {
$headline_image = $category->iq_image;
}
@ -148,9 +148,9 @@ class SiteController extends Controller
'yard_instance' => 'webshop',
];
return view('web.templates.' . $site, $data);
}
}
dd($subsite);
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange('webshop'),
@ -163,22 +163,22 @@ class SiteController extends Controller
'headline_image' => false,
'yard_instance' => 'webshop',
];
return view('web.templates.'.$site, $data);
return view('web.templates.' . $site, $data);
}
$data = [
'user_shop' => Util::getUserShop(),
'mylangs' => Shop::getLangChange('webshop'),
'yard_instance' => 'webshop',
];
if($subsite){
if(!view()->exists('web.templates.'.$subsite)){
];
if ($subsite) {
if (!view()->exists('web.templates.' . $subsite)) {
abort(404);
}
return view('web.templates.'.$subsite, $data);
return view('web.templates.' . $subsite, $data);
}
if(!view()->exists('web.templates.'.$site)){
if (!view()->exists('web.templates.' . $site)) {
abort(404);
}
return view('web.templates.'.$site, $data);
return view('web.templates.' . $site, $data);
}
}
}