first commit

This commit is contained in:
2024-11-05 12:22:50 +01:00
commit e5682a3912
19641 changed files with 2948548 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,667 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
/**
* Product comments CSS
*/
.product-comment-modal .material-icons[data-icon]:before,
.product-comment-list-item .material-icons[data-icon]:before,
.product-comments-additional-info .material-icons[data-icon]:before,
#product-comments-list-header .material-icons[data-icon]:before,
#product-comments-list-footer .material-icons[data-icon]:before {
content: attr(data-icon);
}
.btn-comment,
.btn-comment-inverse {
height: 36px;
border-radius: 2px;
background-color: #6b868f;
color: #ffffff;
font-size: 14px;
box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.2);
padding: 8px;
}
.btn-comment .material-icons,
.btn-comment-inverse .material-icons {
font-size: 20px;
margin-right: 7px;
}
.btn-comment:hover {
background-color: #3c4d52;
}
.btn-comment-inverse {
background-color: #ffffff;
color: #363a41;
border: 1px solid #979797;
}
.btn-comment-inverse:hover {
background-color: #6b868f;
border: 1px solid #6b868f;
color: #ffffff;
}
.btn-comment-big {
padding: 13px 16px;
height: 45px;
}
.btn-comment-huge {
padding: 13px 28px;
height: 45px;
}
.link-comment {
color: #232323;
}
.link-comment:hover,
.link-comment:active {
text-decoration: underline;
color: #232323;
}
/**
* Additional product infos
*/
.product-comments-additional-info {
margin: 20px 0;
font-weight: 300;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
font-size: 14px;
}
.product-comments-additional-info .link-comment.post-product-comment {
border-left: 1px solid #979797;
padding-left: 12px;
margin-left: 12px;
}
.product-comments-additional-info .comments-note {
margin-right: 30px;
margin-bottom: 20px;
}
/**
* Post comment modal
*/
.product-comment-modal .modal-header {
border: none;
padding: 30px 30px 15px;
}
.product-comment-modal .modal-body {
padding: 15px 30px 30px;
}
.product-comment-modal .modal-header h2 {
float: left;
font-size: 20px;
}
.product-comment-modal .modal-dialog {
width: calc(100% - 30px);
max-width: 774px;
}
.product-comment-modal .modal-dialog h3 {
font-size: 14px;
}
.product-comment-modal .modal-dialog .product-flag {
display: none;
}
.product-comment-modal .modal-dialog .product-cover,
.product-comment-modal .modal-dialog .product-cover img {
width: 99px;
height: 99px;
}
.product-comment-modal label.form-label {
font-size: 16px;
margin: 10px 0;
}
.product-comment-modal input {
width: 100%;
height: 44px;
border: 1px solid #bfbfbf;
padding: 0 10px;
}
.product-comment-modal textarea {
width: 100%;
min-height: 80px;
border: 1px solid #bfbfbf;
margin-bottom: 10px;
padding: 10px 10px;
}
.product-comment-modal .btn-comment,
.product-comment-modal .btn-comment-inverse {
font-size: 16px;
line-height: 16px;
font-weight: bold;
}
.product-comment-modal .required {
font-size: 12px;
margin-left: 5px;
}
.product-comment-modal .post-comment-buttons {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.product-comment-modal .post-comment-buttons .btn-comment {
margin-left: 15px;
}
#product-comment-posted-modal .post-comment-buttons,
#product-comment-post-error .post-comment-buttons,
#update-comment-usefulness-post-error .post-comment-buttons {
margin-top: 30px;
}
.modal-header .material-icons {
color: #40a85f;
font-size: 30px;
line-height: 25px;
}
.modal-header .material-icons.error {
color: #a94442;
}
.modal-header .material-icons.feedback {
color: #f39d72;
}
/**
* Star component
*/
.star-content {
margin: 0 0 0 5px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.star-content div.star,
.star-content div.star-on,
.star-content div.star-hover {
display: block;
width: 20px;
height: 20px;
background: url(../img/stars.png) no-repeat 0 0 transparent;
flex: auto;
margin-left: 3px;
}
.star-content div.star-on,
.star-content div.star-hover {
background-position: -24px 0;
}
.small-stars .star-content div.star,
.small-stars .star-content div.star-on,
.small-stars .star-content div.star-hover {
background: url(../img/small_stars.png) no-repeat 0 0 transparent;
width: 16px;
height: 16px;
margin-left: 2px;
}
.small-stars .star-content div.star-on,
.small-stars .star-content div.star-hover {
background-position: -19px 0;
}
.star-content div.star-hover {
cursor: pointer;
}
.grade-stars {
position: relative;
height: 20px;
min-width: 120px;
display: inline-block;
}
.grade-stars.small-stars {
min-width: 100px;
}
.grade-stars .star-content {
position: absolute;
top: 3px;
left: 0;
}
.criterion-rating .grade-stars .star-content {
top: 0;
}
#post-product-comment-modal .star-content div.star a {
display: block;
position: absolute;
text-indent: -5000px;
}
#post-product-comment-modal .criterion-rating {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
#post-product-comment-modal .criterion-rating label {
color: #363a41;
font-size: 14px;
font-weight: bold;
}
#post-product-comment-form input.error,
#post-product-comment-form textarea.error {
background-color: #f2dede;
border: solid 1px #ebcccc;
}
#post-product-comment-form input.valid,
#post-product-comment-form textarea.valid {
border: solid 1px #d0e9c6;
}
/**
* Product comments list
*/
#product-comments-list-header {
padding: 20px 15px;
color: #232323;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
#product-comments-list-header .comments-nb {
padding-left: 0;
padding-top: 3px;
}
#product-comments-list-header .comments-nb .material-icons {
margin-right: 3px;
}
#product-comments-list .btn-comment {
margin: 0 auto;
display: block;
}
.product-comment-list-item {
padding: 26px 0;
margin: 0 0 20px;
background-color: #ffffff;
text-align: left;
}
#empty-product-comment {
text-align: center;
}
.product-comment-list-item .grade-stars .star-content {
margin: 0 0 10px;
}
.product-comment-list-item .comment-infos {
height: 19px;
color: #6b868f;
font-size: 14px;
letter-spacing: -0.28px;
line-height: 19px;
min-height: 100px;
}
.product-comment-list-item .comment-infos .grade-stars {
margin-bottom: 20px;
}
.product-comment-list-item .comment-content h4 {
height: 22px;
color: #363a41;
font-size: 16px;
font-weight: 600;
letter-spacing: -0.32px;
line-height: 22px;
}
.product-comment-list-item .comment-content p {
color: #363a42;
font-size: 14px;
letter-spacing: -0.28px;
line-height: 19px;
word-break: break-word;
white-space: pre-wrap;
}
.product-comment-list-item .comment-content .comment-buttons a {
color: #6b868f;
font-size: 14px;
letter-spacing: -0.28px;
line-height: 19px;
margin-right: 8px;
}
.product-comment-list-item .comment-content .comment-buttons a .material-icons {
font-size: 18px;
cursor: pointer;
}
/*
** Quickview style
*/
.product-quickview-review {
display: flex;
flex-direction: row;
}
.product-quickview-review .grade-stars .star-content {
margin: 0 0 0 0;
top: 0;
}
/*
** Product list override
*/
#products .thumbnail-container.has-reviews:hover .highlighted-informations,
#products .thumbnail-container.has-reviews:focus .highlighted-informations,
.featured-products
.thumbnail-container.has-reviews:hover
.highlighted-informations,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations,
.product-accessories
.thumbnail-container.has-reviews:hover
.highlighted-informations,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations,
.product-miniature
.thumbnail-container.has-reviews:hover
.highlighted-informations,
.product-miniature
.thumbnail-container.has-reviews:focus
.highlighted-informations {
height: 4.5rem;
}
#products
.thumbnail-container.has-reviews:hover
.highlighted-informations
.variant-links,
#products
.thumbnail-container.has-reviews:focus
.highlighted-informations
.variant-links,
.featured-products
.thumbnail-container.has-reviews:hover
.highlighted-informations
.variant-links,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations
.variant-links,
.product-accessories
.thumbnail-container.has-reviews:hover
.highlighted-informations
.variant-links,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations
.variant-links,
.product-miniature
.thumbnail-container.has-reviews:hover
.highlighted-informations
.variant-links,
.product-miniature
.thumbnail-container.has-reviews:focus
.highlighted-informations
.variant-links {
min-height: 3.7rem;
}
#products
.thumbnail-container.has-reviews:hover
.highlighted-informations.no-variants,
#products
.thumbnail-container.has-reviews:focus
.highlighted-informations.no-variants,
.featured-products
.thumbnail-container.has-reviews:hover
.highlighted-informations.no-variants,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations.no-variants,
.product-accessories
.thumbnail-container.has-reviews:hover
.highlighted-informations.no-variants,
.featured-products
.thumbnail-container.has-reviews:focus
.highlighted-informations.no-variants,
.product-miniature
.thumbnail-container.has-reviews:hover
.highlighted-informations.no-variants,
.product-miniature
.thumbnail-container.has-reviews:focus
.highlighted-informations.no-variants {
height: 4.125rem;
}
#products
.product-miniature
.thumbnail-container.has-reviews
.discount-amount.online-only,
#products
.product-miniature
.thumbnail-container.has-reviews
.discount-percentage.online-only,
#products
.product-miniature
.thumbnail-container.has-reviews
.on-sale.online-only,
#products
.product-miniature
.thumbnail-container.has-reviews
.online-only.online-only,
#products .product-miniature .thumbnail-container.has-reviews .pack.online-only,
#products
.product-miniature
.thumbnail-container.has-reviews
.product-flags
.new.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.discount-amount.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.discount-percentage.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.on-sale.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.online-only.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.pack.online-only,
.featured-products
.product-miniature
.thumbnail-container.has-reviews
.product-flags
.new.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.discount-amount.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.discount-percentage.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.on-sale.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.online-only.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.pack.online-only,
.product-accessories
.product-miniature
.thumbnail-container.has-reviews
.product-flags
.new.online-only {
top: 11.5rem;
}
.product-list-reviews {
position: absolute;
top: -26px;
left: 0;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
width: 100%;
background: rgba(255, 255, 255, 0.5);
padding: 4px 0;
visibility: hidden;
}
.product-list-reviews .grade-stars .star-content {
top: 1px;
}
.product-list-reviews .comments-nb {
margin-left: 5px;
font-size: 13px;
}
@media (min-width: 768px) {
#product-comments-list-footer {
position: relative;
min-height: 45px;
}
#product-comments-list-footer .post-product-comment {
margin: 0 auto;
display: block;
}
#product-comments-list-pagination {
position: absolute;
right: 0;
top: 5px;
}
}
@media (max-width: 768px) {
#product-comments-list-footer {
display: flex;
flex-direction: row-reverse;
flex-wrap: nowrap;
justify-content: space-between;
}
}
@media (max-width: 576px) {
#product-comments-list-footer {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
}
#product-comments-list-pagination {
margin-bottom: 10px;
}
}
#product-comments-list-pagination {
height: 32px;
}
#product-comments-list-pagination ul {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
#product-comments-list-pagination ul li span {
height: 32px;
width: 24px;
margin: 0 5px;
cursor: pointer;
display: block;
text-align: center;
font-size: 20px;
line-height: 32px;
color: #6b868f;
}
#product-comments-list-pagination ul li.active span,
#product-comments-list-pagination ul li span.next i,
#product-comments-list-pagination ul li span.prev i {
font-weight: bold;
}
#product-comments-list-pagination ul li.disabled span {
opacity: 0.3;
cursor: not-allowed;
}
#product-comments-list-pagination ul li.active span {
cursor: not-allowed;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../');
exit;

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,157 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
jQuery.fn.rating = function(generalOptions) {
const $ratings = $(this);
$ratings.each(function initRating() {
const $ratingComponent = $(this);
var options = generalOptions ? generalOptions : {};
if (!options.grade && $ratingComponent.data('grade')) {
options.grade = $ratingComponent.data('grade');
}
if (!options.min && $ratingComponent.data('min')) {
options.min = $ratingComponent.data('min');
}
if (!options.max && $ratingComponent.data('max')) {
options.max = $ratingComponent.data('max');
}
if (!options.input && $ratingComponent.data('input')) {
options.input = $ratingComponent.data('input');
}
var componentOptions = jQuery.extend({
grade: null,
input: null,
min: 1,
max: 5,
starWidth: 20
}, options);
const minValue = Math.min(componentOptions.min, componentOptions.max);
const maxValue = Math.max(componentOptions.min, componentOptions.max);
const ratingValue = Math.min(Math.max(minValue, componentOptions.grade), maxValue);
$ratingComponent.html('');
$ratingComponent.append('<div class="star-content star-empty clearfix"></div>');
$ratingComponent.append('<div class="star-content star-full clearfix"></div>');
const emptyStars = $('.star-empty', this);
const fullStars = $('.star-full', this);
const emptyStar = $('<div class="star"></div>');
const fullStar = $('<div class="star-on"></div>');
var ratingInput;
if (componentOptions.input) {
ratingInput = $('<input type="number" name="'+componentOptions.input+'" id="'+componentOptions.input+'" />');
ratingInput.val(ratingValue);
ratingInput.css('display', 'none');
ratingInput.on('change', displayInteractiveGrade);
$ratingComponent.append(ratingInput);
initInteractiveGrade();
} else {
displayGrade(ratingValue);
}
function initInteractiveGrade() {
emptyStars.html('');
fullStars.html('');
var newStar;
for (var i = minValue; i <= maxValue; ++i) {
newStar = emptyStar.clone();
newStar.data('grade', i);
newStar.on('mouseenter mouseleave', function overStar() {
var overIndex = $('.star', fullStars).index($(this));
$('.star', fullStars).each(function overStars() {
$(this).removeClass('star-on');
var starIndex = $('.star', fullStars).index($(this));
if (starIndex <= overIndex) {
$(this).addClass('star-hover');
} else {
$(this).removeClass('star-hover');
}
});
});
newStar.on('click', function selectGrade() {
var selectedGrade = $(this).data('grade');
ratingInput.val(selectedGrade);
});
fullStars.append(newStar);
}
fullStars.on('mouseenter', function(){}).on('mouseleave', displayInteractiveGrade);
displayInteractiveGrade();
}
function displayInteractiveGrade() {
$('.star', fullStars).each(function displayStar() {
var starValue = $(this).data('grade');
$(this).removeClass('star-hover');
if (starValue <= ratingInput.val()) {
$(this).addClass('star-on');
} else {
$(this).removeClass('star-on');
}
});
}
function displayGrade(grade) {
emptyStars.html('');
fullStars.html('');
var newStar;
for (var i = minValue; i <= maxValue; ++i) {
if (i <= Math.floor(grade)) {
newStar = emptyStar.clone();
newStar.css('visibility', 'hidden');
emptyStars.append(newStar);
fullStars.append(fullStar.clone());
} else if (i > Math.ceil(grade)) {
newStar = emptyStar.clone();
emptyStars.append(newStar.clone());
} else {
//This the partial star composed of
// - one invisible partial empty star
// - one visible partial empty star (remaining part)
// - one visible partial full star
var fullWidth = (grade - i + 1) * componentOptions.starWidth;
var emptyWidth = componentOptions.starWidth - fullWidth;
newStar = emptyStar.clone();
newStar.css('visibility', 'hidden');
newStar.css('width', fullWidth);
emptyStars.append(newStar);
newStar = emptyStar.clone();
newStar.css('width', emptyWidth);
newStar.css('background-position', '0px -'+fullWidth+'px');
newStar.css('background-position', '-'+fullWidth+'px 0px');
newStar.css('marginLeft', 0);
emptyStars.append(newStar);
fullStar.css('width', fullWidth);
fullStars.append(fullStar.clone());
}
}
}
});
}

View File

@@ -0,0 +1,398 @@
/**
* simplePagination.js v1.6
* A simple jQuery pagination plugin.
* http://flaviusmatis.github.com/simplePagination.js/
*
* Copyright 2012, Flavius Matis
* Released under the MIT license.
* http://flaviusmatis.github.com/license.html
*/
(function($){
var methods = {
init: function(options) {
var o = $.extend({
items: 1,
itemsOnPage: 1,
pages: 0,
displayedPages: 5,
edges: 2,
currentPage: 0,
useAnchors: true,
hrefTextPrefix: '#page-',
hrefTextSuffix: '',
prevText: 'Prev',
nextText: 'Next',
ellipseText: '&hellip;',
ellipsePageSet: true,
cssStyle: 'light-theme',
listStyle: '',
labelMap: [],
selectOnClick: true,
nextAtFront: false,
invertPageOrder: false,
useStartEdge : true,
useEndEdge : true,
onPageClick: function(pageNumber, event) {
// Callback triggered when a page is clicked
// Page number is given as an optional parameter
},
onInit: function() {
// Callback triggered immediately after initialization
}
}, options || {});
var self = this;
o.pages = o.pages ? o.pages : Math.ceil(o.items / o.itemsOnPage) ? Math.ceil(o.items / o.itemsOnPage) : 1;
if (o.currentPage)
o.currentPage = o.currentPage - 1;
else
o.currentPage = !o.invertPageOrder ? 0 : o.pages - 1;
o.halfDisplayed = o.displayedPages / 2;
this.each(function() {
self.addClass(o.cssStyle + ' simple-pagination').data('pagination', o);
methods._draw.call(self);
});
o.onInit();
return this;
},
selectPage: function(page) {
methods._selectPage.call(this, page - 1);
return this;
},
prevPage: function() {
var o = this.data('pagination');
if (!o.invertPageOrder) {
if (o.currentPage > 0) {
methods._selectPage.call(this, o.currentPage - 1);
}
} else {
if (o.currentPage < o.pages - 1) {
methods._selectPage.call(this, o.currentPage + 1);
}
}
return this;
},
nextPage: function() {
var o = this.data('pagination');
if (!o.invertPageOrder) {
if (o.currentPage < o.pages - 1) {
methods._selectPage.call(this, o.currentPage + 1);
}
} else {
if (o.currentPage > 0) {
methods._selectPage.call(this, o.currentPage - 1);
}
}
return this;
},
getPagesCount: function() {
return this.data('pagination').pages;
},
setPagesCount: function(count) {
this.data('pagination').pages = count;
},
getCurrentPage: function () {
return this.data('pagination').currentPage + 1;
},
destroy: function(){
this.empty();
return this;
},
drawPage: function (page) {
var o = this.data('pagination');
o.currentPage = page - 1;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
redraw: function(){
methods._draw.call(this);
return this;
},
disable: function(){
var o = this.data('pagination');
o.disabled = true;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
enable: function(){
var o = this.data('pagination');
o.disabled = false;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
updateItems: function (newItems) {
var o = this.data('pagination');
o.items = newItems;
o.pages = methods._getPages(o);
this.data('pagination', o);
methods._draw.call(this);
},
updateItemsOnPage: function (itemsOnPage) {
var o = this.data('pagination');
o.itemsOnPage = itemsOnPage;
o.pages = methods._getPages(o);
this.data('pagination', o);
methods._selectPage.call(this, 0);
return this;
},
getItemsOnPage: function() {
return this.data('pagination').itemsOnPage;
},
_draw: function() {
var o = this.data('pagination'),
interval = methods._getInterval(o),
i,
tagName;
methods.destroy.call(this);
tagName = (typeof this.prop === 'function') ? this.prop('tagName') : this.attr('tagName');
var $panel = tagName === 'UL' ? this : $('<ul' + (o.listStyle ? ' class="' + o.listStyle + '"' : '') + '></ul>').appendTo(this);
// Generate Prev link
if (o.prevText) {
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage - 1 : o.currentPage + 1, {text: o.prevText, classes: 'prev'});
}
// Generate Next link (if option set for at front)
if (o.nextText && o.nextAtFront) {
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1 : o.currentPage - 1, {text: o.nextText, classes: 'next'});
}
// Generate start edges
if (!o.invertPageOrder) {
if (interval.start > 0 && o.edges > 0) {
if(o.useStartEdge) {
var end = Math.min(o.edges, interval.start);
for (i = 0; i < end; i++) {
methods._appendItem.call(this, i);
}
}
if (o.edges < interval.start && (interval.start - o.edges != 1)) {
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
} else if (interval.start - o.edges == 1) {
methods._appendItem.call(this, o.edges);
}
}
} else {
if (interval.end < o.pages && o.edges > 0) {
if(o.useStartEdge) {
var begin = Math.max(o.pages - o.edges, interval.end);
for (i = o.pages - 1; i >= begin; i--) {
methods._appendItem.call(this, i);
}
}
if (o.pages - o.edges > interval.end && (o.pages - o.edges - interval.end != 1)) {
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
} else if (o.pages - o.edges - interval.end == 1) {
methods._appendItem.call(this, interval.end);
}
}
}
// Generate interval links
if (!o.invertPageOrder) {
for (i = interval.start; i < interval.end; i++) {
methods._appendItem.call(this, i);
}
} else {
for (i = interval.end - 1; i >= interval.start; i--) {
methods._appendItem.call(this, i);
}
}
// Generate end edges
if (!o.invertPageOrder) {
if (interval.end < o.pages && o.edges > 0) {
if (o.pages - o.edges > interval.end && (o.pages - o.edges - interval.end != 1)) {
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
} else if (o.pages - o.edges - interval.end == 1) {
methods._appendItem.call(this, interval.end);
}
if(o.useEndEdge) {
var begin = Math.max(o.pages - o.edges, interval.end);
for (i = begin; i < o.pages; i++) {
methods._appendItem.call(this, i);
}
}
}
} else {
if (interval.start > 0 && o.edges > 0) {
if (o.edges < interval.start && (interval.start - o.edges != 1)) {
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
} else if (interval.start - o.edges == 1) {
methods._appendItem.call(this, o.edges);
}
if(o.useEndEdge) {
var end = Math.min(o.edges, interval.start);
for (i = end - 1; i >= 0; i--) {
methods._appendItem.call(this, i);
}
}
}
}
// Generate Next link (unless option is set for at front)
if (o.nextText && !o.nextAtFront) {
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1 : o.currentPage - 1, {text: o.nextText, classes: 'next'});
}
if (o.ellipsePageSet && !o.disabled) {
methods._ellipseClick.call(this, $panel);
}
},
_getPages: function(o) {
var pages = Math.ceil(o.items / o.itemsOnPage);
return pages || 1;
},
_getInterval: function(o) {
return {
start: Math.ceil(o.currentPage > o.halfDisplayed ? Math.max(Math.min(o.currentPage - o.halfDisplayed, (o.pages - o.displayedPages)), 0) : 0),
end: Math.ceil(o.currentPage > o.halfDisplayed ? Math.min(o.currentPage + o.halfDisplayed, o.pages) : Math.min(o.displayedPages, o.pages))
};
},
_appendItem: function(pageIndex, opts) {
var self = this, options, $link, o = self.data('pagination'), $linkWrapper = $('<li></li>'), $ul = self.find('ul');
pageIndex = pageIndex < 0 ? 0 : (pageIndex < o.pages ? pageIndex : o.pages - 1);
options = {
text: pageIndex + 1,
classes: ''
};
if (o.labelMap.length && o.labelMap[pageIndex]) {
options.text = o.labelMap[pageIndex];
}
options = $.extend(options, opts || {});
if (pageIndex == o.currentPage || o.disabled) {
if (o.disabled || options.classes === 'prev' || options.classes === 'next') {
$linkWrapper.addClass('disabled');
} else {
$linkWrapper.addClass('active');
}
$link = $('<span class="current">' + (options.text) + '</span>');
} else {
if (o.useAnchors) {
$link = $('<a href="' + o.hrefTextPrefix + (pageIndex + 1) + o.hrefTextSuffix + '" class="page-link">' + (options.text) + '</a>');
} else {
$link = $('<span >' + (options.text) + '</span>');
}
$link.click(function(event){
return methods._selectPage.call(self, pageIndex, event);
});
}
if (options.classes) {
$link.addClass(options.classes);
}
$linkWrapper.append($link);
if ($ul.length) {
$ul.append($linkWrapper);
} else {
self.append($linkWrapper);
}
},
_selectPage: function(pageIndex, event) {
var o = this.data('pagination');
o.currentPage = pageIndex;
if (o.selectOnClick) {
methods._draw.call(this);
}
return o.onPageClick(pageIndex + 1, event);
},
_ellipseClick: function($panel) {
var self = this,
o = this.data('pagination'),
$ellip = $panel.find('.ellipse');
$ellip.addClass('clickable').parent().removeClass('disabled');
$ellip.click(function(event) {
if (!o.disable) {
var $this = $(this),
val = (parseInt($this.parent().prev().text(), 10) || 0) + 1;
$this
.html('<input type="number" min="1" max="' + o.pages + '" step="1" value="' + val + '">')
.find('input')
.focus()
.click(function(event) {
// prevent input number arrows from bubbling a click event on $ellip
event.stopPropagation();
})
.keyup(function(event) {
var val = $(this).val();
if (event.which === 13 && val !== '') {
// enter to accept
if ((val>0)&&(val<=o.pages))
methods._selectPage.call(self, val - 1);
} else if (event.which === 27) {
// escape to cancel
$ellip.empty().html(o.ellipseText);
}
})
.bind('blur', function(event) {
var val = $(this).val();
if (val !== '') {
methods._selectPage.call(self, val - 1);
}
$ellip.empty().html(o.ellipseText);
return false;
});
}
return false;
});
}
};
$.fn.pagination = function(method) {
// Method calling logic
if (methods[method] && method.charAt(0) != '_') {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.pagination');
}
};
})(jQuery);

View File

@@ -0,0 +1,169 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
jQuery(document).ready(function () {
const $ = jQuery;
const commentsList = $('#product-comments-list');
const emptyProductComment = $('#empty-product-comment');
const commentsListUrl = commentsList.data('list-comments-url');
const updateCommentUsefulnessUrl = commentsList.data('update-comment-usefulness-url');
const reportCommentUrl = commentsList.data('report-comment-url');
const commentPrototype = commentsList.data('comment-item-prototype');
emptyProductComment.hide();
$('.grade-stars').rating();
prestashop.on('updatedProduct', function() {
$('.product-comments-additional-info .grade-stars').rating();
})
document.addEventListener('updateRating', function() {
$('.grade-stars').rating();
});
const updateCommentPostErrorModal = $('#update-comment-usefulness-post-error');
const confirmAbuseModal = $('#report-comment-confirmation');
const reportCommentPostErrorModal = $('#report-comment-post-error');
const reportCommentPostedModal = $('#report-comment-posted');
function showUpdatePostCommentErrorModal(errorMessage) {
$('#update-comment-usefulness-post-error-message').html(errorMessage);
updateCommentPostErrorModal.modal('show');
}
function showReportCommentErrorModal(errorMessage) {
$('#report-comment-post-error-message').html(errorMessage);
reportCommentPostErrorModal.modal('show');
}
function paginateComments(page) {
$.get(commentsListUrl, {page: page}, function(jsonResponse) {
if (jsonResponse.comments && jsonResponse.comments.length > 0) {
populateComments(jsonResponse.comments);
if (jsonResponse.comments_nb > jsonResponse.comments_per_page) {
$('#product-comments-list-pagination').pagination({
currentPage: page,
items: jsonResponse.comments_nb,
itemsOnPage: jsonResponse.comments_per_page,
cssStyle: '',
prevText: '<i class="material-icons" data-icon="chevron_left"></i>',
nextText: '<i class="material-icons" data-icon="chevron_right"></i>',
useAnchors: false,
displayedPages: 2,
onPageClick: paginateComments
});
} else {
$('#product-comments-list-pagination').hide();
}
} else {
commentsList.html('');
emptyProductComment.show();
commentsList.append(emptyProductComment);
}
});
}
function populateComments(comments) {
commentsList.html('');
comments.forEach(addComment);
}
function addComment(comment) {
var commentTemplate = commentPrototype;
var customerName = comment.customer_name;
if (!customerName) {
customerName = comment.firstname+' '+comment.lastname;
}
commentTemplate = commentTemplate.replace(/@COMMENT_ID@/, comment.id_product_comment);
commentTemplate = commentTemplate.replace(/@PRODUCT_ID@/, comment.id_product);
commentTemplate = commentTemplate.replace(/@CUSTOMER_NAME@/, customerName);
commentTemplate = commentTemplate.replace(/@COMMENT_DATE@/, comment.date_add);
commentTemplate = commentTemplate.replace(/@COMMENT_TITLE@/, comment.title);
commentTemplate = commentTemplate.replace(/@COMMENT_COMMENT@/, comment.content);
commentTemplate = commentTemplate.replace(/@COMMENT_USEFUL_ADVICES@/, comment.usefulness);
commentTemplate = commentTemplate.replace(/@COMMENT_GRADE@/, comment.grade);
commentTemplate = commentTemplate.replace(/@COMMENT_NOT_USEFUL_ADVICES@/, (comment.total_usefulness - comment.usefulness));
commentTemplate = commentTemplate.replace(/@COMMENT_TOTAL_ADVICES@/, comment.total_usefulness);
const $comment = $(commentTemplate);
$('.grade-stars', $comment).rating({
grade: comment.grade
});
$('.useful-review', $comment).click(function() {
updateCommentUsefulness($comment, comment.id_product_comment, 1);
});
$('.not-useful-review', $comment).click(function() {
updateCommentUsefulness($comment, comment.id_product_comment, 0);
});
$('.report-abuse', $comment).click(function() {
confirmCommentAbuse(comment.id_product_comment);
});
commentsList.append($comment);
}
function updateCommentUsefulness($comment, commentId, usefulness) {
$.post(updateCommentUsefulnessUrl, {id_product_comment: commentId, usefulness: usefulness}, function(jsonData){
if (jsonData) {
if (jsonData.success) {
$('.useful-review-value', $comment).html(jsonData.usefulness);
$('.not-useful-review-value', $comment).html(jsonData.total_usefulness - jsonData.usefulness);
} else {
const decodedErrorMessage = $("<div/>").html(jsonData.error).text();
showUpdatePostCommentErrorModal(decodedErrorMessage);
}
} else {
showUpdatePostCommentErrorModal(productCommentUpdatePostErrorMessage);
}
}).fail(function() {
showUpdatePostCommentErrorModal(productCommentUpdatePostErrorMessage);
});
}
function confirmCommentAbuse(commentId) {
confirmAbuseModal.modal('show');
confirmAbuseModal.one('modal:confirm', function(event, confirm) {
if (!confirm) {
return;
}
$.post(reportCommentUrl, {id_product_comment: commentId}, function(jsonData){
if (jsonData) {
if (jsonData.success) {
reportCommentPostedModal.modal('show');
} else {
showReportCommentErrorModal(jsonData.error);
}
} else {
showReportCommentErrorModal(productCommentAbuseReportErrorMessage);
}
}).fail(function() {
showReportCommentErrorModal(productCommentAbuseReportErrorMessage);
});
})
}
paginateComments(1);
});

View File

@@ -0,0 +1,131 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
jQuery(document).ready(function () {
const $ = jQuery;
$('body').on('click', '.post-product-comment', function (event) {
event.preventDefault();
showPostCommentModal();
});
const postCommentModal = $('#post-product-comment-modal');
postCommentModal.on('hidden.bs.modal', function () {
postCommentModal.modal('hide');
clearPostCommentForm();
});
const commentPostedModal = $('#product-comment-posted-modal');
const commentPostErrorModal = $('#product-comment-post-error');
function showPostCommentModal() {
commentPostedModal.modal('hide');
commentPostErrorModal.modal('hide');
postCommentModal.modal('show');
}
function showCommentPostedModal() {
postCommentModal.modal('hide');
commentPostErrorModal.modal('hide');
clearPostCommentForm();
commentPostedModal.modal('show');
}
function showPostErrorModal(errorMessage) {
postCommentModal.modal('hide');
commentPostedModal.modal('hide');
clearPostCommentForm();
$('#product-comment-post-error-message').html(errorMessage);
commentPostErrorModal.modal('show');
}
function clearPostCommentForm() {
$('#post-product-comment-form input[type="text"]').val('');
$('#post-product-comment-form input[type="text"]').removeClass('valid error');
$('#post-product-comment-form textarea').val('');
$('#post-product-comment-form textarea').removeClass('valid error');
$('#post-product-comment-form .criterion-rating input').val(3).trigger('change');
}
function initCommentModal() {
$('#post-product-comment-modal .grade-stars').rating();
$('body').on('click', '.post-product-comment', function (event) {
event.preventDefault();
showPostCommentModal();
});
$('#post-product-comment-form').on('submit', submitCommentForm);
}
function submitCommentForm(event) {
event.preventDefault();
var formData = $(this).serializeArray();
if (!validateFormData(formData)) {
return;
}
$.post($(this).attr('action'), $(this).serialize(), function(jsonData) {
if (jsonData) {
if (jsonData.success) {
clearPostCommentForm();
showCommentPostedModal();
} else {
if (jsonData.errors) {
var errorList = '<ul>';
for (var i = 0; i < jsonData.errors.length; ++i) {
errorList += '<li>' + jsonData.errors[i] + '</li>';
}
errorList += '</ul>';
showPostErrorModal(errorList);
} else {
const decodedErrorMessage = $("<div/>").html(jsonData.error).text();
showPostErrorModal(decodedErrorMessage);
}
}
} else {
showPostErrorModal(productCommentPostErrorMessage);
}
}).fail(function() {
showPostErrorModal(productCommentPostErrorMessage);
});
}
function validateFormData(formData) {
var isValid = true;
formData.forEach(function(formField) {
const fieldSelector = '#post-product-comment-form [name="'+formField.name+'"]';
if (!formField.value) {
$(fieldSelector).addClass('error');
$(fieldSelector).removeClass('valid');
isValid = false;
} else {
$(fieldSelector).removeClass('error');
$(fieldSelector).addClass('valid');
}
});
return isValid;
}
initCommentModal();
});

View File

@@ -0,0 +1,151 @@
/**
* 2007-2019 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2019 PrestaShop SA and Contributors
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(document).ready(function() {
productListingComments.init();
productListingComments.load();
});
var productListingComments = (function () {
var data = {
productIDs: [],
commentsLoadingInProgress: false,
ajaxIDsLimit: 50,
ajaxUrl: ''
}
var DOMStrings = {
productListReviewsContainer: '.product-list-reviews',
productListReviewsNumberOfComments: '.comments-nb',
productListReviewsStarsContainer: '.grade-stars',
productContainer: '.thumbnail-container'
};
var DOMClasses = {
inProgress: 'reviews-loading',
reviewsLoaded: 'reviews-loaded',
hasReviews: 'has-reviews'
};
function setEvents() {
prestashop.on('updateProductList', function() {
addProductsIDs();
});
}
function setAjaxUrl() {
if (data.ajaxUrl !== '')
return;
var url = $(DOMStrings.productListReviewsContainer).first().data('url');
data.ajaxUrl = url;
}
function getNewProductsReviewsElements() {
var $productListReviews = $(DOMStrings.productContainer)
.not('.' + DOMClasses.reviewsLoaded + ', .' + DOMClasses.inProgress)
.addClass(DOMClasses.inProgress)
.find(DOMStrings.productListReviewsContainer);
return $productListReviews;
}
function addProductsIDs() {
var $productsList = getNewProductsReviewsElements(),
seenIds = {};
$productsList.each(function () {
var id = $(this).data('id');
seenIds[id] = true;
});
var IDsArray = Object.keys(seenIds).filter(e => e !== 'undefined');
var prevDataIDs = data.productIDs.splice(0);
data.productIDs = prevDataIDs.concat(IDsArray);
if (!data.commentsLoadingInProgress) {
loadProductsData();
}
}
function loadProductsData() {
if (data.productIDs.length === 0)
return;
data.commentsLoadingInProgress = true;
var dataIDsCopy = data.productIDs.slice(0);
selectedProductIDs = dataIDsCopy.splice(0, data.ajaxIDsLimit);
$.get(data.ajaxUrl, { id_products: selectedProductIDs }, function (jsonData) {
if (jsonData) {
$.each(jsonData.products, function(i, elem) {
var productData = elem;
var $productsReviewsContainer = $('.product-list-reviews[data-id="' + productData.id_product + '"]');
$productsReviewsContainer.each(function () {
var $self = $(this);
if (productData.comments_nb > 0) {
$self.find(DOMStrings.productListReviewsStarsContainer).rating({ grade: productData.average_grade, starWidth: 16 });
$self.find(DOMStrings.productListReviewsNumberOfComments).text('(' + productData.comments_nb + ')');
$self.closest(DOMStrings.productContainer).addClass(DOMClasses.hasReviews);
$self.css('visibility', 'visible');
}
$self.closest(DOMStrings.productContainer).addClass(DOMClasses.reviewsLoaded);
$self.closest(DOMStrings.productContainer).removeClass(DOMClasses.inProgress);
});
data.productIDs.shift();
});
data.commentsLoadingInProgress = false;
if (data.productIDs.length > 0) {
loadProductsData();
}
}
});
}
return {
load: function () {
addProductsIDs();
},
init: function () {
setAjaxUrl();
setEvents();
}
}
})();

View File

@@ -0,0 +1,70 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{extends file="helpers/form/form.tpl"}
{block name="input"}
{if $input.type == 'products'}
<table id="{$input.name}">
<tr>
<th></th>
<th>ID</th>
<th width="80%">{l s='Product Name' d='Modules.Productcomments.Admin'}</th>
</tr>
{foreach $input.values as $value}
<tr>
<td>
<input type="checkbox" name="{$input.name}[]" value="{$value.id_product}"
{if isset($value.selected) && $value.selected == 1} checked {/if} />
</td>
<td>{$value.id_product}</td>
<td width="80%">{$value.name}</td>
</tr>
{/foreach}
</table>
{elseif $input.type == 'switch' && $smarty.const._PS_VERSION_|@addcslashes:'\'' < '1.6'}
{foreach $input.values as $value}
<input type="radio" name="{$input.name}" id="{$value.id}" value="{$value.value|escape:'html':'UTF-8'}"
{if $fields_value[$input.name] == $value.value}checked="checked"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
<label class="t" for="{$value.id}">
{if isset($input.is_bool) && $input.is_bool == true}
{if $value.value == 1}
<img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" />
{else}
<img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" />
{/if}
{else}
{$value.label}
{/if}
</label>
{if isset($input.br) && $input.br}<br />{/if}
{if isset($value.p) && $value.p}<p>{$value.p}</p>{/if}
{/foreach}
{else}
{$smarty.block.parent}
{/if}
{/block}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,28 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<a href="{$href}" class="btn btn-success" title="{$action}" >
<i class="icon-check"></i> {$action}
</a>

View File

@@ -0,0 +1,28 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<a href="{$href}" class="" title="{$action}" >
<i class="icon-check"></i> {$action}
</a>

View File

@@ -0,0 +1,63 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{assign var='icon' value=$icon|default:'check_circle'}
{assign var='modal_message' value=$modal_message|default:''}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
const alertModal = $('#{$modal_id}');
alertModal.on('hidden.bs.modal', function () {
alertModal.modal('hide');
});
});
</script>
<div id="{$modal_id}" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>
<i class="material-icons {$icon}" data-icon="{$icon}"></i>
{$modal_title}
</h2>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 col-sm-12" id="{$modal_id}-message">
{$modal_message}
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 post-comment-buttons">
<button type="button" class="btn btn-comment btn-comment-huge" data-dismiss="modal" aria-label="{l s='OK' d='Modules.Productcomments.Shop'}">
{l s='OK' d='Modules.Productcomments.Shop'}
</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,31 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{if $nb_comments != 0}
<div class="comments-note">
<span>{l s='Grade' d='Modules.Productcomments.Shop'}</span>
<div class="grade-stars" data-grade="{$grade}"></div>
</div>
{/if}

View File

@@ -0,0 +1,74 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{assign var='icon' value=$icon|default:'check_circle'}
{assign var='modal_message' value=$modal_message|default:''}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
const confirmModal = $('#{$modal_id}');
confirmModal.on('hidden.bs.modal', function () {
confirmModal.modal('hide');
confirmModal.trigger('modal:confirm', false);
});
$('.confirm-button', confirmModal).click(function() {
confirmModal.trigger('modal:confirm', true);
});
$('.refuse-button', confirmModal).click(function() {
confirmModal.trigger('modal:confirm', false);
});
});
</script>
<div id="{$modal_id}" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>
<i class="material-icons {$icon}" data-icon="{$icon}"></i>
{$modal_title}
</h2>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 col-sm-12" id="{$modal_id}-message">
{$modal_message}
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 post-comment-buttons">
<button type="button" class="btn btn-comment-inverse btn-comment-huge refuse-button" data-dismiss="modal" aria-label="{l s='No' d='Modules.Productcomments.Shop'}">
{l s='No' d='Modules.Productcomments.Shop'}
</button>
<button type="button" class="btn btn-comment btn-comment-huge confirm-button" data-dismiss="modal" aria-label="{l s='Yes' d='Modules.Productcomments.Shop'}">
{l s='Yes' d='Modules.Productcomments.Shop'}
</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,35 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<div id="empty-product-comment" class="product-comment-list-item">
{if $post_allowed}
<button class="btn btn-comment btn-comment-big post-product-comment">
<i class="material-icons shopping-cart" data-icon="edit"></i>
{l s='Be the first to write your review' d='Modules.Productcomments.Shop'}
</button>
{else}
{l s='No customer reviews for the moment.' d='Modules.Productcomments.Shop'}
{/if}
</div>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,160 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<script type="text/javascript">
var productCommentPostErrorMessage = '{l s='Sorry, your review cannot be posted.' d='Modules.Productcomments.Shop' js=1}';
</script>
<div id="post-product-comment-modal" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>{l s='Write your review' d='Modules.Productcomments.Shop'}</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="post-product-comment-form" action="{$post_comment_url nofilter}" method="POST">
<div class="row">
<div class="col-md-2 col-sm-2">
{if isset($product) && $product}
{block name='product_flags'}
<ul class="product-flags">
{foreach from=$product.flags item=flag}
<li class="product-flag {$flag.type}">{$flag.label}</li>
{/foreach}
</ul>
{/block}
{block name='product_cover'}
<div class="product-cover">
{if $product.cover}
<img class="js-qv-product-cover" src="{$product.cover.bySize.medium_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
{else}
<img src="{$urls.no_picture_image.bySize.large_default.url nofilter}" style="width:100%;">
{/if}
</div>
{/block}
{/if}
</div>
<div class="col-md-4 col-sm-4">
<h3>{$product.name}</h3>
{block name='product_description_short'}
<div itemprop="description">{$product.description_short nofilter}</div>
{/block}
</div>
<div class="col-md-6 col-sm-6">
{if $criterions|@count > 0}
<ul id="criterions_list">
{foreach from=$criterions item='criterion'}
<li>
<div class="criterion-rating">
<label>{$criterion.name|escape:'html':'UTF-8'}:</label>
<div
class="grade-stars"
data-grade="3"
data-input="criterion[{$criterion.id_product_comment_criterion}]">
</div>
</div>
</li>
{/foreach}
</ul>
{/if}
</div>
</div>
<div class="row">
{if !$logged}
<div class="col-md-8 col-sm-8">
<label class="form-label" for="comment_title">{l s='Title' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
<input name="comment_title" type="text" value=""/>
</div>
<div class="col-md-4 col-sm-4">
<label class="form-label" for="customer_name">{l s='Your name' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
<input name="customer_name" type="text" value=""/>
</div>
{else}
<div class="col-md-12 col-sm-12">
<label class="form-label" for="comment_title">{l s='Title' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
<input name="comment_title" type="text" value=""/>
</div>
{/if}
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<label class="form-label" for="comment_content">{l s='Review' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<textarea name="comment_content"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
{hook h='displayGDPRConsent' mod='psgdpr' id_module=$id_module}
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6">
<p class="required"><sup>*</sup> {l s='Required fields' d='Modules.Productcomments.Shop'}</p>
</div>
<div class="col-md-6 col-sm-6 post-comment-buttons">
<button type="button" class="btn btn-comment-inverse btn-comment-big" data-dismiss="modal" aria-label="{l s='Cancel' d='Modules.Productcomments.Shop'}">
{l s='Cancel' d='Modules.Productcomments.Shop'}
</button>
<button type="submit" class="btn btn-comment btn-comment-big">
{l s='Send' d='Modules.Productcomments.Shop'}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{* Comment posted modal *}
{if $moderation_active}
{assign var='comment_posted_message' value={l s='Your comment has been submitted and will be available once approved by a moderator.' d='Modules.Productcomments.Shop'}}
{else}
{assign var='comment_posted_message' value={l s='Your comment has been added!' d='Modules.Productcomments.Shop'}}
{/if}
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
modal_id='product-comment-posted-modal'
modal_title={l s='Review sent' d='Modules.Productcomments.Shop'}
modal_message=$comment_posted_message
}
{* Comment post error modal *}
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
modal_id='product-comment-post-error'
modal_title={l s='Your review cannot be sent' d='Modules.Productcomments.Shop'}
icon='error'
}

View File

@@ -0,0 +1,38 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{if $nb_comments != 0}
<script type="text/javascript">
$('#product-quickview-{$product.id}').insertAfter($('.quickview #product-description-short'));
$('#product-quickview-{$product.id} .grade-stars').rating({ grade: {$average_grade} });
$('#product-quickview-{$product.id} .comments-nb').html('({$nb_comments})');
</script>
<div id="product-quickview-{$product.id}" class="product-quickview-review">
<div class="grade-stars"></div>
<div class="comments-nb"></div>
</div>
</div>
{/if}

View File

@@ -0,0 +1,51 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{if $nb_comments != 0 || $post_allowed}
<div class="product-comments-additional-info">
{if $nb_comments == 0}
{if $post_allowed}
<button class="btn btn-comment post-product-comment">
<i class="material-icons shopping-cart" data-icon="edit"></i>
{l s='Write your review' d='Modules.Productcomments.Shop'}
</button>
{/if}
{else}
{include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade}
<div class="additional-links">
<a class="link-comment" href="#product-comments-list-header">
<i class="material-icons shopping-cart" data-icon="chat"></i>
{l s='Read user reviews' d='Modules.Productcomments.Shop'} ({$nb_comments})
</a>
{if $post_allowed}
<a class="link-comment post-product-comment" href="#product-comments-list-header">
<i class="material-icons shopping-cart" data-icon="edit"></i>
{l s='Write your review' d='Modules.Productcomments.Shop'}
</a>
{/if}
</div>
{/if}
</div>
{/if}

View File

@@ -0,0 +1,56 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<div class="product-comment-list-item row" data-product-comment-id="@COMMENT_ID@" data-product-id="@PRODUCT_ID@">
<div class="col-md-3 col-sm-3 comment-infos">
<div class="grade-stars" data-grade="@COMMENT_GRADE@"></div>
<div class="comment-date">
@COMMENT_DATE@
</div>
<div class="comment-author">
{l s='By %1$s' sprintf=['@CUSTOMER_NAME@'] d='Modules.Productcomments.Shop'}
</div>
</div>
<div class="col-md-9 col-sm-9 comment-content">
<h4>@COMMENT_TITLE@</h4>
<p>@COMMENT_COMMENT@</p>
<div class="comment-buttons btn-group">
{if $usefulness_enabled}
<a class="useful-review">
<i class="material-icons thumb_up" data-icon="thumb_up"></i>
<span class="useful-review-value">@COMMENT_USEFUL_ADVICES@</span>
</a>
<a class="not-useful-review">
<i class="material-icons thumb_down" data-icon="thumb_down"></i>
<span class="not-useful-review-value">@COMMENT_NOT_USEFUL_ADVICES@</span>
</a>
{/if}
<a class="report-abuse" title="{l s='Report abuse' d='Modules.Productcomments.Shop'}">
<i class="material-icons outlined_flag" data-icon="flag"></i>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,91 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<script type="text/javascript">
var productCommentUpdatePostErrorMessage = '{l|escape:'javascript' s='Sorry, your review appreciation cannot be sent.' d='Modules.Productcomments.Shop'}';
var productCommentAbuseReportErrorMessage = '{l|escape:'javascript' s='Sorry, your abuse report cannot be sent.' d='Modules.Productcomments.Shop'}';
</script>
<div class="roduct-comments-box">
<div class="row">
<div class="col-md-12 col-sm-12" id="product-comments-list-header">
<div class="comments-nb">
<i class="material-icons" data-icon="chat"></i>
{l s='Comments' d='Modules.Productcomments.Shop'} ({$nb_comments})
</div>
{include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade}
</div>
</div>
{include file='module:productcomments/views/templates/hook/product-comment-item-prototype.tpl' assign="comment_prototype"}
{include file='module:productcomments/views/templates/hook/empty-product-comment.tpl'}
<div class="row">
<div class="col-md-12 col-sm-12"
id="product-comments-list"
data-list-comments-url="{$list_comments_url nofilter}"
data-update-comment-usefulness-url="{$update_comment_usefulness_url nofilter}"
data-report-comment-url="{$report_comment_url nofilter}"
data-comment-item-prototype="{$comment_prototype|escape:'html'}">
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12" id="product-comments-list-footer">
<div id="product-comments-list-pagination"></div>
{if $post_allowed && $nb_comments != 0}
<button class="btn btn-comment btn-comment-big post-product-comment">
<i class="material-icons" data-icon="edit"></i>
{l s='Write your review' d='Modules.Productcomments.Shop'}
</button>
{/if}
</div>
</div>
</div>
{* Appreciation post error modal *}
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
modal_id='update-comment-usefulness-post-error'
modal_title={l s='Your review appreciation cannot be sent' d='Modules.Productcomments.Shop'}
icon='error'
}
{* Confirm report modal *}
{include file='module:productcomments/views/templates/hook/confirm-modal.tpl'
modal_id='report-comment-confirmation'
modal_title={l s='Report comment' d='Modules.Productcomments.Shop'}
modal_message={l s='Are you sure that you want to report this comment?' d='Modules.Productcomments.Shop'}
icon='feedback'
}
{* Report comment posted modal *}
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
modal_id='report-comment-posted'
modal_title={l s='Report sent' d='Modules.Productcomments.Shop'}
modal_message={l s='Your report has been submitted and will be considered by a moderator.' d='Modules.Productcomments.Shop'}
}
{* Report abuse error modal *}
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
modal_id='report-comment-post-error'
modal_title={l s='Your report cannot be sent' d='Modules.Productcomments.Shop'}
icon='error'
}

View File

@@ -0,0 +1,39 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{* Javascript is used to display each product grade, this allows every rating to be udpated as soon as they change *}
<div class="product-list-reviews" data-id="{$product.id}" data-url="{$product_comment_grade_url nofilter}">
<div class="grade-stars small-stars"></div>
<div class="comments-nb"></div>
</div>
{if $nb_comments != 0}
{* Rich snippet rating is displayed via php/smarty meaning it will be cached (for example on homepage) *}
<div itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating" itemscope>
<meta itemprop="reviewCount" content="{$nb_comments}" />
<meta itemprop="ratingValue" content="{$average_grade}" />
</div>
{/if}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;