commit 08-2025
This commit is contained in:
parent
9ae662f63e
commit
480fdc65ed
404 changed files with 65310 additions and 2600431 deletions
|
|
@ -7,6 +7,7 @@ use App\Models\Country;
|
|||
use App\Models\Product;
|
||||
use App\Models\Setting;
|
||||
use App\Models\ShippingCountry;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Models\ShoppingUser;
|
||||
use App\Services\dbip\MyDBIP;
|
||||
use App\Services\IPinfo\IPinfo;
|
||||
|
|
@ -46,7 +47,7 @@ class Shop
|
|||
}
|
||||
|
||||
|
||||
public static function getLangChange()
|
||||
public static function getLangChange($instance = 'shopping')
|
||||
{
|
||||
$ret = [];
|
||||
$countries = Country::whereActive(true)->whereSwitch(true)->get();
|
||||
|
|
@ -60,11 +61,11 @@ class Shop
|
|||
$ret[strtolower($country->code)] = $country;
|
||||
}
|
||||
}
|
||||
Shop::getUserShopLang($first_country);
|
||||
Shop::getUserShopLang($first_country, $instance);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getUserShopLang($country = null)
|
||||
public static function getUserShopLang($country = null, $instance = 'shopping')
|
||||
{
|
||||
if (\Session::has('user_shop_lang')) {
|
||||
if ($user_shop_lang = \Session::get('user_shop_lang')) {
|
||||
|
|
@ -72,21 +73,23 @@ class Shop
|
|||
}
|
||||
}
|
||||
if ($country) {
|
||||
Shop::initUserShopLang($country);
|
||||
Shop::initUserShopLang($country, $instance);
|
||||
return strtolower($country->code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function initUserShopLang($country)
|
||||
//init User Shop Lang for Webshop
|
||||
public static function initUserShopLang($country, $instance = 'shopping')
|
||||
{
|
||||
Yard::instance('shopping')->destroy();
|
||||
Yard::instance($instance)->destroy();
|
||||
\Session::put('user_shop_lang', strtolower($country->code));
|
||||
//init Yard
|
||||
self::initUserShopYard($country);
|
||||
self::initUserShopYard($country, $instance);
|
||||
}
|
||||
|
||||
public static function initUserShopYard($country)
|
||||
//init Yard for user shop Webshop
|
||||
public static function initUserShopYard($country, $instance = 'shopping')
|
||||
{
|
||||
//Lieferadresse im Drittland?
|
||||
self::$user_tax_free = $country->supply_country ? true : false;
|
||||
|
|
@ -95,8 +98,8 @@ class Shop
|
|||
self::$shipping_country = $ShippingCountry;
|
||||
self::$user_country = $country;
|
||||
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($ShippingCountry->id);
|
||||
Yard::instance('shopping')->setUserPriceInfos(Shop::getShopYardInfo());
|
||||
Yard::instance($instance)->setShippingCountryWithPrice($ShippingCountry->id);
|
||||
Yard::instance($instance)->setUserPriceInfos(Shop::getShopYardInfo());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -126,6 +129,23 @@ class Shop
|
|||
}
|
||||
return $shopping_user;
|
||||
}
|
||||
|
||||
//prüfe ob checkout bereits gestartet wurde, und wenn ja, dann lösche die Instanz
|
||||
public static function deleteCheckoutInstance(){
|
||||
|
||||
|
||||
if(Yard::instance('checkout')->count() > 0){
|
||||
Yard::instance('checkout')->destroy();
|
||||
}
|
||||
if(\Session::has('user_shop_identifier')){
|
||||
ShoppingInstance::where('identifier', \Session::get('user_shop_identifier'))->delete();
|
||||
\Session::forget('user_shop_identifier');
|
||||
}
|
||||
\Session::forget('user_shop_payment');
|
||||
\Session::forget('auth_user');
|
||||
\Session::forget('back_link');
|
||||
\Session::forget('new_session');
|
||||
}
|
||||
|
||||
public static function checkShoppingCountry($for, $id = null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue