Shipping Tax Card
This commit is contained in:
parent
da08e9ff37
commit
eb55b01b0d
13 changed files with 86 additions and 81 deletions
|
|
@ -59,8 +59,8 @@ class ShippingController extends Controller
|
|||
$shipping = false;
|
||||
$data = Request::all();
|
||||
|
||||
if($data['action'] == 'shipping'){
|
||||
if ($data['id'] == "new") {
|
||||
if($data['action'] === 'shipping'){
|
||||
if ($data['id'] === "new") {
|
||||
$shipping = new Shipping();
|
||||
$rules = array('name' => 'required');
|
||||
} else {
|
||||
|
|
@ -79,7 +79,7 @@ class ShippingController extends Controller
|
|||
$shipping->save();
|
||||
}
|
||||
|
||||
if($data['action'] == 'price'){
|
||||
if($data['action'] === 'price'){
|
||||
$shipping = Shipping::findOrFail($data['shipping_id']);
|
||||
$rules = array('price' => 'required');
|
||||
$ret = ['value' => $shipping];
|
||||
|
|
@ -87,7 +87,7 @@ class ShippingController extends Controller
|
|||
if ($validator->fails()) {
|
||||
return view('admin.shipping.edit', $ret)->withErrors($validator);
|
||||
}
|
||||
if ($data['id'] == "new") {
|
||||
if ($data['id'] === "new") {
|
||||
$price = ShippingPrice::create($data);
|
||||
} else {
|
||||
$price = ShippingPrice::findOrFail($data['id']);
|
||||
|
|
@ -99,7 +99,7 @@ class ShippingController extends Controller
|
|||
}
|
||||
|
||||
}
|
||||
if($data['action'] == 'country'){
|
||||
if($data['action'] === 'country'){
|
||||
$shipping = Shipping::findOrFail($data['shipping_id']);
|
||||
foreach($data['country_ids'] as $country_id){
|
||||
if(ShippingCountry::where('country_id', $country_id)->count() == 0){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue