Custom Price / Land / User Order Homeparty

This commit is contained in:
Kevin Adametz 2021-08-20 18:22:21 +02:00
parent d46824a4ac
commit 51d81d8ec6
55 changed files with 1951 additions and 681 deletions

View file

@ -2,6 +2,7 @@
namespace App\Models;
use App\Models\ShippingCountry as ModelsShippingCountry;
use Illuminate\Database\Eloquent\Model;
/**
@ -50,4 +51,17 @@ class ShippingCountry extends Model
return $this->hasMany('App\Models\ShoppingOrder', 'country_id');
}
public static function getActiveShippingCountries(){
$ret = [];
$ShippingCountries = ShippingCountry::all();
foreach($ShippingCountries as $ShippingCountry){
if($ShippingCountry->shipping->active){
$ret[$ShippingCountry->country_id] = $ShippingCountry->country->getLocated();
}
}
return $ret;
}
}