add shipping cost

This commit is contained in:
franknstayn
2020-08-10 22:41:40 +08:00
parent 02361ca64e
commit 5918eded8c
11 changed files with 228 additions and 189 deletions

View File

@@ -4,10 +4,12 @@ use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Auth;
// use Auth;
use Illuminate\Support\Facades\Auth;
use App\Models\teamstore\TeamStoreModel;
use App\Models\user\UserModel;
use Mail;
// use Mail;
use Illuminate\Support\Facades\Mail;
use Analytics;
@@ -251,7 +253,7 @@ class TeamStoreController extends Controller {
}
if($item[0]->ProductAvailableQty != null){
$soldQty = $m->getSoldQty($product_array[0]->Id);
$soldQty = $TeamStoreModel->getSoldQty($item[0]->Id);
$availableQty = $item[0]->ProductAvailableQty - $soldQty[0]->SoldQty;
}else{
// echo 'no qty';
@@ -288,7 +290,8 @@ class TeamStoreController extends Controller {
$ProductURL = $product_array[0]->ProductURL;
$product_form = $product_array[0]->ProductForm;
$design_code = $product_array[0]->DesignCode;
$product_name = $product_array[0]->ProductName;
$product_name = $product_array[0]->ProductName;
$shipping_cost_id = $product_array[0]->ShippingCostId;
$teamstore_array = $m->selectTeamStore('Id', $TeamStoreId);
@@ -323,7 +326,8 @@ class TeamStoreController extends Controller {
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}elseif($product_form == "tshirt-form"){
@@ -339,7 +343,8 @@ class TeamStoreController extends Controller {
'ProductName' => $product_name,
'Size' => $post['uniformSize'],
'Price' => $ProductPrice,
'Quantity' => $post['quantity']
'Quantity' => $post['quantity'],
'ShippingCostId' => $shipping_cost_id
);
}elseif($product_form == "quantity-form"){
@@ -353,7 +358,8 @@ class TeamStoreController extends Controller {
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Price' => $ProductPrice,
'Quantity' => $post['quantity']
'Quantity' => $post['quantity'],
'ShippingCostId' => $shipping_cost_id
);
@@ -375,7 +381,8 @@ class TeamStoreController extends Controller {
'Name' => $order_names[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}elseif($product_form == "name-number-size-form"){
@@ -398,7 +405,8 @@ class TeamStoreController extends Controller {
'Size' => $order_size[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
@@ -418,7 +426,8 @@ class TeamStoreController extends Controller {
'ProductName' => $product_name,
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}elseif($product_form == "name-name2-size-form"){
@@ -441,7 +450,8 @@ class TeamStoreController extends Controller {
'Name2' => $order_names2[$key],
'Size' => $order_size[$key],
'Price' => $ProductPrice,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}elseif($product_form == "name-size-form"){
@@ -462,7 +472,8 @@ class TeamStoreController extends Controller {
'Name' => $order_names[$key],
'Size' => $order_size[$key],
'Price' => $ProductPrice,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}elseif($product_form == "jersey-and-shorts-quantity-form"){
@@ -492,7 +503,8 @@ class TeamStoreController extends Controller {
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => $quantity[$key]
'Quantity' => $quantity[$key],
'ShippingCostId' => $shipping_cost_id
);
}
@@ -524,11 +536,12 @@ class TeamStoreController extends Controller {
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => 1
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}
$i = $m->insertToCart($items);
if($i['i']){