Next Member Shopping
This commit is contained in:
parent
fb27009339
commit
16fe2fa363
23 changed files with 619 additions and 334 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue