customer pannel
This commit is contained in:
parent
ba2ad4bd28
commit
8717edf059
|
|
@ -56,6 +56,13 @@ class OrdersController extends Controller
|
|||
}
|
||||
|
||||
public function orders() {
|
||||
return view($this->_config['view']);
|
||||
|
||||
$id = auth()->guard('customer')->user()->id;
|
||||
|
||||
$order = $this->customer->with('customerOrder')->findOneWhere(['id'=>$id]);
|
||||
|
||||
return view($this->_config['view'],compact('order'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace Webkul\Customer\Models;
|
|||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Webkul\Customer\Models\CustomersGroups;
|
||||
use Webkul\Sales\Models\Order;
|
||||
|
||||
// use Webkul\User\Notifications\AdminResetPassword;
|
||||
|
||||
|
|
@ -38,5 +39,13 @@ class Customer extends Authenticatable
|
|||
return $this->belongsTo(CustomersGroups::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the customer order.
|
||||
*/
|
||||
public function customerOrder()
|
||||
{
|
||||
return $this->hasMany(Order::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace Webkul\Sales\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Sales\Contracts\OrderAddress as OrderAddressContract;
|
||||
use Webkul\Customer\Models\Customer;
|
||||
|
||||
class OrderAddress extends Model implements OrderAddressContract
|
||||
{
|
||||
|
|
@ -19,7 +18,7 @@ class OrderAddress extends Model implements OrderAddressContract
|
|||
{
|
||||
return $this->first_name . ' ' . $this->last_name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the customer record associated with the order.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
|
||||
/* Reviews route */
|
||||
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
|
||||
'view' => 'shop::customers.account.reviews.reviews'
|
||||
'view' => 'shop::customers.account.reviews.index'
|
||||
])->name('customer.reviews.index');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
showOrHide: function() {
|
||||
alert('gfgf');
|
||||
this.show = !this.show;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,18 @@ return [
|
|||
'title' => 'Edit Address',
|
||||
'submit' => 'Edit Address'
|
||||
]
|
||||
],
|
||||
|
||||
'order' => [
|
||||
'index' => [
|
||||
'page-title' => 'Customer-Order',
|
||||
'title' => 'Orders',
|
||||
'order_id' => 'Order ID',
|
||||
'date' => 'Date',
|
||||
'status' => 'Status',
|
||||
'item' => 'Item',
|
||||
'total' => 'total'
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1 +1,56 @@
|
|||
<h1>Customer past orders page</h1>
|
||||
|
||||
@extends('shop::layouts.master')
|
||||
@section('page_title')
|
||||
{{ __('shop::app.customer.account.order.index.page-title') }}
|
||||
@endsection
|
||||
|
||||
@section('content-wrapper')
|
||||
|
||||
<div class="account-content">
|
||||
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
||||
<div class="account profile">
|
||||
|
||||
<div class="section-head">
|
||||
<h3> {{ __('shop::app.customer.account.order.index.title') }} </h3>
|
||||
</div>
|
||||
|
||||
{{ dd($order)}}
|
||||
|
||||
<div class="profile-content">
|
||||
<div class="table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th> {{ __('shop::app.customer.account.order.index.order_id') }}</th>
|
||||
<th> {{ __('shop::app.customer.account.order.index.date') }} </th>
|
||||
<th> {{ __('shop::app.customer.account.order.index.status')}} </th>
|
||||
<th> {{ __('shop::app.customer.account.order.index.item') }} </th>
|
||||
<th> {{ __('shop::app.customer.account.order.index.total') }} </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PROD124</td>
|
||||
<td>Apple iPhone 7- White-32GB</td>
|
||||
<td>Packed (2)</td>
|
||||
<td>2</td>
|
||||
<td>$700.00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PROD128</td>
|
||||
<td>Blue Linen T-Shirt for Men- Small- Red</td>
|
||||
<td>Shipped (2)</td>
|
||||
<td>2</td>
|
||||
<td>$35.00</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('page_title')
|
||||
{{ __('shop::app.customer.account.profile.index.page-title') }}
|
||||
{{ __('shop::app.order.page-title') }}
|
||||
@endsection
|
||||
@section('content-wrapper')
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
@inject ('productImageHelper', 'Webkul\Product\Product\ProductImage')
|
||||
|
||||
@extends('shop::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<div class="account-content">
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
||||
<div class="profile">
|
||||
|
||||
<h1> Reviews</h1>
|
||||
|
||||
@foreach($reviews as $review)
|
||||
<div class="profile-content">
|
||||
|
||||
<?php $images = $productImageHelper->getGalleryImages($review->product); ?>
|
||||
|
||||
<div class="pro-img">
|
||||
<img src="{{ $images[0]['small_image_url'] }}" />
|
||||
</div>
|
||||
|
||||
<div class="pro-discription">
|
||||
|
||||
<div class="title">
|
||||
{{ $review->product->name }}
|
||||
</div>
|
||||
|
||||
<div class="rating">
|
||||
@for($i=0 ; $i < $review->rating ; $i++)
|
||||
<span class="icon star-icon"></span>
|
||||
@endfor
|
||||
</div>
|
||||
|
||||
<div class="discription">
|
||||
{{ $review->comment }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="account-content">
|
||||
@inject ('productImageHelper', 'Webkul\Product\Product\ProductImage')
|
||||
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
||||
<div class="profile">
|
||||
|
||||
<div class="section-head">
|
||||
<span class="profile-heading">{{ __('shop::app.wishlist.title') }}</span>
|
||||
|
||||
@if(count($items))
|
||||
<div class="profile-edit">
|
||||
<a href="" style="margin-right: 15px;">{{ __('shop::app.wishlist.deleteall') }}</a>
|
||||
<a href="">{{ __('shop::app.wishlist.moveall') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="horizontal-rule"></div>
|
||||
</div>
|
||||
|
||||
<div class="profile-content">
|
||||
|
||||
@if(count($items))
|
||||
@foreach($items as $item)
|
||||
<div class="wishlist-item mb-10">
|
||||
<div class="media-info">
|
||||
@php
|
||||
$image = $productImageHelper->getProductBaseImage($item);
|
||||
@endphp
|
||||
<img class="media" src="{{ $image['small_image_url'] }}" />
|
||||
|
||||
<div class="info mt-20">
|
||||
<div class="product-name">{{$item->name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="operations">
|
||||
<a class="mb-50" href="{{ route('customer.wishlist.remove', $item->id) }}"><span class="icon trash-icon"></span></a>
|
||||
|
||||
<button class="btn btn-primary btn-md">Move To Cart</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="horizontal-rule mb-10 mt-10"></div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="empty">
|
||||
{{ __('customer::app.wishlist.empty') }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
@inject ('productImageHelper', 'Webkul\Product\Product\ProductImage')
|
||||
|
||||
@extends('shop::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<div class="account-content">
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
||||
<div class="cusomer-section">
|
||||
|
||||
<h1> Reviews</h1>
|
||||
|
||||
@foreach($reviews as $review)
|
||||
<div class="customer-section-info">
|
||||
|
||||
<?php $images = $productImageHelper->getGalleryImages($review->product); ?>
|
||||
|
||||
<div class="pro-img">
|
||||
<img src="{{ $images[0]['small_image_url'] }}" />
|
||||
</div>
|
||||
|
||||
<div class="pro-discription">
|
||||
|
||||
<div class="title">
|
||||
{{ $review->product->name }}
|
||||
</div>
|
||||
|
||||
<div class="rating">
|
||||
@for($i=0 ; $i < $review->rating ; $i++)
|
||||
<span class="icon star-icon"></span>
|
||||
@endfor
|
||||
</div>
|
||||
|
||||
<div class="discription">
|
||||
{{ $review->comment }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -280,6 +280,8 @@
|
|||
var thumbFrame = document.getElementsByClassName('thumb-frame');
|
||||
var productHeroImage = document.getElementsByClassName('product-hero-image')[0];
|
||||
|
||||
console.log(productHeroImage);
|
||||
|
||||
search.addEventListener("click", header);
|
||||
hamMenu.addEventListener("click", header);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@
|
|||
var state = document.readyState
|
||||
var galleryTemplate = document.getElementById('product-gallery-template');
|
||||
var addTOButton = document.getElementsByClassName('add-to-buttons')[0];
|
||||
var productHeroImage = document.getElementsByClassName('product-hero-image')[0];
|
||||
|
||||
if(galleryTemplate){
|
||||
if (state == 'interactive') {
|
||||
|
|
@ -98,6 +97,7 @@
|
|||
|
||||
var thumbList = document.getElementsByClassName('thumb-list')[0];
|
||||
var thumbFrame = document.getElementsByClassName('thumb-frame');
|
||||
var productHeroImage = document.getElementsByClassName('product-hero-image')[0];
|
||||
|
||||
// for product page resize image
|
||||
if(thumbList && productHeroImage){
|
||||
|
|
|
|||
|
|
@ -30845,6 +30845,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
// define the item component
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
|
|
@ -30855,32 +30856,20 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|||
data: function data() {
|
||||
return {
|
||||
items_count: 0,
|
||||
show: false,
|
||||
margin: 0
|
||||
show: false
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
mounted: function mounted() {
|
||||
if (window.innerWidth > 770) {
|
||||
this.show = true;
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
haveChildren: function haveChildren() {
|
||||
|
||||
console.log(this.margin++);
|
||||
|
||||
if (this.item.children.length) {
|
||||
|
||||
console.log(this.margin++);
|
||||
}
|
||||
|
||||
return this.item.children.length ? true : false;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
showOrHide: function showOrHide() {
|
||||
this.show = !this.show;
|
||||
|
|
@ -30915,19 +30904,20 @@ var render = function() {
|
|||
_vm.haveChildren || _vm.item.parent_id == null
|
||||
? _c("i", {
|
||||
class: [
|
||||
_vm.show ? "icon expand-icon mt-15" : "icon expand-on-icon mt-15"
|
||||
_vm.show
|
||||
? "icon arrow-down-icon mt-15"
|
||||
: "icon dropdown-right-icon mt-15"
|
||||
],
|
||||
on: { click: _vm.showOrHide }
|
||||
})
|
||||
: _vm._e(),
|
||||
_vm._v(" "),
|
||||
_vm.haveChildren
|
||||
_vm.haveChildren && _vm.show
|
||||
? _c(
|
||||
"ul",
|
||||
_vm._l(_vm.item.children, function(child, index) {
|
||||
return _c("category-item", {
|
||||
key: index,
|
||||
style: "margin-left: " + 20 + "px",
|
||||
attrs: { url: _vm.url, item: child }
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue