Next Member Shopping

This commit is contained in:
Kevin Adametz 2020-08-21 18:20:40 +02:00
parent fb27009339
commit 16fe2fa363
23 changed files with 619 additions and 334 deletions

View file

@ -2,6 +2,8 @@
namespace App\Services;
use App\Models\Country;
use App\Models\ShippingCountry;
use App\Models\ShoppingUser;
use Gloudemans\Shoppingcart\CartItem;
@ -40,4 +42,22 @@ class Shop
}
}
}
public static function getShippingCountryCountryId($shipping_country_id){
$shippingCountry = ShippingCountry::find($shipping_country_id);
if($shippingCountry && $shippingCountry->country){
return $shippingCountry->country->id;
}
return 1; //default DE
}
public static function getCountryShippingCountryId($country_id){
$shippingCountry = ShippingCountry::whereCountryId($country_id)->first();
if($shippingCountry){
return $shippingCountry->id;
}
return ShippingCountry::all()->first()->id;
}
}