23.11 Upload to live
This commit is contained in:
parent
4228524dbf
commit
63afff13ad
74 changed files with 3402 additions and 1687 deletions
|
|
@ -37,7 +37,10 @@ class KasController extends Controller
|
|||
try
|
||||
{
|
||||
$Params = array(); // Parameter für die API-Funktion
|
||||
$SoapRequest = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
|
||||
$SoapRequest = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl', [
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'exceptions' => false
|
||||
]);
|
||||
$req = $SoapRequest->KasApi(json_encode(array(
|
||||
'KasUser' => $this->kas_user, // KAS-User
|
||||
'KasAuthType' => 'session', // Auth per Sessiontoken
|
||||
|
|
@ -47,7 +50,7 @@ class KasController extends Controller
|
|||
)));
|
||||
Session::put('flood_protection.'.$func, time() + $this->kas_flood_delay + 0.2);
|
||||
|
||||
if(isset($req['Response']['ReturnString']) && $req['Response']['ReturnString'] == "TRUE"){
|
||||
if(is_array($req) && isset($req['Response']['ReturnString']) && $req['Response']['ReturnString'] == "TRUE"){
|
||||
return $req['Response']['ReturnInfo'];
|
||||
}
|
||||
return $req;
|
||||
|
|
@ -70,7 +73,10 @@ class KasController extends Controller
|
|||
try
|
||||
{
|
||||
|
||||
$SoapLogon = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl');
|
||||
$SoapLogon = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl', [
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'exceptions' => false
|
||||
]);
|
||||
$this->CredentialToken = $SoapLogon->KasAuth(json_encode(array(
|
||||
'KasUser' => $this->kas_user,
|
||||
'KasAuthType' => 'sha1',
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ class AttributeController extends Controller
|
|||
public function store()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$data = Input::all();
|
||||
if($data['id'] == "new"){
|
||||
$model = Attribute::create([
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\IqImage;
|
||||
use App\Models\ProductCategory;
|
||||
use Input;
|
||||
|
||||
|
|
@ -21,43 +22,61 @@ class CategoryController extends Controller
|
|||
|
||||
$data = [
|
||||
'values' => Category::all(),
|
||||
'trans' => array_keys(config('localization.supportedLocales')),
|
||||
];
|
||||
return view('admin.category.index', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
if($id == "new"){
|
||||
$model = new Category();
|
||||
$model->active = true;
|
||||
}else{
|
||||
$model = Category::findOrFail($id);
|
||||
}
|
||||
$data = [
|
||||
'category' => $model,
|
||||
'trans' => array_keys(config('localization.supportedLocales')),
|
||||
|
||||
];
|
||||
return view('admin.category.edit', $data);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
|
||||
$data = Input::all();
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
$data['parent_id'] = isset($data['parent_id']) ? $data['parent_id'] : null;
|
||||
if($data['id'] == "new"){
|
||||
$model = Category::create([
|
||||
'parent_id' => isset($data['parent_id']) ? $data['parent_id'] : null,
|
||||
'name' => $data['name'],
|
||||
'pos' => $data['pos'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
]);
|
||||
$model = Category::create($data);
|
||||
}else{
|
||||
$model = Category::find($data['id']);
|
||||
$model->parent_id = isset($data['parent_id']) ? $data['parent_id'] : null;
|
||||
$model->name = $data['name'];
|
||||
$model->pos = $data['pos'];
|
||||
$model->active = isset($data['active']) ? true : false;
|
||||
$model->save();
|
||||
$model->fill($data)->save();
|
||||
}
|
||||
|
||||
if(!empty($data['trans'])){
|
||||
$trans = [];
|
||||
foreach ($data['trans'] as $lang => $value){
|
||||
$trans = [];
|
||||
if(!empty($data['trans_name'])){
|
||||
|
||||
foreach ($data['trans_name'] as $lang => $value){
|
||||
if($value && $value != null){
|
||||
$trans[$lang] = $value;
|
||||
}
|
||||
}
|
||||
if(count($trans)){
|
||||
$model->trans_name = $trans;
|
||||
$model->save();
|
||||
}
|
||||
$model->trans_name = $trans;
|
||||
$model->save();
|
||||
|
||||
$trans = [];
|
||||
if(!empty($data['trans_headline'])){
|
||||
foreach ($data['trans_headline'] as $lang => $value){
|
||||
if($value && $value != null){
|
||||
$trans[$lang] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$model->trans_headline = $trans;
|
||||
$model->save();
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_product_categories'));
|
||||
|
|
@ -82,4 +101,100 @@ class CategoryController extends Controller
|
|||
return redirect(route('admin_product_categories'));
|
||||
}
|
||||
|
||||
// Upload FILE -----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public function imageUpload(){
|
||||
|
||||
$category_id = Input::get('category_id');
|
||||
$category = Category::findOrFail($category_id);
|
||||
|
||||
try {
|
||||
$image = \App\Services\Slim::getImages('images')[0];
|
||||
|
||||
if ( isset($image['output']['data']) )
|
||||
{
|
||||
|
||||
// Base64 of the image
|
||||
$data = $image['output']['data'];
|
||||
$file_ex = array( 'image/jpeg' => 'jpg', 'image/png' => 'png');
|
||||
|
||||
if (!isset($file_ex[$image['output']['type']])) {
|
||||
\Session()->flash('alert-danger', 'File is not jpg or png!');
|
||||
return redirect(route('admin_product_edit', [$category->id]));
|
||||
}
|
||||
|
||||
$ext = $file_ex[$image['output']['type']];
|
||||
// Original file name
|
||||
$name = $image['output']['name'];
|
||||
$name = \App\Services\Slim::sanitizeFileName($name);
|
||||
$path = 'images/iq_images/';
|
||||
|
||||
$image_name = "";
|
||||
do {
|
||||
$image_name = uniqid('', false) . '_' . $name;
|
||||
} while (\Storage::disk('public')->exists($path.$image_name));
|
||||
|
||||
$data = \Storage::disk('public')->put(
|
||||
$path.$image_name,
|
||||
$data
|
||||
);
|
||||
|
||||
$iq_image = IqImage::create([
|
||||
'filename' => $image_name,
|
||||
'original_name' => $image['output']['name'],
|
||||
'ext' => $ext,
|
||||
'mine' => $image['output']['type'],
|
||||
'size' => $image['input']['size']
|
||||
]);
|
||||
|
||||
$category->headline_image_id = $iq_image->id;
|
||||
$category->save();
|
||||
|
||||
\Session()->flash('alert-success', "Datei hochgeladen");
|
||||
return redirect(route('admin_product_category_edit', [$category->id]));
|
||||
}
|
||||
\Session()->flash('alert-danger', "Datei leer");
|
||||
return redirect(route('admin_product_category_edit', [$category->id]));
|
||||
|
||||
}
|
||||
catch (Exception $e) {
|
||||
\Session()->flash('alert-danger', "Fehler".$e);
|
||||
return redirect(route('admin_product_category_edit', [$category->id]));
|
||||
}
|
||||
}
|
||||
|
||||
public function imageDelete($image_id, $category_id){
|
||||
|
||||
$category = Category::findOrFail($category_id);
|
||||
$iq_image = IqImage::findOrFail($image_id);
|
||||
|
||||
if($iq_image->id == $category->iq_image->id){
|
||||
$file = 'images/iq_images/'.$iq_image->filename;
|
||||
\Storage::disk('public')->delete($file);
|
||||
$category->headline_image_id = NULL;
|
||||
$category->save();
|
||||
$iq_image->delete();
|
||||
|
||||
|
||||
\Session()->flash('alert-success', "Datei gelöscht");
|
||||
return redirect(route('admin_product_category_edit', [$category->id]));
|
||||
|
||||
}
|
||||
\Session()->flash('alert-danger', "Datei nicht gefunden");
|
||||
return redirect(route('admin_product_category_edit', [$category->id]));
|
||||
|
||||
}
|
||||
|
||||
public function imageAttribute($image_id, $attr, $val = false){
|
||||
|
||||
$iq_image = IqImage::findOrFail($image_id);
|
||||
|
||||
$iq_image->{$attr} = $val;
|
||||
$iq_image->save();
|
||||
|
||||
\Session()->flash('alert-success', "Wert gespeichert");
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -120,7 +120,8 @@ class PayoneController extends Controller
|
|||
"city" => $this->shopping_user->billing_city,
|
||||
"country" => ($this->shopping_user->billing_country) ? $this->shopping_user->billing_country->code : "DE", // mandatory
|
||||
"email" => $this->shopping_user->billing_email,
|
||||
"language" => ($this->shopping_user->billing_country) ? strtolower($this->shopping_user->billing_country->code) : "DE", // mandatory
|
||||
// "language" => ($this->shopping_user->billing_country) ? strtoupper($this->shopping_user->billing_country->code) : "DE", // mandatory
|
||||
"language" => "DE",
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ class ProductController extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'values' => Product::all(),
|
||||
];
|
||||
|
|
@ -89,7 +88,7 @@ class ProductController extends Controller
|
|||
|
||||
// Upload FILE -----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public function uploadImage(){
|
||||
public function imageUpload(){
|
||||
|
||||
$product_id = Input::get('product_id');
|
||||
$product = Product::findOrFail($product_id);
|
||||
|
|
@ -143,7 +142,7 @@ class ProductController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteImage($image_id, $product_id){
|
||||
public function imageDelete($image_id, $product_id){
|
||||
|
||||
$product = Product::findOrFail($product_id);
|
||||
$product_image = ProductImage::findOrFail($image_id);
|
||||
|
|
@ -163,4 +162,20 @@ class ProductController extends Controller
|
|||
|
||||
}
|
||||
|
||||
public function imageAttribute($product_id, $attr, $val = false){
|
||||
|
||||
if(is_numeric($val) && $val < 0){
|
||||
$val = 0;
|
||||
}
|
||||
|
||||
$product_image = ProductImage::findOrFail($product_id);
|
||||
|
||||
$product_image->{$attr} = $val;
|
||||
$product_image->save();
|
||||
|
||||
\Session()->flash('alert-success', "Wert gespeichert");
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
148
app/Http/Controllers/SitesController.php
Executable file
148
app/Http/Controllers/SitesController.php
Executable file
|
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\IqImage;
|
||||
use App\Models\IqSite;
|
||||
use Input;
|
||||
|
||||
|
||||
class SitesController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function show($site)
|
||||
{
|
||||
$data = [
|
||||
'value' => IqSite::find(1),
|
||||
'site' => $site,
|
||||
];
|
||||
return view('admin.site.edit', $data);
|
||||
}
|
||||
|
||||
public function store($site)
|
||||
{
|
||||
$data = Input::all();
|
||||
$data['products'] = isset($data['products']) ? $data['products'] : null;
|
||||
$data['set_products'] = isset($data['set_products']) ? $data['set_products'] : null;
|
||||
|
||||
if($site == "new"){
|
||||
// $model = IqSite::create($data);
|
||||
}else{
|
||||
$model = IqSite::find(1);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_sites', ['start']));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Upload FILE -----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public function imageUpload($site){
|
||||
|
||||
$model = IqSite::find(1);
|
||||
|
||||
try {
|
||||
$image = \App\Services\Slim::getImages('images')[0];
|
||||
|
||||
if ( isset($image['output']['data']) )
|
||||
{
|
||||
|
||||
// Base64 of the image
|
||||
$data = $image['output']['data'];
|
||||
$file_ex = array( 'image/jpeg' => 'jpg', 'image/png' => 'png');
|
||||
|
||||
if (!isset($file_ex[$image['output']['type']])) {
|
||||
\Session()->flash('alert-danger', 'File is not jpg or png!');
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
}
|
||||
|
||||
$ext = $file_ex[$image['output']['type']];
|
||||
// Original file name
|
||||
$name = $image['output']['name'];
|
||||
$name = \App\Services\Slim::sanitizeFileName($name);
|
||||
$path = 'images/iq_images/';
|
||||
|
||||
$image_name = "";
|
||||
do {
|
||||
$image_name = uniqid('', false) . '_' . $name;
|
||||
} while (\Storage::disk('public')->exists($path.$image_name));
|
||||
|
||||
$data = \Storage::disk('public')->put(
|
||||
$path.$image_name,
|
||||
$data
|
||||
);
|
||||
|
||||
$iq_image = IqImage::create([
|
||||
'filename' => $image_name,
|
||||
'original_name' => $image['output']['name'],
|
||||
'ext' => $ext,
|
||||
'mine' => $image['output']['type'],
|
||||
'size' => $image['input']['size']
|
||||
]);
|
||||
|
||||
$model->iq_image_id = $iq_image->id;
|
||||
$model->save();
|
||||
|
||||
\Session()->flash('alert-success', "Datei hochgeladen");
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
}
|
||||
\Session()->flash('alert-danger', "Datei leer");
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
|
||||
}
|
||||
catch (Exception $e) {
|
||||
\Session()->flash('alert-danger', "Fehler".$e);
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
}
|
||||
}
|
||||
|
||||
public function imageDelete($site, $image_id){
|
||||
|
||||
$iq_image = IqImage::findOrFail($image_id);
|
||||
$model = IqSite::find(1);
|
||||
|
||||
|
||||
if($iq_image->id == $model->iq_image->id){
|
||||
$file = 'images/iq_images/'.$iq_image->filename;
|
||||
\Storage::disk('public')->delete($file);
|
||||
$model->iq_image_id = NULL;
|
||||
$model->save();
|
||||
$iq_image->delete();
|
||||
|
||||
|
||||
\Session()->flash('alert-success', "Datei gelöscht");
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
|
||||
}
|
||||
\Session()->flash('alert-danger', "Datei nicht gefunden");
|
||||
return redirect(route('admin_sites', [$model->slug]));
|
||||
|
||||
}
|
||||
|
||||
public function imageAttribute($site, $image_id, $attr, $val = false){
|
||||
|
||||
$iq_image = IqImage::findOrFail($image_id);
|
||||
|
||||
$iq_image->{$attr} = $val;
|
||||
$iq_image->save();
|
||||
|
||||
\Session()->flash('alert-success', "Wert gespeichert");
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
87
app/Http/Controllers/Sys/AdminToolsController.php
Executable file
87
app/Http/Controllers/Sys/AdminToolsController.php
Executable file
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Sys;
|
||||
|
||||
|
||||
|
||||
use App\Http\Controllers\Api\KasController;
|
||||
use App\Http\Controllers\Api\KasSLLController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\UserShop;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class AdminToolsController extends Controller
|
||||
{
|
||||
protected $userRepo;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('sysadmin');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
dd('index');
|
||||
}
|
||||
|
||||
public function domainSSL()
|
||||
{
|
||||
|
||||
$user_shops = UserShop::all();
|
||||
$text = "";
|
||||
|
||||
$kas = new KasController();
|
||||
$domain = 'mivita.care';
|
||||
|
||||
$ssl = KasSLLController::getApiSSLParameter();
|
||||
|
||||
$subdomains = $kas->action('get_subdomains');
|
||||
foreach ($subdomains as $subdomain){
|
||||
$text .= $subdomain['subdomain_name']." - ".$subdomain['ssl_certificate_sni']."\n";
|
||||
|
||||
if($subdomain['ssl_certificate_sni'] != "Y"){
|
||||
$pra = array(
|
||||
'hostname' => $subdomain['subdomain_name'],
|
||||
);
|
||||
$pra = array_merge($pra, $ssl);
|
||||
$value = $kas->action('update_ssl', $pra);
|
||||
$text .= $value."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
$data = [
|
||||
'values' => $user_shops,
|
||||
'text' => $text,
|
||||
];
|
||||
|
||||
return view('sys.admin.index', $data);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
*/
|
||||
public function domainSSLStore()
|
||||
{
|
||||
$data = Input::all();
|
||||
|
||||
\Session()->flash('alert-save', true);
|
||||
return back();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
use App\Http\Controllers\Api\KasController;
|
||||
use App\Http\Controllers\Api\KasSLLController;
|
||||
use App\Models\UserShop;
|
||||
use App\Models\UserShopOnSite;
|
||||
use App\Repositories\UserRepository;
|
||||
|
|
@ -373,7 +374,6 @@ class UserShopController extends Controller
|
|||
return ['success' => false, 'error' => $add_subdomain];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string to ajax
|
||||
*/
|
||||
|
|
@ -403,7 +403,7 @@ class UserShopController extends Controller
|
|||
|
||||
return Response::json(array(
|
||||
'success' => true,
|
||||
'preview_user_shop_name' => "http://".$slug.".".config('app.domain'),
|
||||
'preview_user_shop_name' => "https://".$slug.".".config('app.domain').config('app.tld_care'),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ class CardController extends Controller
|
|||
//Cart::instance('wishlist')->add('sdjk922', 'Product 2', 1, 19.95, ['size' => 'medium']);
|
||||
public function addToCardGet($id, $quantity = 1, $product_slug = false)
|
||||
{
|
||||
|
||||
$product = Product::find($id);
|
||||
if($product){
|
||||
$image = "";
|
||||
|
|
@ -109,10 +108,11 @@ class CardController extends Controller
|
|||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
|
||||
//add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
|
||||
$path = str_replace('http', 'https', $path);
|
||||
if(strpos($path, 'https') === false){
|
||||
$path = str_replace('http', 'https', $path);
|
||||
}
|
||||
return redirect()->secure($path);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ class CheckoutController extends Controller
|
|||
return back()->withErrors($validator)->withErrors($validator)->withInput(Input::all());
|
||||
}
|
||||
|
||||
|
||||
$data = Input::all();
|
||||
//make User
|
||||
$shopping_user = $this->makeShoppingUser($data);
|
||||
|
|
@ -129,6 +128,7 @@ class CheckoutController extends Controller
|
|||
|
||||
//check credit Card
|
||||
if(Input::get('payment_method')){
|
||||
|
||||
$cc_ret = [];
|
||||
//need precheck the card
|
||||
if(Input::get('payment_method') == 'cc'){
|
||||
|
|
@ -295,7 +295,7 @@ class CheckoutController extends Controller
|
|||
'price' => $item->price,
|
||||
'slug' => $item->options->slug,
|
||||
])->save();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $model->delete();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Web;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Category;
|
||||
use App\Models\IqSite;
|
||||
use App\Models\Product;
|
||||
use Input;
|
||||
use App\Services\Util;
|
||||
|
|
@ -24,11 +25,14 @@ class SiteController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$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)->where('show_at', '<=', 1)->get(),
|
||||
'set_products' => Product::whereIn('slug', $set_products)->where('active', true)->where('show_at', '<=', 1)->get(),
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'site' => IqSite::find(1),
|
||||
];
|
||||
return view('web.index', $data);
|
||||
}
|
||||
|
|
@ -63,16 +67,21 @@ class SiteController extends Controller
|
|||
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){
|
||||
$headline_image = $category->iq_image;
|
||||
}
|
||||
|
||||
$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(),
|
||||
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
|
||||
|
||||
'headline' => $category->getLang('headline'),
|
||||
'headline_image' => $headline_image,
|
||||
];
|
||||
return view('web.templates.' . $site, $data);
|
||||
|
||||
|
|
@ -84,6 +93,8 @@ class SiteController extends Controller
|
|||
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
|
||||
'products' => Product::where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'ASC')->get(),
|
||||
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
|
||||
'headline' => 'Produktwelt',
|
||||
'headline_image' => false,
|
||||
];
|
||||
return view('web.templates.'.$site, $data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue