2021-06-05 09:26:32 +00:00
|
|
|
|
@extends('layouts.main')
|
|
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
<!-- CONTENT HEADER -->
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
<div class="row mb-2">
|
|
|
|
|
<div class="col-sm-6">
|
2021-12-17 09:41:32 +00:00
|
|
|
|
<h1>{{ __('Store') }}</h1>
|
2021-06-05 09:26:32 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-6">
|
|
|
|
|
<ol class="breadcrumb float-sm-right">
|
2023-03-04 19:41:02 +00:00
|
|
|
|
<li class="breadcrumb-item"><a class="" href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
|
2021-12-17 09:41:32 +00:00
|
|
|
|
<li class="breadcrumb-item"><a class="text-muted"
|
2023-03-04 19:41:02 +00:00
|
|
|
|
href="{{ route('store.index') }}">{{ __('Store') }}</a></li>
|
2021-06-05 09:26:32 +00:00
|
|
|
|
</ol>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
<!-- END CONTENT HEADER -->
|
|
|
|
|
|
|
|
|
|
<!-- MAIN CONTENT -->
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
|
2021-07-11 09:06:23 +00:00
|
|
|
|
<div class="text-right mb-3">
|
|
|
|
|
<button type="button" data-toggle="modal" data-target="#redeemVoucherModal" class="btn btn-primary">
|
2021-12-17 09:41:32 +00:00
|
|
|
|
<i class="fas fa-money-check-alt mr-2"></i>{{ __('Redeem code') }}
|
2021-07-11 09:06:23 +00:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-03-04 19:41:02 +00:00
|
|
|
|
@if ($isStoreEnabled && $products->count() > 0)
|
2021-06-05 09:26:32 +00:00
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-header">
|
2023-02-06 21:01:20 +00:00
|
|
|
|
<h5 class="card-title"><i class="fa fa-coins mr-2"></i>{{ $credits_display_name }}</h5>
|
2021-06-05 09:26:32 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<table class="table table-striped table-responsive-sm">
|
|
|
|
|
<thead>
|
2023-03-04 19:41:02 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th>{{ __('Price') }}</th>
|
|
|
|
|
<th>{{ __('Type') }}</th>
|
|
|
|
|
<th>{{ __('Description') }}</th>
|
|
|
|
|
<th></th>
|
|
|
|
|
</tr>
|
2021-12-12 23:58:47 +00:00
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2023-03-04 19:41:02 +00:00
|
|
|
|
@foreach ($products as $product)
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{{ $product->formatToCurrency($product->price) }}</td>
|
|
|
|
|
<td>{{ strtolower($product->type) == 'credits' ? $credits_display_name : $product->type }}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
@if (strtolower($product->type) == 'credits')
|
|
|
|
|
<i class="fa fa-coins mr-2"></i>
|
|
|
|
|
@elseif (strtolower($product->type) == 'server slots')
|
|
|
|
|
<i class="fa fa-server mr-2"></i>
|
|
|
|
|
@endif
|
2022-05-30 07:23:35 +00:00
|
|
|
|
|
2023-03-04 19:41:02 +00:00
|
|
|
|
{{ $product->display }}
|
|
|
|
|
</td>
|
|
|
|
|
<td><a href="{{ route('checkout', $product->id) }}"
|
2023-05-03 07:53:41 +00:00
|
|
|
|
class="btn btn-info @cannot('user.shop.buy') disabled @endcannot">{{ __('Purchase') }}</a>
|
2023-03-04 19:41:02 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
2021-06-05 09:26:32 +00:00
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@else
|
|
|
|
|
<div class="alert alert-danger alert-dismissible">
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
2023-03-04 19:41:02 +00:00
|
|
|
|
<h4><i class="icon fa fa-ban"></i>
|
|
|
|
|
@if ($products->count() == 0)
|
|
|
|
|
{{ __('There are no store products!') }}
|
|
|
|
|
@else
|
|
|
|
|
{{ __('The store is not correctly configured!') }}
|
|
|
|
|
@endif
|
2021-06-05 09:26:32 +00:00
|
|
|
|
</h4>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
<!-- END CONTENT -->
|
|
|
|
|
|
2022-01-04 19:54:21 +00:00
|
|
|
|
<script>
|
|
|
|
|
const getUrlParameter = (param) => {
|
|
|
|
|
const queryString = window.location.search;
|
|
|
|
|
const urlParams = new URLSearchParams(queryString);
|
|
|
|
|
return urlParams.get(param);
|
|
|
|
|
}
|
|
|
|
|
const voucherCode = getUrlParameter('voucher');
|
|
|
|
|
//if voucherCode not empty, open the modal and fill the input
|
|
|
|
|
if (voucherCode) {
|
|
|
|
|
$(function() {
|
|
|
|
|
$('#redeemVoucherModal').modal('show');
|
|
|
|
|
$('#redeemVoucherCode').val(voucherCode);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
2021-06-05 09:26:32 +00:00
|
|
|
|
@endsection
|