This commit is contained in:
rahul shukla 2018-10-15 16:15:29 +05:30
commit f1a0a2bcda
12 changed files with 137 additions and 425 deletions

View File

@ -5,7 +5,7 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Sales\Repositories\OrderRepository;
use Auth;
/**
@ -26,26 +26,18 @@ class OrdersController extends Controller
*/
protected $_config;
protected $customer;
protected $order;
public function __construct(CustomerRepository $customer)
public function __construct(CustomerRepository $customer ,OrderRepository $order)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
$this->order = $order;
}
public function index() {
@ -60,9 +52,9 @@ class OrdersController extends Controller
$id = auth()->guard('customer')->user()->id;
$order = $this->customer->with('customerOrder')->findOneWhere(['id'=>$id]);
$orders = $this->order->customerOrder($id);
return view($this->_config['view'],compact('order'));
return view($this->_config['view'],compact('orders'));
}
}

View File

@ -38,14 +38,4 @@ class Customer extends Authenticatable
{
return $this->belongsTo(CustomersGroups::class);
}
/**
* Get the customer order.
*/
public function customerOrder()
{
return $this->hasMany(Order::class);
}
}

View File

@ -71,7 +71,7 @@ class OrderRepository extends Repository
public function create(array $data)
{
DB::beginTransaction();
try {
Event::fire('checkout.order.save.before', $data);
@ -97,7 +97,7 @@ class OrderRepository extends Repository
$order->payment()->create($data['payment']);
$order->addresses()->create($data['shipping_address']);
$order->addresses()->create($data['billing_address']);
foreach($data['items'] as $item) {
@ -114,7 +114,7 @@ class OrderRepository extends Repository
throw $e;
}
DB::commit();
Event::fire('checkout.order.save.after', $order);
@ -180,4 +180,13 @@ class OrderRepository extends Repository
return $order;
}
/**
* @param int $customerId
* @return void
*/
public function customerOrder($customerId)
{
return $this->model->where('customer_id',$customerId)->get();
}
}

View File

@ -5,7 +5,7 @@
v-if="haveChildren && item.parent_id != null"></i></a>
<i :class="[show ? 'icon arrow-down-icon mt-15' : 'icon dropdown-right-icon mt-15']"
v-if="haveChildren || item.parent_id == null" @click="showOrHide"></i>
v-if="haveChildren" @click="showOrHide"></i>
<ul v-if="haveChildren && show">
<category-item

View File

@ -121,6 +121,12 @@ return [
'item' => 'Item',
'total' => 'total'
]
],
'review' => [
'index' => [
'title' => 'Reviews'
]
]
]
],

View File

@ -7,18 +7,17 @@
@section('content-wrapper')
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<div class="account profile">
<div class="account-layout">
<div class="section-head">
<h3> {{ __('shop::app.customer.account.order.index.title') }} </h3>
<div class="account-head">
<span class="account-heading">{{ __('shop::app.customer.account.order.index.title') }}</span>
<div class="horizontal-rule"></div>
</div>
{{ dd($order)}}
<div class="account-items-list">
<div class="profile-content">
<div class="table">
<table>
<thead>
@ -30,27 +29,25 @@
<th> {{ __('shop::app.customer.account.order.index.total') }} </th>
</tr>
</thead>
<tbody>
@foreach($orders as $order)
<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>{{ $order->id }}</td>
<td></td>
<td>Shipped (2)</td>
<td>2</td>
<td>$35.00</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,7 +1,7 @@
<div class="side-menu-title mb-20" id="side-menu-title">
{{-- <div class="side-menu-title mb-20" id="side-menu-title">
<strong>Menu</strong>
<i class="icon icon-arrow-down right" id="down-icon"></i>
</div>
</div> --}}
<ul class="account-side-menu">
@foreach($menu->items as $key=>$value)

View File

@ -5,92 +5,50 @@
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<div class="profile">
<div class="account-layout">
<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="account-head">
<span class="account-heading">{{ __('shop::app.customer.account.review.index.title') }}</span>
<div class="horizontal-rule"></div>
</div>
<div class="profile-content">
<div class="account-items-list">
@if(count($items))
@foreach($items as $item)
<div class="wishlist-item mb-10">
@if(is_null($reviews))
@foreach($reviews as $review)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
@php
$image = $productImageHelper->getProductBaseImage($item);
@endphp
<img class="media" src="{{ $image['small_image_url'] }}" />
<?php $image = $productImageHelper->getGalleryImages($review->product); ?>
<img class="media" src="{{ $image[0]['small_image_url'] }}" />
<div class="info mt-20">
<div class="product-name">{{$item->name}}</div>
<div class="product-name">{{$review->product->name}}</div>
<div>
@for($i=0 ; $i < $review->rating ; $i++)
<span class="icon star-icon"></span>
@endfor
</div>
<div>
{{ $review->comment }}
</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
@endforeach
@else
<div class="empty">
{{ __('customer::app.wishlist.empty') }}
{{-- {{ __('customer::app.wishlist.empty') }} --}}
</div>
@endif
</div>
</div>
</div>

View File

@ -0,0 +1,65 @@
@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="account-layout">
<div class="account-head">
<span class="account-heading">Reviews</span>
<div class="horizontal-rule"></div>
</div>
<div class="account-items-list">
{{-- <div class="account-item-card mt-15 mb-15">
<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> --}}
@foreach($reviews as $review)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
<?php $image = $productImageHelper->getGalleryImages($review->product); ?>
<img class="media" src="{{ $image[0]['small_image_url'] }}" />
<div class="info mt-20">
<div class="product-name">{{$review->product->name}}</div>
<div>
@for($i=0 ; $i < $review->rating ; $i++)
<span class="icon star-icon"></span>
@endfor
</div>
<div>
{{ $review->comment }}
</div>
</div>
</div>
<div class="operations">
</div>
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
</div>
</div>
</div>
@endsection

View File

@ -280,8 +280,6 @@
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);
@ -312,25 +310,25 @@
// for header responsive icon
function header(){
var className = document.getElementById(this.id).className;
if(className === 'icon search-icon' ){
search.classList.remove("search-icon");
if(className === 'icon icon-search' ){
search.classList.remove("icon-search");
search.classList.add("icon-menu-close");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("sortable-icon");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'block';
navResponsive.style.display = 'none';
}else if(className === 'icon sortable-icon'){
hamMenu.classList.remove("sortable-icon");
}else if(className === 'icon icon-menu'){
hamMenu.classList.remove("icon-menu");
hamMenu.classList.add("icon-menu-close");
search.classList.remove("icon-menu-close");
search.classList.add("search-icon");
search.classList.add("icon-search");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'block';
}else{
search.classList.remove("icon-menu-close");
search.classList.add("search-icon");
search.classList.add("icon-search");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("sortable-icon");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'none';
}

View File

@ -1524,309 +1524,6 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
text-align: center;
}
<<<<<<< HEAD
.content {
padding-top: 15%;
padding-bottom: 15%;
}
.content .sign-up-text {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 18px;
color: #A5A5A5;
text-align: center;
}
.content .login-form {
margin-left: auto;
margin-right: auto;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
border: 1px solid #E8E8E8;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
max-width: 530px;
min-width: 380px;
min-height: 345px;
padding-left: 25px;
padding-right: 25px;
}
.content .login-form .login-text {
font-size: 24px;
font-weight: bold;
color: #242424;
margin-top: 5%;
margin-bottom: 3%;
}
.content .login-form .control-group {
margin-bottom: 15px !important;
}
.content .login-form .control-group .control {
width: 100% !important;
}
.content .login-form .forgot-password-link {
font-size: 17px;
color: #0031F0;
margin-bottom: 5%;
}
.content .login-form .signup-confirm {
margin-bottom: 5%;
}
.content .login-form .btn-primary {
width: 100%;
text-transform: uppercase;
border-radius: 0px;
height: 45px;
margin-bottom: 4%;
}
.account-content {
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
margin-top: 5.5%;
margin-bottom: 5.5%;
}
.account-content .side-menu-title {
display: none;
}
.account-content .account-side-menu {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
border: 1px solid #E8E8E8;
width: 25%;
height: 100%;
text-transform: capitalize;
color: #A5A5A5;
}
.account-content .account-side-menu li {
width: 95%;
height: 50px;
margin-left: 5%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-bottom: 1px solid #E8E8E8;
text-align: center;
}
.account-content .account-side-menu li:first-child {
border-top: none;
}
.account-content .account-side-menu li:last-child {
border-bottom: none;
}
.account-content .account-side-menu li.active {
color: #0031F0;
}
.account-content .profile {
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
}
.account-content .profile .section-head .back-icon {
display: none;
}
.account-content .profile .section-head .profile-heading {
font-size: 28px;
color: #242424;
text-transform: capitalize;
text-align: left;
}
.account-content .profile .section-head .profile-edit {
font-size: 17px;
margin-top: 1%;
color: #0031F0;
float: right;
}
.account-content .profile .section-head .horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: #E8E8E8;
}
.account-content .profile-content {
color: #5E5E5E;
margin-top: 1.4%;
}
.account-content .profile-content table tbody tr {
height: 45px;
}
.account-content .profile-content table tbody tr td {
width: 250px;
text-transform: capitalize;
}
.account-content .edit-form-content {
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
}
.account-content .edit-form-content .section-head .profile-heading {
font-size: 28px;
color: #242424;
text-transform: capitalize;
text-align: left;
}
.account-content .edit-form-content .section-head .profile-edit {
font-size: 17px;
margin-top: 1%;
color: #0031F0;
float: right;
}
.account-content .edit-form-content .section-head .horizontal-rule {
margin-top: 1.1%;
width: 100%;
height: 1px;
vertical-align: middle;
background: #E8E8E8;
}
.account-content .edit-form-content .edit-text {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
font-size: 24px;
}
.account-content .edit-form-content .edit-form {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
border: 1px solid #E8E8E8;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-height: 345px;
padding: 25px;
}
@media only screen and (max-width: 720px) {
.account-content {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.account-content .side-menu-title {
height: 48px;
padding-top: 13px;
border: 1px solid #E8E8E8;
font-size: 18px;
display: inline-block;
}
.account-content .side-menu-title .right {
float: right;
margin-top: 3px;
}
.account-content .account-side-menu {
width: 100%;
border: none;
margin-bottom: 20px;
display: none;
}
.account-content .account-side-menu li {
width: 100%;
margin-left: 0%;
}
.account-content .account-side-menu li a {
color: black;
}
.account-content .account-side-menu li:last-child {
border-bottom: 1px solid #E8E8E8;
}
.account-content .profile {
margin-left: 0px;
}
.account-content .profile .section-head {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
border-top: 1px solid #E8E8E8;
border-bottom: 1px solid #E8E8E8;
height: 50px;
padding-top: 7px;
}
.account-content .profile .section-head .back-icon {
display: block;
cursor: pointer;
margin-top: 5px;
}
.account-content .profile .section-head .horizontal-rule {
display: none;
}
.account-content .profile-content table tbody tr {
display: grid;
margin-bottom: 20px;
}
.account-content .edit-form-content {
margin-left: 0px;
}
.account-content .edit-form-content .control-group .control {
width: 100%;
}
}
=======
>>>>>>> 4bd252edde6f5f1b7ccb356b0c09c593c9fc0cfc
section.product-detail {
color: #242424;
}

View File

@ -30901,7 +30901,7 @@ var render = function() {
]
),
_vm._v(" "),
_vm.haveChildren || _vm.item.parent_id == null
_vm.haveChildren
? _c("i", {
class: [
_vm.show