Merge branch 'elektronika' of https://repo.tpsadvertising.com/TPS/elektronika_bagisto into elektronika
This commit is contained in:
commit
d4f5c71d05
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('website_reviews', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('customer_id')->unsigned();
|
||||
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
|
||||
$table->text('review_text')->nullable();
|
||||
$table->integer('rating')->unsigned();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('website_reviews');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
namespace TPS\Shop\Http\Controllers;
|
||||
use TPS\Shop\Repositories\WebsiteReviewRepository;
|
||||
use Webkul\Shop\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class WebsiteReviewController extends Controller
|
||||
{
|
||||
/**
|
||||
* Loads the home page for the storefront.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
||||
public function __construct(protected WebsiteReviewRepository $websiteReviewRepository){$this->customer = auth()->guard('customer')->user();}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$websiteReviews = $this->websiteReviewRepository->paginate(10); // 10 reviews per page
|
||||
|
||||
return view('shop::websiteReview.index', compact('websiteReviews'));
|
||||
}
|
||||
|
||||
|
||||
public function store(Request $request){
|
||||
|
||||
$request->validate([
|
||||
'web_review_text' => 'required',
|
||||
'web_review_rating' => 'required'
|
||||
]);
|
||||
|
||||
$data = array_merge(request()->all(), [
|
||||
'customer_id' => auth()->guard('customer')->user()->id,
|
||||
]);
|
||||
|
||||
if($this->websiteReviewRepository->create($data)){
|
||||
return response()->json(['success' => true,'message'=>trans('shop::app.review.success')]);
|
||||
}
|
||||
|
||||
return response()->json(['success' => false,'message'=>trans('shop::app.review.error')]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace TPS\Shop\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Customer\Models\CustomerProxy;
|
||||
|
||||
class WebsiteReview extends Model
|
||||
{
|
||||
protected $table = 'website_reviews';
|
||||
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'review_text',
|
||||
'rating'
|
||||
];
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(CustomerProxy::modelClass(), 'customer_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace TPS\Shop\Repositories;
|
||||
|
||||
use TPS\Shop\Models\WebsiteReview;
|
||||
|
||||
class WebsiteReviewRepository
|
||||
{
|
||||
|
||||
public function create($data)
|
||||
{
|
||||
$websiteReview = WebsiteReview::create([
|
||||
'customer_id' => $data['customer_id'],
|
||||
'review_text' => $data['web_review_text'],
|
||||
'rating' => $data['web_review_rating']
|
||||
]);
|
||||
|
||||
return $websiteReview ? true : false;
|
||||
}
|
||||
|
||||
public function paginate($perPage)
|
||||
{
|
||||
return WebsiteReview::with('customer')
|
||||
->orderBy('created_at', 'desc')
|
||||
->paginate($perPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,358 @@
|
|||
<template>
|
||||
<div class="popup-cart-overlay" id="popup-cart-overlay">
|
||||
<div class="popup-cart-content" id="popup-cart-content">
|
||||
|
||||
<img src="../assets/icons/popup-close-btn.svg" alt="close-btn" class="popup-cart-close-btn">
|
||||
|
||||
<h2 class="popup-cart-title">Товар добавлен в корзину</h2>
|
||||
|
||||
<div class="popup-cart-item-list">
|
||||
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
|
||||
</div> <!--Popup-cart-item-list-->
|
||||
|
||||
<div class="popup-cart-footer">
|
||||
<div class="popup-cart-footer-results">
|
||||
<div class="">В корзине 2 товара</div>
|
||||
<div class="">Итого: 69 521,61 м.</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
|
||||
<div class="popup-cart-footer-results">
|
||||
<div class="">Оформить заказ</div>
|
||||
<button type="button" class="popup-cart-btn" id="popup-cart-btn">Продолжить покупки 🠆</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "mini-card"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.popup-cart-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
z-index: 20;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.popup-cart-overlay.active {
|
||||
pointer-events: all;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.popup-cart-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 635px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40px 0 0 40px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
transform: translateX(100%);
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 16px 8px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.popup-cart-item-list {
|
||||
flex: 1 1 auto;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
padding-right: 40px;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.popup-cart-item-list::-webkit-scrollbar {
|
||||
width: 14px;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
border: 1px #e6e6e6 solid;
|
||||
}
|
||||
|
||||
.popup-cart-item-list::-webkit-scrollbar-track-piece {
|
||||
margin-right: -100px;
|
||||
}
|
||||
|
||||
.popup-cart-close-btn {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popup-item-trash {
|
||||
cursor: pointer;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.popup-cart-item-list::-webkit-scrollbar-track {
|
||||
margin-left: -100px;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.popup-cart-item-list::-webkit-scrollbar-thumb {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
transition: all 0.3s ease-out;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.popup-cart-item-img {
|
||||
background-color: #f2f2f2;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.popup-cart-item-block {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.popup-cart-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.delete-cart-item {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
pointer-events: none;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.popup-cart-item-header h4 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.popup-cart-item-header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.popup-cart-footer {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.popup-cart-item-price {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.popup-cart-item-counter {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding: 5px 10px;
|
||||
font-weight: 600;
|
||||
border-radius: 6px;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.popup-cart-item-counter div {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.popup-cart-item-plus {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popup-cart-item-minus {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popup-cart-item-footer {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.popup-cart-footer {
|
||||
padding-right: 40px;
|
||||
}
|
||||
|
||||
.popup-cart-footer-line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #f2f2f2;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.popup-cart-btn {
|
||||
background-color: #c3000e;
|
||||
font-size: 16px;
|
||||
padding: 20px;
|
||||
border-radius: 6px;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.popup-cart-btn:hover {
|
||||
background-color: #a5000b;
|
||||
font-size: 16px;
|
||||
padding: 20px;
|
||||
border-radius: 6px;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popup-cart-overlay.active .popup-cart-content {
|
||||
background-color: #fff;
|
||||
transform: translateX(0%);
|
||||
}
|
||||
.popup-cart-title {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.popup-cart-footer-results {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #4e4e4e;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.popup-cart-footer-results div {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -15,8 +15,20 @@ return [
|
|||
'downloadable-products' => 'Загружаемые продукты',
|
||||
],
|
||||
|
||||
'review' => [
|
||||
'error' => 'Что-то пошло не так. Пожалуйста, повторите попытку позже.',
|
||||
'success' => 'Отзыв успешно создан.',
|
||||
'write-review' => 'Напиши свой отзыв!',
|
||||
'all-reviews' => 'Все отзывы!',
|
||||
'reviews' => 'Отзывы',
|
||||
'reviews-about-us' => 'Отзывы о нас',
|
||||
'total' => 'Всего',
|
||||
'pages' => 'страниц'
|
||||
],
|
||||
|
||||
'common' => [
|
||||
'error' => 'Что-то пошло не так. Пожалуйста, повторите попытку позже.',
|
||||
'success' => 'Успешно создано.',
|
||||
'image-upload-limit' => 'Максимальный размер загружаемого изображения – 2 МБ',
|
||||
'no-result-found' => 'Нам не удалось найти никаких записей.',
|
||||
'delete' => 'Удалить'
|
||||
|
|
|
|||
|
|
@ -15,6 +15,17 @@ return [
|
|||
'downloadable-products' => 'Göçürip alyp bolýan önümler'
|
||||
],
|
||||
|
||||
'review' => [
|
||||
'error' => 'Teswir döredilip bilinmedi !',
|
||||
'success' => 'Teswir üstünlikli döredildi !',
|
||||
'write-review' => 'Teswir ýazyň !',
|
||||
'all-reviews' => 'Hemme teswirler',
|
||||
'reviews' => 'Teswirler',
|
||||
'reviews-about-us' => 'Biz hakda teswirler',
|
||||
'total' => 'Hemme',
|
||||
'pages' => 'sahypalar'
|
||||
],
|
||||
|
||||
'pagenames' =>[
|
||||
'homepage' => 'Baş sahypa',
|
||||
'cartpage' => 'Sebet',
|
||||
|
|
|
|||
|
|
@ -64,11 +64,14 @@
|
|||
@include('shop::home.banner',['banner'=>$bannerData->where('type','banner')->last()])
|
||||
@endif
|
||||
@include('shop::home.featured-products')
|
||||
@include('shop::home.reviews')
|
||||
@include('shop::websiteReview.review-popup')
|
||||
@include('shop::products.popup-card')
|
||||
{{-- @endif--}}
|
||||
</main>
|
||||
@if(core()->getConfigData('customer.settings.newsletter.subscription'))
|
||||
|
||||
<section class="pre-footer">
|
||||
<!-- <section class="pre-footer">
|
||||
<div class="container">
|
||||
<div class="pre-footer-inner">
|
||||
<h2 class="pre-footer-title">{{__('shop::app.footer.subscribe-newsletter')}}</h2>
|
||||
|
|
@ -78,7 +81,7 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section> -->
|
||||
|
||||
@endif
|
||||
{{ view_render_event('bagisto.shop.home.content.after') }}
|
||||
|
|
@ -90,6 +93,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
// SLIDER SCRIPTS ========================
|
||||
let swiper = new Swiper('.mySwiper', {
|
||||
spaceBetween: 30,
|
||||
|
|
@ -134,6 +138,272 @@
|
|||
updateOnWindowResize: true,
|
||||
});
|
||||
// SLIDER SCRIPTS end ========================
|
||||
|
||||
|
||||
|
||||
|
||||
//SEND WEB REVIEW FORM
|
||||
const $form = $('#review-form');
|
||||
const $successMessage = $('#success-message');
|
||||
const $successTitle = $('#success-title');
|
||||
|
||||
$form.on('submit', function (event) {
|
||||
event.preventDefault();
|
||||
const formData = new FormData(this);
|
||||
|
||||
$.ajax({
|
||||
url: $form.attr('action'),
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('input[name="_token"]').val()
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.success) {
|
||||
$successTitle.text(data.message);
|
||||
$form.addClass('hidden');
|
||||
$successMessage.removeClass('hidden');
|
||||
} else {
|
||||
alert(data.message);
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
});
|
||||
});
|
||||
//SEND WEB REVIEW FORM
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Review popup start =======================================
|
||||
const $popup = $('#review-popup');
|
||||
const $openReviewPopupBtn = $('#openReviewPopupBtn');
|
||||
const $closeReviewPopupBtn = $('#closeReviewPopupBtn');
|
||||
const $closeReviewPopupBtn2 = $('#closeReviewPopupBtn2');
|
||||
const $closeReviewPopupText = $('#closeReviewPopupText');
|
||||
|
||||
const $firstPopupContent = $(".review-popup-content").first();
|
||||
const $secondPopupContent = $(".review-popup-content").last();
|
||||
|
||||
const $sendReviewButton = $(".review-popup-button");
|
||||
const $nameInput = $("#name");
|
||||
const $reviewInput = $("#web_review");
|
||||
|
||||
// Create the loader element ==============================================================
|
||||
const $loader = $('<div>', { class: 'loader' });
|
||||
|
||||
const openPopup = () => {
|
||||
$popup.css('display', 'flex');
|
||||
$('body').addClass('no-scroll');
|
||||
|
||||
// Reset popup contents
|
||||
$firstPopupContent.css('display', 'flex');
|
||||
$secondPopupContent.css('display', 'none');
|
||||
$loader.remove();
|
||||
resetStars();
|
||||
resetInputs();
|
||||
checkFormCompletion();
|
||||
};
|
||||
|
||||
const closePopup = () => {
|
||||
$popup.css('display', 'none');
|
||||
$('body').removeClass('no-scroll');
|
||||
resetStars();
|
||||
resetInputs();
|
||||
};
|
||||
|
||||
const resetStars = () => {
|
||||
$(".review-card-star").removeClass("hovered clicked");
|
||||
};
|
||||
|
||||
const resetInputs = () => {
|
||||
$("#name, #review").val("");
|
||||
};
|
||||
|
||||
const checkFormCompletion = () => {
|
||||
// const isNameFilled = $.trim($nameInput.val()) !== "";
|
||||
const isReviewFilled = $.trim($reviewInput.val()) !== "";
|
||||
const isStarSelected = $(".review-card-star.clicked").length > 0;
|
||||
|
||||
if (isReviewFilled && isStarSelected) {
|
||||
$sendReviewButton.removeAttr("disabled");
|
||||
} else {
|
||||
$sendReviewButton.attr("disabled", true);
|
||||
}
|
||||
};
|
||||
|
||||
$nameInput.on("input", checkFormCompletion);
|
||||
$reviewInput.on("input", checkFormCompletion);
|
||||
|
||||
// $openReviewPopupBtn.on('click', openPopup);
|
||||
$signUpSection = $('.sign-up');
|
||||
$loginFormSection = $('.login-form');
|
||||
$signupFormSection = $('.signup-form');
|
||||
$resetPasswordSection = $('.reset-password');
|
||||
|
||||
$closeReviewPopupText.on('click', closePopup);
|
||||
$closeReviewPopupBtn.on('click', closePopup);
|
||||
$closeReviewPopupBtn2.on('click', closePopup);
|
||||
|
||||
if (isAuthenticated) {
|
||||
$openReviewPopupBtn.on('click', openPopup);
|
||||
} else {
|
||||
$openReviewPopupBtn.on('click', function() {
|
||||
$signUpSection.css('display', 'block');
|
||||
$loginFormSection.css('display', 'block');
|
||||
$signupFormSection.css('display', 'none');
|
||||
$resetPasswordSection.css('display', 'none');
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on('click', (event) => {
|
||||
if ($(event.target).is($popup)) {
|
||||
closePopup();
|
||||
}
|
||||
});
|
||||
|
||||
// Review rating click effect start ============================================
|
||||
$(".review-rating--popup").each(function() {
|
||||
const $container = $(this);
|
||||
const $stars = $container.find(".review-card-star");
|
||||
|
||||
let clickedIndex = 0;
|
||||
|
||||
$stars.each(function() {
|
||||
const $star = $(this);
|
||||
|
||||
$star.on("mouseover", function() {
|
||||
const index = parseInt($star.attr("data-index"));
|
||||
$stars.each(function(i) {
|
||||
if (i < index) $(this).addClass("hovered");
|
||||
});
|
||||
});
|
||||
|
||||
$star.on("mouseout", function() {
|
||||
$stars.removeClass("hovered");
|
||||
});
|
||||
|
||||
$star.on("click", function() {
|
||||
const index = parseInt($star.attr("data-index"));
|
||||
|
||||
$('input[name="web_review_rating"]').val(index);
|
||||
|
||||
if (index === clickedIndex) {
|
||||
clickedIndex = 0;
|
||||
$stars.removeClass("clicked hovered");
|
||||
} else {
|
||||
clickedIndex = index;
|
||||
$stars.each(function(i) {
|
||||
$(this).toggleClass("clicked", i < index);
|
||||
});
|
||||
}
|
||||
checkFormCompletion(); // Check form completion after selecting stars
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Send review ========================================================================
|
||||
$sendReviewButton.on("click", function() {
|
||||
// Hide the first popup content
|
||||
$firstPopupContent.css('display', 'none');
|
||||
|
||||
// Show the loader
|
||||
$firstPopupContent.after($loader);
|
||||
|
||||
// Wait for 3 seconds before showing the second popup content
|
||||
setTimeout(() => {
|
||||
// Remove the loader
|
||||
$loader.remove();
|
||||
|
||||
// Show the second popup content
|
||||
$secondPopupContent.css('display', 'block');
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
// Optionally, add event listeners to close buttons to close the popup
|
||||
$(".close-review-popup").on("click", function() {
|
||||
// Hide the entire popup
|
||||
closePopup();
|
||||
});
|
||||
|
||||
// Add an event listener to the "Закрыть окно" text to close the popup
|
||||
$("#closeReviewPopupText").on("click", function() {
|
||||
// Hide the entire popup
|
||||
closePopup();
|
||||
});
|
||||
|
||||
// Add to cart popup start ====================================================
|
||||
|
||||
const $addtoCartBtns = $('.item-gallery-cart');
|
||||
const $popupOverlay = $('#popup-cart-overlay');
|
||||
const $cartPopup = $("#popup-cart-content");
|
||||
const $popupCartBtn = $("#popup-cart-btn");
|
||||
const $plusButtons = $('.popup-cart-item-plus');
|
||||
const $minusButtons = $('.popup-cart-item-minus');
|
||||
const $currentCountElements = $('.popup-cart-item-count');
|
||||
const $popupCloseIcon = $('.popup-cart-close-btn');
|
||||
const $deleteItemBtns = $('.popup-item-trash');
|
||||
const $popupItems = $('.popup-item-wrapper');
|
||||
|
||||
// Открыть корзину при нажатии на кнопку добавления в корзину
|
||||
$addtoCartBtns.on('click', () => {
|
||||
$popupOverlay.addClass('active');
|
||||
$('body').addClass('no-scroll');
|
||||
});
|
||||
|
||||
$popupCloseIcon.on('click', () => {
|
||||
$popupOverlay.removeClass('active');
|
||||
$('body').removeClass('no-scroll');
|
||||
});
|
||||
|
||||
// Закрыть корзину при нажатии на кнопку закрытия корзины
|
||||
$popupCartBtn.on("click", () => {
|
||||
$popupOverlay.removeClass('active');
|
||||
$('body').removeClass('no-scroll');
|
||||
});
|
||||
|
||||
// Закрыть корзину при нажатии на overlay
|
||||
$(window).on('click', (event) => {
|
||||
if ($(event.target).is($popupOverlay)) {
|
||||
$popupOverlay.removeClass('active');
|
||||
$('body').removeClass('no-scroll');
|
||||
}
|
||||
});
|
||||
|
||||
// Увеличить количество при нажатии на плюс
|
||||
$plusButtons.each(function(index) {
|
||||
$(this).on('click', () => {
|
||||
let currentCount = parseInt($currentCountElements.eq(index).text());
|
||||
$currentCountElements.eq(index).text(currentCount + 1);
|
||||
});
|
||||
});
|
||||
|
||||
$deleteItemBtns.each(function(index) {
|
||||
$(this).on('click', () => {
|
||||
$popupItems.eq(index).remove();
|
||||
});
|
||||
});
|
||||
|
||||
// Уменьшить количество при нажатии на минус
|
||||
$minusButtons.each(function(index) {
|
||||
$(this).on('click', () => {
|
||||
let currentCount = parseInt($currentCountElements.eq(index).text());
|
||||
if (currentCount > 0) {
|
||||
$currentCountElements.eq(index).text(currentCount - 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
@inject ('websiteReviewRepository', 'TPS\Shop\Repositories\WebsiteReviewRepository')
|
||||
@php
|
||||
$websiteReview = $websiteReviewRepository->paginate(4)
|
||||
@endphp
|
||||
|
||||
<section class="reviews-section">
|
||||
<div class="container">
|
||||
<div class="reviews-inner">
|
||||
|
||||
<div class="reviews-top">
|
||||
<h2 class="reviews-title">{{__('shop::app.review.reviews')}}</h2>
|
||||
<a href="{{ route('shop.website_reviews.index') }}" class="reviews-top-link"><span>{{__('shop::app.review.all-reviews')}}</span>
|
||||
<img src="../assets/icons/chevron-right.svg" alt="">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="reviews-content">
|
||||
|
||||
@if ($websiteReview->count() > 0)
|
||||
|
||||
@foreach($websiteReview as $vol)
|
||||
|
||||
<div class="review-card">
|
||||
<div class="review-rating">
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
<svg class="review-card-star{{ $i <= $vol->rating ? '--active' : '' }}" data-index="{{ $i }}" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"></path>
|
||||
</svg>
|
||||
@endfor
|
||||
</div>
|
||||
<div class="review-details">
|
||||
<p class="review-text">{{ $vol->review_text }}</p>
|
||||
<div class="review-data">
|
||||
<h3 class="reviewer-name">{{ $vol->customer->first_name }}</h3>
|
||||
<div class="review-date">{{ $vol->created_at->format('d.m.Y') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@auth('customer')
|
||||
<script>
|
||||
var isAuthenticated = true;
|
||||
</script>
|
||||
@else
|
||||
<script>
|
||||
var isAuthenticated = false;
|
||||
</script>
|
||||
@endauth
|
||||
|
||||
<button id="openReviewPopupBtn" class="add-review-button">{{__('shop::app.review.write-review')}}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -7,10 +7,9 @@
|
|||
}
|
||||
$cart = cart()->getCart();
|
||||
?>
|
||||
|
||||
<my-mobile-nav></my-mobile-nav>
|
||||
|
||||
@push('scripts')
|
||||
@auth('customer')
|
||||
<script type="text/x-template" id="profile-btn-template">
|
||||
<div class="login logged-true logged" @click.prevent="toggleProfileDropdown">
|
||||
<button type="button" class="nav-link">
|
||||
|
|
@ -21,7 +20,18 @@
|
|||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('profile-btn', {
|
||||
template: '#profile-btn-template',
|
||||
methods: {
|
||||
toggleProfileDropdown() {
|
||||
let obj = document.querySelector('.profile-dropdown')
|
||||
obj.classList.toggle('shown')
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@endauth
|
||||
<script type="text/x-template" id="my-mobile-nav-template">
|
||||
<nav class="nav-block container">
|
||||
<div class="burger-mobile" @click.capture="closeMobileMenu($event)">
|
||||
|
|
@ -313,21 +323,8 @@
|
|||
</div>
|
||||
</nav>
|
||||
</script>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('profile-btn', {
|
||||
template: '#profile-btn-template',
|
||||
methods: {
|
||||
toggleProfileDropdown() {
|
||||
let obj = document.querySelector('.profile-dropdown')
|
||||
obj.classList.toggle('shown')
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('my-mobile-nav', {
|
||||
|
|
|
|||
|
|
@ -19,19 +19,16 @@
|
|||
<div class="flag-wrapper">
|
||||
<img src="{{ core()->getCurrentLocale()->image_url }}" alt="" width="30" height="20" />
|
||||
</div>
|
||||
|
||||
<div class="language-wrapper">
|
||||
<span class="language">{{ core()->getCurrentLocale()->name }}</span>
|
||||
<ul class="language-list hidden" id="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))
|
||||
<li class="language-el" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}><a href="?{{ $serachQuery }}&locale={{ $locale->code }}">{{ $locale->name }}</a></li>
|
||||
@else
|
||||
<li class="language-el" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}><a href="?locale={{ $locale->code }}">{{ $locale->name }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
<ul class="language-list hidden" id="locale-switcher" onchange="window.location.href = this.value">
|
||||
@foreach (core()->getCurrentChannel()->locales as $locale)
|
||||
@if (isset($serachQuery))
|
||||
<li class="language-el" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}><a href="?{{ $serachQuery }}&locale={{ $locale->code }}">{{ $locale->name }}</a></li>
|
||||
@else
|
||||
<li class="language-el" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}><a href="?locale={{ $locale->code }}">{{ $locale->name }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
|
||||
<title>@yield('page_title')</title>
|
||||
<meta name="base-url" content="{{ url()->to('/') }}">
|
||||
<meta charset="UTF-8">
|
||||
|
|
@ -11,71 +9,40 @@
|
|||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="content-language" content="{{ app()->getLocale() }}">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
{{-- <link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">--}}
|
||||
|
||||
@if ($favicon = core()->getCurrentChannel()->favicon_url)
|
||||
<link rel="icon" sizes="16x16" href="{{ $favicon }}" />
|
||||
@else
|
||||
<link rel="icon" sizes="16x16" href="{{ bagisto_asset('images/favicon.ico') }}" />
|
||||
@if ($favicon = core()->getCurrentChannel()->favicon_url)
|
||||
<link rel="icon" sizes="16x16" href="{{ $favicon }}" />
|
||||
@else
|
||||
<link rel="icon" sizes="16x16" href="{{ bagisto_asset('images/favicon.ico') }}" />
|
||||
@endif
|
||||
@yield('head')
|
||||
@section('seo')
|
||||
@if (! request()->is('/'))
|
||||
<meta name="description" content="{{ core()->getCurrentChannel()->description }}"/>
|
||||
@endif
|
||||
|
||||
@yield('head')
|
||||
|
||||
@section('seo')
|
||||
@if (! request()->is('/'))
|
||||
<meta name="description" content="{{ core()->getCurrentChannel()->description }}"/>
|
||||
@endif
|
||||
@show
|
||||
@stack('css_before')
|
||||
@show
|
||||
@stack('css_before')
|
||||
<link rel="stylesheet" href="{{bagisto_asset('styles/style.css')}}" />
|
||||
|
||||
|
||||
|
||||
@stack('css')
|
||||
|
||||
<style>
|
||||
{!! core()->getConfigData('general.content.custom_scripts.custom_css') !!}
|
||||
</style>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PETK150JLY"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-PETK150JLY');
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body style="scroll-behavior: smooth;">
|
||||
|
||||
@include('shop::layouts.header.top-nav')
|
||||
<div id="app">
|
||||
<flash-wrapper ref='flashes' cancel-btn-img="{{ bagisto_asset('icons/cancel.svg') }}"></flash-wrapper>
|
||||
|
||||
@include('shop::layouts.header.search-nav')
|
||||
@include('shop::layouts.header.category-nav')
|
||||
|
||||
@yield('content-wrapper')
|
||||
|
||||
|
||||
|
||||
|
||||
@include('shop::layouts.footer.index')
|
||||
<overlay-loader :is-open="show_loader"></overlay-loader>
|
||||
<go-top bg-color="#c5000e"></go-top>
|
||||
@guest('customer')
|
||||
@include('shop::layouts.auth')
|
||||
|
||||
@endguest
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.flashMessages = [];
|
||||
|
||||
@if ($success = session('success'))
|
||||
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||
@elseif ($warning = session('warning'))
|
||||
|
|
@ -85,9 +52,7 @@
|
|||
@elseif ($info = session('info'))
|
||||
window.flashMessages = [{'type': 'alert-info', 'message': "{{ $info }}" }];
|
||||
@endif
|
||||
|
||||
window.serverErrors = [];
|
||||
|
||||
@if (isset($errors))
|
||||
@if (count($errors))
|
||||
window.serverErrors = @json($errors->getMessages());
|
||||
|
|
@ -95,10 +60,10 @@
|
|||
@endif
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ bagisto_asset('scripts/shop.js') }}" ></script>
|
||||
|
||||
@stack('scripts')
|
||||
<div class="modal-overlay"></div>
|
||||
{!! core()->getConfigData('general.content.custom_scripts.custom_javascript') !!}
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -2,27 +2,31 @@
|
|||
|
||||
@php
|
||||
$showWishlist = core()->getConfigData('general.content.shop.wishlist_option') == "1" ? true : false;
|
||||
//dd($product->getTypeInstance()->totalQuantity());
|
||||
@endphp
|
||||
|
||||
@if ($product->haveSufficientQuantity(1) > 0)
|
||||
<div class="item-gallery-cart">
|
||||
|
||||
<div class="item-gallery-cart">
|
||||
<form action="{{ route('cart.add', $product->product_id) }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="product_id" value="{{ $product->product_id }}">
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<button class="btn btn-lg btn-primary addtocart" {{ $product->isSaleable() ? '' : 'disabled' }}>
|
||||
<div class="item-gallery-cart-img">
|
||||
<img src="{{ bagisto_asset('icons/icon (cart) 2.svg') }}" alt="cart" />
|
||||
</div>
|
||||
<span class="item-gallery-cart-text">
|
||||
{{ ($product->type == 'booking') ? __('shop::app.products.book-now') : __('shop::app.products.add-to-cart') }}
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('cart.add', $product->product_id) }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="product_id" value="{{ $product->product_id }}">
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<button class="btn btn-lg btn-primary addtocart" {{ $product->isSaleable() ? '' : 'disabled' }}>
|
||||
<div class="item-gallery-cart-img">
|
||||
<img src="{{ bagisto_asset('icons/icon (cart) 2.svg') }}" alt="cart" />
|
||||
</div>
|
||||
<span class="item-gallery-cart-text">
|
||||
{{ ($product->type == 'booking') ? __('shop::app.products.book-now') : __('shop::app.products.add-to-cart') }}
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
@if ($showWishlist)
|
||||
@include('shop::products.wishlist')
|
||||
@endif
|
||||
|
||||
@if ($showWishlist)
|
||||
@include('shop::products.wishlist')
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<button class="empty-button">{{__('shop::app.products.out-of-stock')}}</button>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
<!-- Popup-cart -->
|
||||
|
||||
<div class="popup-cart-overlay" id="popup-cart-overlay">
|
||||
<div class="popup-cart-content" id="popup-cart-content">
|
||||
|
||||
<img src="../assets/icons/popup-close-btn.svg" alt="close-btn" class="popup-cart-close-btn">
|
||||
|
||||
<h2 class="popup-cart-title">Товар добавлен в корзину</h2>
|
||||
|
||||
<div class="popup-cart-item-list">
|
||||
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
<!-- ITEM -->
|
||||
<div class="popup-item-wrapper">
|
||||
|
||||
<div class="popup-cart-item">
|
||||
<div class="popup-cart-item-img">
|
||||
<img src="../assets/images/popup-cart-item-img.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-item-block">
|
||||
<div class="popup-cart-item-header">
|
||||
<h4>Телевизор LG OLED 77C2RLA, 77"</h4>
|
||||
<img src="../assets/icons/red-trash.svg" alt="delete-icon" class="popup-item-trash">
|
||||
</div>
|
||||
<div class="popup-cart-item-header">
|
||||
<div class="popup-cart-item-counter">
|
||||
<div class="popup-cart-item-minus">-</div>
|
||||
<div class="popup-cart-item-count">1</div>
|
||||
<div class="popup-cart-item-plus">+</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-price">58 410,50 m.</div>
|
||||
</div>
|
||||
<div class="popup-cart-item-footer">58 410,50 м. / шт.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
</div> <!-- ITEM -->
|
||||
|
||||
</div> <!--Popup-cart-item-list-->
|
||||
|
||||
<div class="popup-cart-footer">
|
||||
<div class="popup-cart-footer-results">
|
||||
<div class="">В корзине 2 товара</div>
|
||||
<div class="">Итого: 69 521,61 м.</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popup-cart-footer-line"></div>
|
||||
|
||||
<div class="popup-cart-footer-results">
|
||||
<div class="">Оформить заказ</div>
|
||||
<button type="button" class="popup-cart-btn" id="popup-cart-btn">Продолжить покупки 🠆</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('shop::app.search.page-title') }}
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{bagisto_asset('styles/reviews.css')}}">
|
||||
<link rel="stylesheet" href="{{bagisto_asset('styles/categories-tv.css')}}">
|
||||
@endpush
|
||||
|
||||
@section('content-wrapper')
|
||||
<!-- BREADCRUMB ======================================================================== -->
|
||||
<section class="breadcrumb">
|
||||
<div class="container">
|
||||
|
||||
<div class="breadcrumb-container">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/">{{__('shop::app.home.page-title')}}</a></li>
|
||||
<li><a href="#" class="current">{{__('shop::app.review.reviews')}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- BREADCRUMB end ==================================================================== -->
|
||||
|
||||
<section class="navigation-section">
|
||||
<div class="container">
|
||||
<div class="navigation-inner">
|
||||
<h2 class="navigation-title">{{__('shop::app.review.reviews-about-us')}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="reviews-section">
|
||||
<div class="container">
|
||||
<div class="reviews-inner">
|
||||
|
||||
@foreach($websiteReviews as $vol)
|
||||
<div class="review-block">
|
||||
<h3 class="review-block-title">{{ $vol->customer->first_name }}</h3>
|
||||
<div class="review-block-details">
|
||||
<div class="review-block-rating">
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
<svg class="review-block-star {{ $i <= $vol->rating ? 'star-active' : '' }}" data-index="{{ $i }}" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"></path>
|
||||
</svg>
|
||||
@endfor
|
||||
</div>
|
||||
<span class="review-block-date">{{ $vol->created_at->format('d.m.Y') }} г.</span>
|
||||
</div>
|
||||
<p class="review-block-text">
|
||||
{{ $vol->review_text }}
|
||||
</p>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@php
|
||||
$currentPage = $websiteReviews->currentPage();
|
||||
$totalPages = $websiteReviews->lastPage();
|
||||
@endphp
|
||||
|
||||
<section>
|
||||
<div class="container">
|
||||
<div class="product-section-pagination-wrapper">
|
||||
<div class="product-section-pagination">
|
||||
<div class="pagination-buttons">
|
||||
@if ($currentPage > 1)
|
||||
<a href="{{ $websiteReviews->url($currentPage - 1) }}">
|
||||
<button class="pagination-button pagination-button-left">
|
||||
<div>
|
||||
<img src="../assets/icons/arrow-down-sign-to-navigate.svg" alt="">
|
||||
</div>
|
||||
</button>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<span class="mid-button-text">{{ $currentPage }}</span>
|
||||
|
||||
@if ($currentPage < $totalPages)
|
||||
<a href="{{ $websiteReviews->url($currentPage + 1) }}">
|
||||
<button class="pagination-button pagination-button-right">
|
||||
<div>
|
||||
<img src="../assets/icons/arrow-down-sign-to-navigate.svg" alt="">
|
||||
</div>
|
||||
</button>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<span class="page-count">{{__('shop::app.review.total')}} {{ $totalPages }} {{__('shop::app.review.pages')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<div id="review-popup" class="review-popup">
|
||||
<form id="review-form" method="POST" action="{{ route('shop.website_reviews.store') }}" class="review-popup-content">
|
||||
@csrf
|
||||
|
||||
<span id="closeReviewPopupBtn" class="close-review-popup">×</span>
|
||||
<h2 class="review-popup-title">Написать отзыв</h2>
|
||||
|
||||
<div class="review-popup-input-block">
|
||||
<label for="review">Ваш отзыв</label>
|
||||
<textarea name="web_review_text" id="web_review" rows="10" placeholder="Оставьте свой отзыв здесь"></textarea>
|
||||
</div>
|
||||
<div class="review-popup-start-block">
|
||||
<h3>Оцените нас</h3>
|
||||
<div class="review-rating--popup">
|
||||
<svg class="review-card-star" data-index="1" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"/>
|
||||
</svg>
|
||||
<svg class="review-card-star" data-index="2" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"/>
|
||||
</svg>
|
||||
<svg class="review-card-star" data-index="3" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"/>
|
||||
</svg>
|
||||
<svg class="review-card-star" data-index="4" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"/>
|
||||
</svg>
|
||||
<svg class="review-card-star" data-index="5" width="32" height="29" viewBox="0 0 32 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 0L19.5922 11.0557H31.2169L21.8123 17.8885L25.4046 28.9443L16 22.1115L6.59544 28.9443L10.1877 17.8885L0.783095 11.0557H12.4078L16 0Z" fill="currentColor"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="web_review_rating">
|
||||
<button type="submit" class="review-popup-button" disabled>Отправить отзыв</button>
|
||||
</form>
|
||||
|
||||
<div id="success-message" class="review-popup-content hidden">
|
||||
<span id="closeReviewPopupBtn2" class="close-review-popup">×</span>
|
||||
<h2 class="review-popup-title review-popup-title--green" id="success-title">Отзыв добавлен успешно</h2>
|
||||
<h3 class="close-review-popup-button" id="closeReviewPopupText">Закрыть окно</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4,6 +4,7 @@ use Illuminate\Support\Facades\Route;
|
|||
use TPS\Shop\Http\Controllers\Home;
|
||||
use TPS\Shop\Http\Controllers\ReviewController;
|
||||
use TPS\Shop\Http\Controllers\ShopController;
|
||||
use TPS\Shop\Http\Controllers\WebsiteReviewController;
|
||||
|
||||
Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function () {
|
||||
|
||||
|
|
@ -19,4 +20,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
Route::get('/product_reviews/{product_id}',[ReviewController::class,'index'])->name('shop.product.reviews.index');
|
||||
Route::post('/product_reviews/{product_id}',[ReviewController::class,'store'])->name('shop.product.reviews.store');
|
||||
|
||||
Route::get('/website_reviews',[WebsiteReviewController::class,'index'])->name('shop.website_reviews.index');
|
||||
Route::post('/website_reviews',[WebsiteReviewController::class,'store'])->name('shop.website_reviews.store');
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue