23.11 Upload to live

This commit is contained in:
Kevin Adametz 2019-11-23 15:02:41 +01:00
parent 8cae2f92a4
commit 8ebdacec98
80 changed files with 7320 additions and 3937 deletions

View file

@ -4,6 +4,7 @@ namespace App\Services;
use App\Models\Attribute;
use App\Models\Category;
use App\Models\Country;
use App\Models\Product;
use App\Models\ShippingCountry;
class HTMLHelper
@ -30,6 +31,7 @@ class HTMLHelper
0 => 'Kunde',
1 => 'Admin',
2 => 'SuperAdmin',
3 => 'SySAdmin',
];
@ -52,6 +54,9 @@ class HTMLHelper
case 2:
return 'badge-primary';
break;
case 3:
return 'badge-primary';
break;
}
}
@ -109,6 +114,22 @@ class HTMLHelper
return $ret;
}
public static function getProductsOptions($ids = array(), $all = true){
if($ids == null){
$ids = array();
}
$values = Product::where('active', 1)->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('no').'</option>\n';
}
foreach ($values as $value){
$attr = in_array($value->id, $ids) ? 'selected="selected"' : '';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
}
return $ret;
}
public static function getCategoriesOptions($ids = array(), $all = true){
$values = Category::where('active', 1)->get();
$ret = "";

View file

@ -98,8 +98,11 @@ class Util
public static function getUserShopBackUrl($reference = ""){
if(\Session::has('user_shop')){
if(\Session::has('user_shop_domain')){
return \Session::get('user_shop_domain');
}
if($user_shop = \Session::get('user_shop')){
return 'http://'.$user_shop->slug.".".Config('app.domain')."/back/to/shop/".$reference;
return config('app.protocol').$user_shop->slug.".".config('app.domain').config('app.tld_care')."/back/to/shop/".$reference;
}
}
return url("/");
@ -108,8 +111,11 @@ class Util
public static function getUserCardBackUrl($uri){
if(\Session::has('user_shop')){
if(\Session::has('user_shop_domain')){
return \Session::get('user_shop_domain');
}
if($user_shop = \Session::get('user_shop')){
return 'http://'.$user_shop->slug.".".Config('app.domain').$uri;
return config('app.protocol').$user_shop->slug.".".config('app.domain').config('app.tld_care').$uri;
}
}
return url($uri);