Customer document fixed
This commit is contained in:
parent
e79701b037
commit
f825be085a
|
|
@ -7,7 +7,6 @@ use Illuminate\Http\Response;
|
|||
use Webkul\CustomerDocument\Repositories\CustomerDocumentRepository;
|
||||
use Webkul\CustomerDocument\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Validator;
|
||||
|
||||
/**
|
||||
* Document controlller
|
||||
|
|
@ -62,55 +61,52 @@ class DocumentController extends Controller
|
|||
*/
|
||||
public function upload()
|
||||
{
|
||||
$availableMimes = core()->getConfigData('customer.settings.documents.allowed_extensions');
|
||||
$excludedExtensions = core()->getConfigData('customer.settings.documents.allowed_extensions');
|
||||
$maxSize = core()->getConfigData('customer.settings.documents.size');
|
||||
|
||||
if ($maxSize == null) {
|
||||
$valid_extension = explode(',', $excludedExtensions);
|
||||
|
||||
$originalSize = filesize(request()->file('file')) / 1000;
|
||||
|
||||
if ($maxSize != null) {
|
||||
$maxSize = (float) $maxSize * 1000;
|
||||
} else {
|
||||
$maxSize = 5 * 1024;
|
||||
} else {
|
||||
$maxSize = $maxSize * 1024;
|
||||
}
|
||||
|
||||
$maxSize = 10;
|
||||
if (! ($originalSize <= $maxSize) || $originalSize == 0) {
|
||||
session()->flash('error', trans('customerdocument::app.admin.customers.size-error'));
|
||||
|
||||
$customerId = request()->input('customer_id');
|
||||
|
||||
if (strlen($availableMimes)) {
|
||||
$validator = Validator::make(request()->input(), [
|
||||
'file' => 'required|file|mimes:'.$availableMimes.'|size:'.$maxSize
|
||||
]);
|
||||
} else {
|
||||
$validator = Validator::make(request()->input(), [
|
||||
'file' => 'required|file|size:'.$maxSize
|
||||
]);
|
||||
}
|
||||
|
||||
if ($validator->fails()) {
|
||||
session()->flash('error', $validator->errors());
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
try {
|
||||
$data = request()->all();
|
||||
if (in_array(request()->file('file')->getClientOriginalExtension(), $valid_extension)) {
|
||||
session()->flash('error', trans('customerdocument::app.admin.customers.upload-error'));
|
||||
|
||||
if (request()->hasFile('file')) {
|
||||
$dir = 'customer';
|
||||
$document['path'] = request()->file('file')->store($dir);
|
||||
return redirect()->back();
|
||||
} else {
|
||||
try {
|
||||
$data = request()->all();
|
||||
|
||||
if (request()->hasFile('file')) {
|
||||
$dir = 'customer';
|
||||
$document['path'] = request()->file('file')->store($dir);
|
||||
}
|
||||
|
||||
$document['customer_id'] = $data['customer_id'];
|
||||
$document['name'] = $data['name'];
|
||||
$document['description'] = $data['description'];
|
||||
|
||||
$this->customerDocument->create($document);
|
||||
|
||||
session()->flash('success', trans('customerdocument::app.admin.customers.upload-success'));
|
||||
|
||||
return redirect()->back();
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', $e);
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$document['customer_id'] = $data['customer_id'];
|
||||
$document['name'] = $data['name'];
|
||||
$document['description'] = $data['description'];
|
||||
|
||||
$this->customerDocument->create($document);
|
||||
|
||||
session()->flash('success', trans('customerdocument::app.admin.customers.upload-success'));
|
||||
|
||||
return redirect()->back();
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', $e);
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,11 @@ return [
|
|||
'empty' => 'You Do not Have Any Documents.',
|
||||
'allowed-type' => 'Allowed Type :',
|
||||
'file-type' => 'csv, xls, xlsx, ods, png, jpeg, zip.',
|
||||
'upload-error' => 'The file must be a file of type: csv, xls, xlsx, ods, png, jpeg, zip.',
|
||||
'upload-error' => 'Invalid File Format',
|
||||
'size-error' => 'File exceeds allowed size limits',
|
||||
'description' => 'Description',
|
||||
'size' => 'Max Size Allowed (MegaBytes)',
|
||||
'allowed-types' => 'Allowed Types (Use comma to separate multiple formats)',
|
||||
'excluded-type' => 'Excluded Types (Use comma to separate multiple formats)',
|
||||
'any-type' => 'All file types are allowed'
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $documents = $customerDocumentRepository->findWhere(['customer_id' => $customer-
|
|||
$allowedTypes = core()->getConfigData('customer.settings.documents.allowed_extensions');
|
||||
@endphp
|
||||
|
||||
<span>{{ __('customerdocument::app.admin.customers.allowed-type') }}</span>
|
||||
<span>{{ __('customerdocument::app.admin.customers.excluded-type') }}</span>
|
||||
<span>
|
||||
<b>
|
||||
@if ($allowedTypes != null)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@
|
|||
@include ('shop::products.add-to-cart', ['product' => $product])
|
||||
|
||||
@include ('shop::products.buy-now')
|
||||
|
||||
@if ($product->totalQuantity() < 1 && $product->allow_preorder)
|
||||
<button type="submit" class="btn btn-lg btn-primary pre-order-btn" style="width: 100%; display: none;">
|
||||
{{ __('preorder::app.shop.products.preorder') }}
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,414 +0,0 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('shop::app.customer.account.order.view.page-tile', ['order_id' => $order->id]) }}
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/preorder/assets/css/preorder.css') }}">
|
||||
@endpush
|
||||
|
||||
@section('content-wrapper')
|
||||
|
||||
<div class="account-content">
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
||||
<div class="account-layout">
|
||||
|
||||
<div class="account-head">
|
||||
<span class="back-icon"><a href="{{ route('customer.account.index') }}"><i class="icon icon-menu-back"></i></a></span>
|
||||
<span class="account-heading">
|
||||
{{ __('shop::app.customer.account.order.view.page-tile', ['order_id' => $order->id]) }}
|
||||
</span>
|
||||
<span></span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.orders.view.before', ['order' => $order]) !!}
|
||||
|
||||
<div class="sale-container">
|
||||
|
||||
<tabs>
|
||||
<tab name="{{ __('shop::app.customer.account.order.view.info') }}" :selected="true">
|
||||
|
||||
<?php
|
||||
$preOrderItemRepository = app('Webkul\SAASPreOrder\Repositories\PreOrderItemRepository');
|
||||
|
||||
$havePreOrderItems = $preOrderItemRepository->havePreOrderItems($order->id);
|
||||
?>
|
||||
|
||||
@if ($havePreOrderItems)
|
||||
<div class="preorder-info">{{ __('preorder::app.shop.sales.orders.preorder-summary') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">
|
||||
{{ __('shop::app.customer.account.order.view.placed-on') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ core()->formatDate($order->created_at, 'd M Y') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('shop::app.customer.account.order.view.products-ordered') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('shop::app.customer.account.order.view.SKU') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.product-name') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.price') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.item-status') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.subtotal') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.tax-percent') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.tax-amount') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.grand-total') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach ($order->items as $item)
|
||||
<tr>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}">
|
||||
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}
|
||||
</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}">
|
||||
{{ $item->name }}
|
||||
|
||||
@if ($preOrderItem = $preOrderItemRepository->findOneByField('order_item_id', $item->id))
|
||||
<div class="pre-order-item-info">
|
||||
<span class="heading" @if($item->type == 'configurable')style="margin-top: 0"@endif>
|
||||
{{ __('preorder::app.shop.sales.orders.preorder-information') }}
|
||||
</span>
|
||||
|
||||
<span class="row">
|
||||
<b>{{ __('preorder::app.shop.sales.orders.type') }}</b>
|
||||
|
||||
{{ $preOrderItem->type_label }}
|
||||
</span>
|
||||
|
||||
<span class="row">
|
||||
<b>{{ __('preorder::app.shop.sales.orders.status') }}</b>
|
||||
|
||||
{{ $preOrderItem->status_label }}
|
||||
</span>
|
||||
|
||||
@if ($preOrderItem->payment_order_item)
|
||||
<span class="row">
|
||||
<b>{{ __('preorder::app.shop.sales.orders.payment-order') }}</b>
|
||||
|
||||
<a href="{{ route('customer.orders.view', $preOrderItem->payment_order_item->order_id) }}" target="_blank">
|
||||
#{{ $preOrderItem->payment_order_item->order_id }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@elseif ($preOrderItem = app('Webkul\SAASPreOrder\Repositories\PreOrderItemRepository')->findOneByField('payment_order_item_id', $item->id))
|
||||
<div class="pre-order-item-info">
|
||||
<span class="heading" @if($item->type == 'configurable')style="margin-top: 0"@endif>
|
||||
{{ __('preorder::app.shop.sales.orders.preorder-payment-information') }}
|
||||
</span>
|
||||
|
||||
<span class="row">
|
||||
<b>{{ __('preorder::app.shop.sales.orders.reference-order') }}</b>
|
||||
|
||||
<a href="{{ route('customer.orders.view', $preOrderItem->order_id) }}" target="_blank">
|
||||
#{{ $preOrderItem->order_id }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.item-status') }}">
|
||||
<span class="qty-row">
|
||||
{{ __('shop::app.customer.account.order.view.item-ordered', ['qty_ordered' => $item->qty_ordered]) }}
|
||||
</span>
|
||||
|
||||
<span class="qty-row">
|
||||
{{ $item->qty_invoiced ? __('shop::app.customer.account.order.view.item-invoice', ['qty_invoiced' => $item->qty_invoiced]) : '' }}
|
||||
</span>
|
||||
|
||||
<span class="qty-row">
|
||||
{{ $item->qty_shipped ? __('shop::app.customer.account.order.view.item-shipped', ['qty_shipped' => $item->qty_shipped]) : '' }}
|
||||
</span>
|
||||
|
||||
<span class="qty-row">
|
||||
{{ $item->qty_canceled ? __('shop::app.customer.account.order.view.item-canceled', ['qty_canceled' => $item->qty_canceled]) : '' }}
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.subtotal') }}">{{ core()->formatPrice($item->total, $order->order_currency_code) }}</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.tax-percent') }}">{{ number_format($item->tax_percent, 2) }}%</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.tax-amount') }}">{{ core()->formatPrice($item->tax_amount, $order->order_currency_code) }}</td>
|
||||
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.grand-total') }}">
|
||||
{{ core()->formatPrice($item->total + $item->tax_amount, $order->order_currency_code) }}
|
||||
|
||||
<?php $canBeComplete = $preOrderItemRepository->canBeComplete($item); ?>
|
||||
|
||||
@if ($canBeComplete)
|
||||
<a href="{{ route('preorder.shop.preorder.complete', $preOrderItem->token) }}" style="margin-top: 5px" class="btn btn-primary btn-sm">Complete Preorder</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="totals">
|
||||
<table class="sale-summary">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.subtotal') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->sub_total, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.shipping-handling') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->shipping_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="border">
|
||||
<td>{{ __('shop::app.customer.account.order.view.tax') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->tax_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.grand-total') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->grand_total, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.total-paid') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->grand_total_invoiced, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.total-refunded') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->grand_total_refunded, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.total-due') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($order->total_due, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
|
||||
@if ($order->invoices->count())
|
||||
<tab name="{{ __('shop::app.customer.account.order.view.invoices') }}">
|
||||
|
||||
@foreach ($order->invoices as $invoice)
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-invoice', ['invoice_id' => $invoice->id]) }}</span>
|
||||
|
||||
<a href="{{ route('customer.orders.print', $invoice->id) }}" class="pull-right">
|
||||
{{ __('shop::app.customer.account.order.view.print') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<div class="table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('shop::app.customer.account.order.view.SKU') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.product-name') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.price') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.qty') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.subtotal') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.tax-amount') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.grand-total') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach ($invoice->items as $item)
|
||||
<tr>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}">{{ $item->child ? $item->child->sku : $item->sku }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}">{{ $item->name }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}">{{ $item->qty }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.subtotal') }}">{{ core()->formatPrice($item->total, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.tax-amount') }}">{{ core()->formatPrice($item->tax_amount, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.grand-total') }}">{{ core()->formatPrice($item->total + $item->tax_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="totals">
|
||||
<table class="sale-summary">
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.subtotal') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($invoice->sub_total, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.shipping-handling') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($invoice->shipping_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.tax') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($invoice->tax_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.grand-total') }}</td>
|
||||
<td>-</td>
|
||||
<td>{{ core()->formatPrice($invoice->grand_total, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tab>
|
||||
@endif
|
||||
|
||||
@if ($order->shipments->count())
|
||||
<tab name="{{ __('shop::app.customer.account.order.view.shipments') }}">
|
||||
|
||||
@foreach ($order->shipments as $shipment)
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-shipment', ['shipment_id' => $shipment->id]) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
|
||||
<div class="table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('shop::app.customer.account.order.view.SKU') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.product-name') }}</th>
|
||||
<th>{{ __('shop::app.customer.account.order.view.qty') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach ($shipment->items as $item)
|
||||
|
||||
<tr>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}">{{ $item->sku }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}">{{ $item->name }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}">{{ $item->qty }}</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tab>
|
||||
@endif
|
||||
</tabs>
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="section-content" style="border-bottom: 0">
|
||||
<div class="order-box-container">
|
||||
<div class="box">
|
||||
<div class="box-title">
|
||||
{{ __('shop::app.customer.account.order.view.shipping-address') }}
|
||||
</div>
|
||||
|
||||
<div class="box-content">
|
||||
|
||||
@include ('admin::sales.address', ['address' => $order->billing_address])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-title">
|
||||
{{ __('shop::app.customer.account.order.view.billing-address') }}
|
||||
</div>
|
||||
|
||||
<div class="box-content">
|
||||
|
||||
@include ('admin::sales.address', ['address' => $order->shipping_address])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-title">
|
||||
{{ __('shop::app.customer.account.order.view.shipping-method') }}
|
||||
</div>
|
||||
|
||||
<div class="box-content">
|
||||
|
||||
{{ $order->shipping_title }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-title">
|
||||
{{ __('shop::app.customer.account.order.view.payment-method') }}
|
||||
</div>
|
||||
|
||||
<div class="box-content">
|
||||
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.orders.view.after', ['order' => $order]) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
<div class="footer">
|
||||
<div class="footer-content">
|
||||
<div class="footer-list-container">
|
||||
|
||||
<?php
|
||||
$categories = [];
|
||||
|
||||
foreach (app('Webkul\CustomerGroupCatalog\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category){
|
||||
if ($category->slug)
|
||||
array_push($categories, $category);
|
||||
}
|
||||
?>
|
||||
|
||||
@if (count($categories))
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Categories</span>
|
||||
|
||||
<ul class="list-group">
|
||||
@foreach ($categories as $key => $category)
|
||||
<li>
|
||||
<a href="{{ route('shop.categories.index', $category->slug) }}">{{ $category->name }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! DbView::make(core()->getCurrentChannel())->field('footer_content')->render() !!}
|
||||
|
||||
<div class="list-container">
|
||||
@if(core()->getConfigData('customer.settings.newsletter.subscription'))
|
||||
<span class="list-heading">{{ __('shop::app.footer.subscribe-newsletter') }}</span>
|
||||
<div class="form-container">
|
||||
<form action="{{ route('shop.subscribe') }}">
|
||||
<div class="control-group" :class="[errors.has('subscriber_email') ? 'has-error' : '']">
|
||||
<input type="email" class="control subscribe-field" name="subscriber_email" placeholder="Email Address" required><br/>
|
||||
|
||||
<button class="btn btn-md btn-primary">{{ __('shop::app.subscription.subscribe') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<?php
|
||||
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
|
||||
$searchTerm = explode("?", $query);
|
||||
|
||||
foreach($searchTerm as $term){
|
||||
if (strpos($term, 'term') !== false) {
|
||||
$serachQuery = $term;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<span class="list-heading">{{ __('shop::app.footer.locale') }}</span>
|
||||
<div class="form-container">
|
||||
<div class="control-group">
|
||||
<select class="control locale-switcher" onchange="window.location.href = this.value" @if (count(core()->getCurrentChannel()->locales) == 1) disabled="disabled" @endif>
|
||||
|
||||
@foreach (core()->getCurrentChannel()->locales as $locale)
|
||||
@if(isset($serachQuery))
|
||||
<option value="?{{ $serachQuery }}?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
|
||||
@else
|
||||
<option value="?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="currency">
|
||||
<span class="list-heading">{{ __('shop::app.footer.currency') }}</span>
|
||||
<div class="form-container">
|
||||
<div class="control-group">
|
||||
<select class="control locale-switcher" onchange="window.location.href = this.value">
|
||||
|
||||
@foreach (core()->getCurrentChannel()->currencies as $currency)
|
||||
@if(isset($serachQuery))
|
||||
<option value="?{{ $serachQuery }}?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
|
||||
@else
|
||||
<option value="?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
{!! view_render_event('bagisto.shop.layout.header.category.before') !!}
|
||||
|
||||
<?php
|
||||
|
||||
$categories = [];
|
||||
|
||||
foreach (app('Webkul\CustomerGroupCatalog\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
|
||||
if ($category->slug)
|
||||
array_push($categories, $category);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
|
||||
|
||||
{!! view_render_event('bagisto.shop.layout.header.category.after') !!}
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
|
||||
<script type="text/x-template" id="category-nav-template">
|
||||
|
||||
<ul class="nav">
|
||||
<category-item
|
||||
v-for="(item, index) in items"
|
||||
:key="index"
|
||||
:url="url"
|
||||
:item="item"
|
||||
:parent="index">
|
||||
</category-item>
|
||||
</ul>
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('category-nav', {
|
||||
|
||||
template: '#category-nav-template',
|
||||
|
||||
props: {
|
||||
categories: {
|
||||
type: [Array, String, Object],
|
||||
required: false,
|
||||
default: (function () {
|
||||
return [];
|
||||
})
|
||||
},
|
||||
|
||||
url: String
|
||||
},
|
||||
|
||||
data: function(){
|
||||
return {
|
||||
items_count:0
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
items: function() {
|
||||
return JSON.parse(this.categories)
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-template" id="category-item-template">
|
||||
<li>
|
||||
<a :href="url+'/categories/'+this.item['translations'][0].slug">
|
||||
@{{ name }} 
|
||||
<i class="icon dropdown-right-icon" v-if="haveChildren && item.parent_id != null"></i>
|
||||
</a>
|
||||
|
||||
<i :class="[show ? 'icon icon-arrow-down mt-15' : 'icon dropdown-right-icon left mt-15']"
|
||||
v-if="haveChildren" @click="showOrHide"></i>
|
||||
|
||||
<ul v-if="haveChildren && show">
|
||||
<category-item
|
||||
v-for="(child, index) in item.children"
|
||||
:key="index"
|
||||
:url="url"
|
||||
:item="child">
|
||||
</category-item>
|
||||
</ul>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('category-item', {
|
||||
|
||||
template: '#category-item-template',
|
||||
|
||||
props: {
|
||||
item: Object,
|
||||
url: String,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
return {
|
||||
items_count:0,
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
if(window.innerWidth > 770){
|
||||
this.show = true;
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
haveChildren: function() {
|
||||
return this.item.children.length ? true : false;
|
||||
},
|
||||
|
||||
name: function() {
|
||||
if (this.item.translations && this.item.translations.length) {
|
||||
this.item.translations.forEach(function(translation) {
|
||||
if (translation.locale == document.documentElement.lang)
|
||||
return translation.name;
|
||||
});
|
||||
}
|
||||
|
||||
return this.item.name;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
showOrHide: function() {
|
||||
this.show = !this.show;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
@if ($product->type != "configurable" && $product->totalQuantity() < 1 && $product->allow_preorder)
|
||||
@if (core()->getConfigData('preorder.settings.general.percent'))
|
||||
@if (core()->getConfigData('preorder.settings.general.preorder_type') == 'partial')
|
||||
<p>{{ __('preorder::app.shop.products.percent-to-pay', ['percent' => core()->getConfigData('preorder.settings.general.percent')]) }}</p>
|
||||
@endif
|
||||
@else
|
||||
<p>{{ __('preorder::app.shop.products.nothing-to-pay') }}</p>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($product->type == "configurable")
|
||||
<div class="cart-wish-wrap">
|
||||
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">
|
||||
{{ __('shop::app.products.add-to-cart') }}
|
||||
</a>
|
||||
|
||||
@include('shop::products.wishlist')
|
||||
</div>
|
||||
@else
|
||||
<div class="cart-wish-wrap">
|
||||
<form action="{{ route('cart.add', $product->product_id) }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="product" value="{{ $product->product_id }}">
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<input type="hidden" value="false" name="is_configurable">
|
||||
|
||||
@if ($product->totalQuantity() < 1 && $product->allow_preorder)
|
||||
<button class="btn btn-lg btn-primary addtocart">{{ __('preorder::app.shop.products.preorder') }}</button>
|
||||
@else
|
||||
<button class="btn btn-lg btn-primary addtocart" {{ $product->haveSufficientQuantity(1) ? '' : 'disabled' }}>{{ __('shop::app.products.add-to-cart') }}</button>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
@include('shop::products.wishlist')
|
||||
</div>
|
||||
@endif
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ $category->meta_title ?? $category->name }}
|
||||
@stop
|
||||
|
||||
@section('seo')
|
||||
<meta name="description" content="{{ $category->meta_description }}"/>
|
||||
<meta name="keywords" content="{{ $category->meta_keywords }}"/>
|
||||
@stop
|
||||
|
||||
@section('content-wrapper')
|
||||
@inject ('productRepository', 'Webkul\Product\Repositories\ProductRepository')
|
||||
|
||||
<div class="main">
|
||||
{!! view_render_event('bagisto.shop.products.index.before', ['category' => $category]) !!}
|
||||
|
||||
<div class="category-container">
|
||||
|
||||
@if (in_array($category->display_mode, [null, 'products_only', 'products_and_description']))
|
||||
@include ('shop::products.list.layered-navigation')
|
||||
@endif
|
||||
|
||||
<div class="category-block" @if ($category->display_mode == 'description_only') style="width: 100%" @endif>
|
||||
<div class="hero-image mb-35">
|
||||
@if (!is_null($category->image))
|
||||
<img class="logo" src="{{ $category->image_url }}" />
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if (in_array($category->display_mode, [null, 'description_only', 'products_and_description']))
|
||||
@if ($category->description)
|
||||
<div class="category-description">
|
||||
{!! $category->description !!}
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (in_array($category->display_mode, [null, 'products_only', 'products_and_description']))
|
||||
<?php $products = $productRepository->getAll($category->id); ?>
|
||||
|
||||
@if ($products->count())
|
||||
|
||||
@include ('shop::products.list.toolbar')
|
||||
|
||||
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar')
|
||||
|
||||
@if ($toolbarHelper->getCurrentMode() == 'grid')
|
||||
<div class="product-grid-3">
|
||||
@foreach ($products as $productFlat)
|
||||
|
||||
@include ('shop::products.list.card', ['product' => $productFlat])
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<div class="product-list">
|
||||
@foreach ($products as $productFlat)
|
||||
|
||||
@include ('shop::products.list.card', ['product' => $productFlat])
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.index.pagination.before', ['category' => $category]) !!}
|
||||
|
||||
<div class="bottom-toolbar">
|
||||
{{ $products->appends(request()->input())->links() }}
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.index.pagination.after', ['category' => $category]) !!}
|
||||
|
||||
@else
|
||||
|
||||
<div class="product-list empty">
|
||||
<h2>{{ __('shop::app.products.whoops') }}</h2>
|
||||
|
||||
<p>
|
||||
{{ __('shop::app.products.empty') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.index.after', ['category' => $category]) !!}
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$(".sort-icon, .filter-icon").on('click', function(e){
|
||||
var currentElement = $(e.currentTarget);
|
||||
if (currentElement.hasClass('sort-icon')) {
|
||||
currentElement.removeClass('sort-icon');
|
||||
currentElement.addClass('icon-menu-close-adj');
|
||||
currentElement.next().removeClass();
|
||||
currentElement.next().addClass('icon filter-icon');
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$('.pager').css('display','flex');
|
||||
$('.pager').css('justify-content','space-between');
|
||||
} else if (currentElement.hasClass('filter-icon')) {
|
||||
currentElement.removeClass('filter-icon');
|
||||
currentElement.addClass('icon-menu-close-adj');
|
||||
currentElement.prev().removeClass();
|
||||
currentElement.prev().addClass('icon sort-icon');
|
||||
$('.pager').css('display','none');
|
||||
$('.responsive-layred-filter').css('display','block');
|
||||
$('.responsive-layred-filter').css('margin-top','10px');
|
||||
} else {
|
||||
currentElement.removeClass('icon-menu-close-adj');
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$('.pager').css('display','none');
|
||||
if ($(this).index() == 0) {
|
||||
currentElement.addClass('sort-icon');
|
||||
} else {
|
||||
currentElement.addClass('filter-icon');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{!! view_render_event('bagisto.shop.products.view.product-add.after', ['product' => $product]) !!}
|
||||
|
||||
<div class="add-to-buttons">
|
||||
@if ($product->type != 'configurable')
|
||||
@if ($product->totalQuantity() < 1 && $product->allow_preorder)
|
||||
<button type="submit" class="btn btn-lg btn-primary addtocart" style="width: 100%">
|
||||
{{ __('preorder::app.shop.products.preorder') }}
|
||||
</button>
|
||||
@else
|
||||
@include ('shop::products.add-to-cart', ['product' => $product])
|
||||
|
||||
@include ('shop::products.buy-now')
|
||||
@endif
|
||||
@else
|
||||
@include ('shop::products.add-to-cart', ['product' => $product])
|
||||
|
||||
@include ('shop::products.buy-now')
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.view.product-add.after', ['product' => $product]) !!}
|
||||
Loading…
Reference in New Issue