dev (#1)
All checks were successful
Deploy Production (merchbay.com) / deploy (push) Successful in 2m11s

Co-authored-by: Frank John Begornia <frank.begornia@yahoo.com>
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2025-12-22 15:28:42 +00:00
parent 70496dc874
commit b47e4e8d3c
59 changed files with 2230 additions and 432 deletions

View File

@@ -399,7 +399,8 @@ class PaypalController extends Controller
public function getTax($cartKey)
{
$m = new TeamStoreModel;
$updated_getSubtotal = $m->getSubtotal($cartKey);
$updated_getSubtotal = $m->getSubtotalNew($cartKey);
$original_subtotal = $m->getSubtotal($cartKey); // withoutTanle
$grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey);
if (count($grouped_item) <= 0) {
@@ -414,10 +415,11 @@ class PaypalController extends Controller
$order_grandtotal = $updated_getSubtotal[0]->Subtotal;
$order_subtotal = $original_subtotal[0]->Subtotal;
$tax = $order_grandtotal * $tax_value;
$tax = $order_subtotal * $tax_value;
return [
'tax' => $tax,

View File

@@ -499,6 +499,30 @@ class TeamStoreController extends Controller
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "number-size-form") {
// $order_names = $post['order_names'];
$order_number = $post['order_number'];
$order_size = $post['order_size'];
foreach ($order_size as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $product_name,
'Size' => $order_size[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "number-form") {
$order_number = $post['order_number'];
@@ -954,6 +978,7 @@ class TeamStoreController extends Controller
'shippingFee' => number_format($shippingFee, 2),
'total' => number_format($finalSubTotal + $shippingFee + $tax["tax"], 2),
'subtotal' => number_format($finalSubTotal, 2),
'tax' => $tax["tax"],
'remaining_shippingfee' => number_format(99 - $finalSubTotal, 2)
));
} else {

View File

@@ -34,10 +34,10 @@ class UserController extends Controller
$post_data = array(
'isStoreOwner' => true,
'store_order' => $countStoreOrder[0]->count_order,
'store_income' => $storeIncome[0]->store_income,
'store_product_count' => $countStoreProduct[0]->store_product_count,
'store_published_product' => $countStorePublishedProduct[0]->store_published_product
'store_order' => isset($countStoreOrder[0]->count_order) ? $countStoreOrder[0]->count_order : 0,
'store_income' => isset($storeIncome[0]->store_income) ? $storeIncome[0]->store_income : 0,
'store_product_count' => isset($countStoreProduct[0]->store_product_count) ? $countStoreProduct[0]->store_product_count : 0,
'store_published_product' => isset($countStorePublishedProduct[0]->store_published_product) ? $countStorePublishedProduct[0]->store_published_product : 0
);
} else {
$post_data = array(
@@ -348,14 +348,16 @@ class UserController extends Controller
$newTeamStoreModel = new TeamStoreModel;
$product_array = $newTeamStoreModel->selectTeamStoreProducts('ProductURL', $url);
$roster = $newUserModel->getRoster($product_array[0]->Id);
$thumbnails_array = $newTeamStoreModel->getThumbnails($product_array[0]->Id);
$available_size = explode(",", $product_array[0]->AvailableSizes);
$shipping_cost = $newUserModel->selectShippingCost();
return view('user-layouts.view-store-item')->with('product_array', $product_array)
->with('available_size', $available_size)
->with('thumbnails_array', $thumbnails_array)
->with('shipping_cost', $shipping_cost);
->with('shipping_cost', $shipping_cost)
->with('roster', $roster);
}
@@ -1344,4 +1346,76 @@ class UserController extends Controller
return $array_address_book;
}
}
function roster(Request $request)
{
$UserModel = new UserModel;
$post = $request->all();
$response = $UserModel->insertRoster($post['data']);
if($response) {
return response()->json(array(
'status' => true,
'message' => "Roster is successfully saved."
));
}
return response()->json(array(
'status' => false,
'message' => "Something went wrong. Please try again"
));
}
function deleteRoster(Request $request) {
$UserModel = new UserModel;
$post = $request->all();
$response = $UserModel->deleteRoster($post['data']);
if($response) {
return response()->json(array(
'status' => true,
'message' => "Roster is successfully deleted."
));
}
return response()->json(array(
'status' => false,
'message' => "Something went wrong. Please try again"
));
}
function rosterUpdate(Request $request)
{
$UserModel = new UserModel;
$post = $request->all();
$response = $UserModel->updateRoster($post['data']);
if($response) {
return response()->json(array(
'status' => true,
'message' => "Roster is successfully updated."
));
}
return response()->json(array(
'status' => false,
'message' => "Something went wrong. Please try again"
));
}
function getCurrentRoster(Request $request) {
$productId = $request->query('product-id');
$newUserModel = new UserModel;
$roster = $newUserModel->getRoster($productId);
return response()->json($roster);
}
}