updated voucher modules
This commit is contained in:
@@ -678,7 +678,6 @@ class TeamStoreController extends Controller
|
||||
public function addVoucher(Request $request)
|
||||
{
|
||||
$cartKey = $request->session()->get('cartkey');
|
||||
$userId = Auth::user()->id;
|
||||
|
||||
if ($cartKey == "") {
|
||||
return false;
|
||||
@@ -713,6 +712,14 @@ class TeamStoreController extends Controller
|
||||
|
||||
// check if if voucher is already in used;
|
||||
foreach ($items as $item) {
|
||||
|
||||
if( $item->VoucherId) {
|
||||
return response()->json(array(
|
||||
'success' => false,
|
||||
'message' => 'You can only apply one voucher per order.'
|
||||
));
|
||||
}
|
||||
|
||||
if ($getVoucher[0]->Id == $item->VoucherId) {
|
||||
return response()->json(array(
|
||||
'success' => false,
|
||||
@@ -736,6 +743,14 @@ class TeamStoreController extends Controller
|
||||
|
||||
if ($getVoucher[0]->VoucherType === "Flat") {
|
||||
|
||||
if (Auth::guest()) {
|
||||
return response()->json(array(
|
||||
'success' => false,
|
||||
'message' => 'Log-in first to use this voucher.',
|
||||
));
|
||||
}
|
||||
|
||||
$userId = Auth::user()->id;
|
||||
$isUsed = $TeamStoreModel->checkVoucher($userId, $getVoucher[0]->Id);
|
||||
|
||||
if (count($isUsed) >= 1) {
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
|
||||
@if ($getSubtotal >= 1 && $getSubtotal <= 150)
|
||||
<div class="border rounded-2 p-2 mt-2">
|
||||
If you order $150 worth of product you get free shipping (pre tax). You are <strong>{{ 150 - $getSubtotal }} {{ $store_array[0]->StoreCurrency }}</strong> away.
|
||||
If you order $150 worth of product you get free shipping (pre tax). You are <strong>{{ number_format(150 - $getSubtotal, 2) }} {{ $store_array[0]->StoreCurrency }}</strong> away.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="container">
|
||||
<div class="row h-100">
|
||||
<div class="col-lg-7 align-self-center">
|
||||
<div class="copyright">Copyright © 2021, <b>MERCHBAY</b>. All right reserved.</div>
|
||||
<div class="copyright">Copyright © {{ date('Y') }}, <b>MERCHBAY</b>. All right reserved.</div>
|
||||
<ul class="footer-menu">
|
||||
{{-- <li class="footer-menu-item">
|
||||
<a href="#">About Us</a>
|
||||
|
||||
Reference in New Issue
Block a user