review changes

This commit is contained in:
rahul shukla 2018-12-20 13:37:03 +05:30
parent 9cdc16a50b
commit b832dc3a4a
12 changed files with 114 additions and 137 deletions

View File

@ -503,6 +503,15 @@ body {
}
}
}
.stars {
margin-top: 5px;
.icon {
width: 16px;
height: 16px;
}
}
// customer oder css for admin end here

View File

@ -493,7 +493,7 @@ return [
'title' => 'Tax Rates',
'add-title' => 'Create Tax Rate',
'edit-title' => 'Edit Tax Rate',
'save-btn-title' => 'Create Tax Rate',
'save-btn-title' => 'Save Tax Rate',
'general' => 'Tax Rate',
'identifier' => 'Identifier',
'is_zip' => 'Enable Zip Range',

View File

@ -80,9 +80,9 @@
</div>
<div class="control-group">
<label>{{ __('admin::app.catalog.categories.image') }}
<label>{{ __('admin::app.catalog.categories.image') }} </label>
<image-wrapper :button-label="'{{ __('admin::app.catalog.products.add-image-btn-title') }}'" input-name="image" :multiple="false"></image-wrapper>
<image-wrapper :button-label="'{{ __('admin::app.catalog.products.add-image-btn-title') }}'" input-name="image" :multiple="false" :images='"{{ $category->image_url }}"'></image-wrapper>
</div>

View File

@ -39,11 +39,11 @@
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.reviews.rating') }}</label>
@for($i = 1; $i <= $review->rating ; $i++)
<span class="stars">
<span class="icon star-icon"></span>
</span>
@endfor
<div class="stars">
@for($i = 1; $i <= $review->rating; $i++)
<span class="icon star-icon"></span>
@endfor
</div>
</div>
<div class="control-group">

View File

@ -34,7 +34,7 @@
<div class="section-content">
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.invoices.order-id') }}
</span>
@ -44,11 +44,11 @@
</div>
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.order-date') }}
</span>
<span class="value">
<span class="value">
{{ $order->created_at }}
</span>
</div>
@ -57,7 +57,7 @@
<span class="title">
{{ __('admin::app.sales.orders.order-status') }}
</span>
<span class="value">
{{ $order->status_label }}
</span>
@ -67,7 +67,7 @@
<span class="title">
{{ __('admin::app.sales.orders.channel') }}
</span>
<span class="value">
{{ $order->channel_name }}
</span>
@ -82,21 +82,21 @@
<div class="section-content">
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.customer-name') }}
</span>
<span class="value">
<span class="value">
{{ $invoice->address->name }}
</span>
</div>
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.email') }}
</span>
<span class="value">
<span class="value">
{{ $invoice->address->email }}
</span>
</div>
@ -130,11 +130,11 @@
<div class="section-content">
@include ('admin::sales.address', ['address' => $order->shipping_address])
</div>
</div>
@endif
</div>
</accordian>
@ -148,21 +148,21 @@
<div class="section-content">
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.payment-method') }}
</span>
<span class="value">
<span class="value">
{{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }}
</span>
</div>
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.currency') }}
</span>
<span class="value">
<span class="value">
{{ $order->order_currency_code }}
</span>
</div>
@ -176,21 +176,21 @@
<div class="section-content">
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.shipping-method') }}
</span>
<span class="value">
<span class="value">
{{ $order->shipping_title }}
</span>
</div>
<div class="row">
<span class="title">
<span class="title">
{{ __('admin::app.sales.orders.shipping-price') }}
</span>
<span class="value">
<span class="value">
{{ core()->formatBasePrice($order->base_shipping_amount) }}
</span>
</div>

View File

@ -78,7 +78,7 @@ class ReviewController extends Controller
{
$this->validate(request(), [
'comment' => 'required',
'rating' => 'required',
'rating' => 'numeric|min:1|max:5',
'title' => 'required',
]);

View File

@ -2545,7 +2545,7 @@ section.review {
.review-form {
margin-left: 20px;
width: 49%;
width: 55%;
.heading {
color: $font-color;
@ -2557,39 +2557,22 @@ section.review {
}
}
.rating {
color: $bold-color;
font-size: 15px;
.star {
font-size: 23px;
color: $star-color;
transition: all .2s;
}
.rating-title::after {
content: "*";
color: $rating-color;
font-weight: 700;
display: inline-block;
}
label.star {
font-size: 25px;
color: $star-color;
transition: all .2s;
}
label.star:before {
content: '\2605';
}
.star:before {
content: '\2605';
}
.control-group {
.control {
width: 90%;
width: 100%;
}
}
.control-error {
color: $error-color;
font-size: 14px;
}
.review-detail{
height: 150px;
border: 1px solid firebrick;

View File

@ -64,7 +64,11 @@ return [
'product-review-page-title' => 'Product Review',
'rating-reviews' => 'Rating & Reviews',
'submit' => 'SUBMIT',
'delete-all' => 'All Reviews has deleted Succesfully'
'delete-all' => 'All Reviews has deleted Succesfully',
'ratingreviews' => ':rating Ratings & :review Reviews',
'star' => 'Star',
'percentage' => ':percentage %',
'id-star' => 'star'
],
'customer' => [

View File

@ -8,14 +8,9 @@
<section class="review">
{{-- <div class="category-breadcrumbs">
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
</div> --}}
<div class="review-layouter mb-20">
<div class="product-info">
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
<?php $productBaseImage = $productImageHelper->getProductBaseImage($product); ?>
@ -44,41 +39,36 @@
<span class="pro-price">{{ core()->currency($product->price) }}</span>
@endif
@endif
{{-- <span class="pro-price-not">
<strike> $45.00 </strike>
</span>
<span class="offer"> 10% Off </span> --}}
</div>
</div>
<div class="review-form">
<form method="POST" action="{{ route('shop.reviews.store', $product->id ) }}" @submit.prevent="onSubmit">
@csrf
<div class="heading mt-10">
<span>{{ __('shop::app.reviews.write-review') }}</span>
</div>
<div class="rating mt-20">
<div class="rating-title"> {{ __('admin::app.customers.reviews.rating') }} </div>
<div class="control-group mt-25" :class="[errors.has('rating') ? 'has-error' : '']">
<label for="title" class="required">
{{ __('admin::app.customers.reviews.rating') }}
</label>
<label class="star star-5" for="star-5" onclick="calculateRating(id)" id="1"></label>
<label class="star star-4" for="star-4" onclick="calculateRating(id)" id="2"></label>
<label class="star star-3" for="star-3" onclick="calculateRating(id)" id="3"></label>
<label class="star star-2" for="star-2" onclick="calculateRating(id)" id="4"></label>
<label class="star star-1" for="star-1" onclick="calculateRating(id)" id="5"></label>
<div class="stars">
<span class="star star-5" for="star-5" onclick="calculateRating(id)" id="1"></span>
<span class="star star-4" for="star-4" onclick="calculateRating(id)" id="2"></span>
<span class="star star-3" for="star-3" onclick="calculateRating(id)" id="3"></span>
<span class="star star-2" for="star-2" onclick="calculateRating(id)" id="4"></span>
<span class="star star-1" for="star-1" onclick="calculateRating(id)" id="5"></span>
</div>
<input type="hidden" id="rating" name="rating" v-validate="'required'">
<div class="control-error" v-if="errors.has('rating')">@{{ errors.first('rating') }}</div>
</div>
<div class="control-group mt-20" :class="[errors.has('title') ? 'has-error' : '']">
<div class="control-group" :class="[errors.has('title') ? 'has-error' : '']">
<label for="title" class="required">
{{ __('shop::app.reviews.title') }}
</label>
@ -103,8 +93,9 @@
</div>
</div>
</section>
@endsection
@ -112,13 +103,11 @@
<script>
function calculateRating(id){
function calculateRating(id) {
var a=document.getElementById(id);
document.getElementById("rating").value = id;
for (let i=1 ; i <= 5 ; i++){
for (let i=1 ; i <= 5 ; i++) {
if(id >= i){
document.getElementById(i).style.color="#242424";
}else{

View File

@ -1,19 +1,17 @@
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@extends('shop::layouts.master')
@section('page_title')
{{ __('shop::app.reviews.product-review-page-title') }} - {{ $product->name }}
@endsection
@extends('shop::layouts.master')
@section('content-wrapper')
<section class="review">
{{-- <div class="category-breadcrumbs">
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
</div> --}}
<div class="review-layouter">
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
<?php $productBaseImage = $productImageHelper->getProductBaseImage($product); ?>
@ -32,7 +30,6 @@
<div class="product-price mt-10">
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@if ($product->type == 'configurable')
<span class="pro-price">{{ core()->currency($priceHelper->getMinimalPrice($product)) }}</span>
@else
@ -42,58 +39,54 @@
<span class="pro-price">{{ core()->currency($product->price) }}</span>
@endif
@endif
{{-- <span class="pro-price-not">
<strike> $45.00 </strike>
</span>
<span class="offer"> 10% Off </span> --}}
</div>
</div>
<div class="review-form">
<div class="heading mt-10">
<span> {{ __('shop::app.reviews.rating-reviews') }} </span>
<a href="{{ route('shop.reviews.create', $product->url_key) }}" class="btn btn-lg btn-primary right">Write Review</a>
<a href="{{ route('shop.reviews.create', $product->url_key) }}" class="btn btn-lg btn-primary right"> {{ __('shop::app.products.write-review-btn') }}</a>
</div>
<div class="ratings-reviews mt-35">
<div class="left-side">
<span class="rate">
{{ $reviewHelper->getAverageRating($product) }}
</span>
@for($i=1;$i<=$reviewHelper->getAverageRating($product);$i++)
<span class="stars">
<span class="icon star-icon"></span>
@for ($i = 1; $i <= $reviewHelper->getAverageRating($product); $i++)
<span class="icon star-icon"></span>
@endfor
</span>
@endfor
<div class="total-reviews mt-5">
{{ $reviewHelper->getTotalRating($product) }} {{ __('admin::app.customers.reviews.rating') }} & {{ $reviewHelper->getTotalReviews($product) }} {{ __('admin::app.customers.reviews.title') }}
{{ __('shop::app.reviews.ratingreviews', ['rating' => $reviewHelper->getTotalRating($product), 'review' => $reviewHelper->getTotalReviews($product)]) }}
</div>
</div>
<div class="right-side">
@foreach($reviewHelper->getPercentageRating($product) as $key=>$count)
<div class="rater 5star">
<div class="rate-number" id={{$key}}star></div>
<div class="star-name">Star</div>
<div class="line-bar">
<div class="line-value" id="{{ $key }}"></div>
</div>
<div class="percentage">
<span> {{$count}}% </span>
</div>
</div>
<br/>
@foreach ($reviewHelper->getPercentageRating($product) as $key => $count)
<div class="rater 5star">
<div class="rate-number" id={{ $key }}{{ __('shop::app.reviews.id-star') }}></div>
<div class="star-name">{{ __('shop::app.reviews.star') }}</div>
<div class="line-bar">
<div class="line-value" id="{{ $key }}"></div>
</div>
<div class="percentage">
<span>
{{ __('shop::app.reviews.percentage', ['percentage' => $count]) }}
</span>
</div>
</div>
<br/>
@endforeach
</div>
</div>
</div>
<div class="rating-reviews">
@ -133,32 +126,31 @@
</div>
</div>
</div>
</section>
@endsection
@push('scripts')
<script>
<script>
window.onload = (function(){
window.onload = (function() {
var percentage = {};
<?php foreach ($reviewHelper->getPercentageRating($product) as $key => $count) { ?>
var percentage = {};
<?php foreach ($reviewHelper->getPercentageRating($product) as $key=>$count) { ?>
percentage = <?php echo "'$count';"; ?>
id = <?php echo "'$key';"; ?>
idNumber = id + 'star';
percentage = <?php echo "'$count';"; ?>
id = <?php echo "'$key';"; ?>
idNumber = id + 'star';
document.getElementById(id).style.width = percentage + "%";
document.getElementById(id).style.height = 4 + "px";
document.getElementById(idNumber).innerHTML = id ;
document.getElementById(id).style.width = percentage + "%";
document.getElementById(id).style.height = 4 + "px";
document.getElementById(idNumber).innerHTML = id ;
<?php } ?>
})();
<?php } ?>
})();
</script>
</script>
@endpush

View File

@ -37,7 +37,7 @@
@include ('shop::products.view.stock', ['product' => $product])
{!! view_render_event('bagisto.shop.products.view.short_description.before', ['product' => $product]) !!}
<div class="description">
{!! $product->short_description !!}
</div>

View File

@ -1,8 +1,8 @@
const { mix } = require("laravel-mix");
require("laravel-mix-merge-manifest");
var publicPath = 'publishable/assets';
// var publicPath = "../../../public/themes/default/assets";
// var publicPath = 'publishable/assets';
var publicPath = "../../../public/themes/default/assets";
mix.setPublicPath(publicPath).mergeManifest();
mix.disableNotifications();