276 lines
19 KiB
Smarty
276 lines
19 KiB
Smarty
{*
|
|
* Copyright ETS Software Technology Co., Ltd
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This file is not open source! Each license that you purchased is only available for 1 website only.
|
|
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
|
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
|
*
|
|
* DISCLAIMER
|
|
*
|
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
|
* versions in the future.
|
|
*
|
|
* @author ETS Software Technology Co., Ltd
|
|
* @copyright ETS Software Technology Co., Ltd
|
|
* @license Valid for 1 website (or project) for each purchase of license
|
|
*}
|
|
|
|
{assign var="postAllowed" value=($ETS_RV_ALLOW_GUESTS && !$logged || !$is_block_customer && $logged && ((!$purchased || $freeDownload && $productPrice <= 0) && (!$freeDownload && $ETS_RV_CUSTOMER || $freeDownload && ($ETS_RV_CUSTOMER_INCL && $productPrice <= 0 || $ETS_RV_CUSTOMER_EXCL && $productPrice > 0)) || $ETS_RV_PURCHASED_PRODUCT && $purchasedTime))}
|
|
<div id="ets-rv-post-product-comment-modal" class="ets-rv-modal fade ets-rv-product-comment-modal{if !$postAllowed && !$logged} popup_login_form{/if}" role="dialog" aria-hidden="true" data-keyboard="false" data-backdrop="static">
|
|
<div class="ets-rv-modal-dialog" role="document">
|
|
<div class="ets_table-cell">
|
|
<div class="ets-rv-modal-content">
|
|
<div class="ets_rv_reviews_modal{if !$postAllowed} disabled{/if}">
|
|
<form id="ets-rv-post-product-comment-form" data-type="comment" action="{$post_product_comment_url nofilter}" method="POST" class="{if !$review_allowed}hide{/if}">
|
|
<div class="ets-rv-modal-header ets">
|
|
<div class="h3" data-edit-title="{l s='Edit your review' mod='ets_reviews'}" data-add-title="{l s='Write your review' mod='ets_reviews'}">
|
|
<svg width="16" height="16" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 960v-128q0-26-19-45t-45-19h-256v-256q0-26-19-45t-45-19h-128q-26 0-45 19t-19 45v256h-256q-26 0-45 19t-19 45v128q0 26 19 45t45 19h256v256q0 26 19 45t45 19h128q26 0 45-19t19-45v-256h256q26 0 45-19t19-45zm320-64q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"/></svg>
|
|
{l s='Write your review' mod='ets_reviews'}
|
|
</div>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
{if $ETS_RV_DISPLAY_PRODUCT_INFO|intval > 0}
|
|
<div class="row modal_body_infor">
|
|
<div class="col-md-2 col-sm-2 modal_product_img">
|
|
{if isset($product_modal) && $product_modal}
|
|
{if isset($product_modal->flags)}
|
|
{block name='product_flags'}
|
|
<ul class="product-flags">
|
|
{foreach from=$product_modal->flags item=flag}
|
|
<li class="product-flag {$flag.type|escape:'html':'UTF-8'}">{$flag.label|escape:'html':'UTF-8'}</li>
|
|
{/foreach}
|
|
</ul>
|
|
{/block}
|
|
{/if}
|
|
{block name='product_cover'}
|
|
<div class="product-cover">
|
|
{if !empty($product_modal->image)}
|
|
<img class="js-qv-product-cover" src="{$product_modal->image->url nofilter}" alt="{$product_modal->image->legend|escape:'html':'UTF-8'}" title="{$product_modal->image->legend|escape:'html':'UTF-8'}" style="width:100%;" itemprop="image">
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
{/if}
|
|
</div>
|
|
<div class="col-md-10 col-sm-10 modal_product_info">
|
|
<h4>{$product_modal->name|escape:'html':'UTF-8'}</h4>
|
|
{block name='product_description_short'}
|
|
<div itemprop="description">{$product_modal->description_short nofilter}</div>
|
|
{/block}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
<div class="row">
|
|
{if !$logged}
|
|
<div class="col-md-6 col-sm-6 col-xs-12">
|
|
<label class="form-label" for="customer_name">{l s='Your name' mod='ets_reviews'}<sup class="required">*</sup></label>
|
|
<input name="customer_name" type="text" value=""/>
|
|
<p class="desc_error">{l s='Your name is required' mod='ets_reviews'}</p>
|
|
</div>
|
|
<div class="col-md-6 col-sm-6 col-xs-12">
|
|
<label class="form-label" for="email">{l s='Email' mod='ets_reviews'}<sup class="required">*</sup></label>
|
|
<input name="email" type="text" value=""/>
|
|
<p class="desc_error">{l s='Your email is required' mod='ets_reviews'}</p>
|
|
</div>
|
|
{/if}
|
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
|
<label class="form-label" for="comment_title">{l s='Title' mod='ets_reviews'}{if $ETS_RV_REQUIRE_TITLE}<sup class="required">*</sup>{/if}</label>
|
|
<input name="comment_title" type="text" value="" placeholder="{l s='Enter the title of your review' mod='ets_reviews'}"/>
|
|
{if $ETS_RV_REQUIRE_TITLE}<p class="desc_error">{l s='Title is required' mod='ets_reviews'}</p>{/if}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
|
<label class="form-label" for="comment_content">{l s='Content' mod='ets_reviews'}<sup class="required">*</sup></label>
|
|
<textarea name="comment_content" placeholder="{l s='Enter your review about this product here' mod='ets_reviews'}"></textarea>
|
|
<p class="desc_error">{l s='Review content is required' mod='ets_reviews'}</p>
|
|
</div>
|
|
</div>
|
|
{if $criterions|@count > 0}
|
|
<div class="row ets-pc-criterion{if !(!$logged && $ETS_RV_ALLOW_GUESTS && $ETS_RV_ALLOW_GUESTS_RATE || $logged && ($ETS_RV_PURCHASED_PRODUCT && $ETS_RV_PURCHASED_PRODUCT_RATE && $purchased || !$purchased && (!$freeDownload && $ETS_RV_CUSTOMER && $ETS_RV_CUSTOMER_RATE || $freeDownload && ($ETS_RV_CUSTOMER_INCL && $ETS_RV_CUSTOMER_RATE_INCL || $ETS_RV_CUSTOMER_EXCL && $ETS_RV_CUSTOMER_RATE_EXCL))))} disabled{/if}{if $allowRating} active{/if}">
|
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
|
<label class="form-label" for="criterion">{l s='Rate this product' mod='ets_reviews'}<sup class="required">*</sup></label>
|
|
<table id="criterions_list" data-number-of-rating="{$nbRated|intval}" data-maximum-rating="{$maximumRating|intval}">
|
|
{foreach from=$criterions item='criterion'}
|
|
<tr class="criterion-item criterion-rating">
|
|
<td>
|
|
<label style="font-weight: normal;margin-bottom: 0;">{$criterion.name|escape:'html':'UTF-8'}</label>
|
|
</td>
|
|
<td>
|
|
<div class="criterion-rating">
|
|
<div class="ets-rv-grade-stars"
|
|
data-grade="{if isset($ETS_RV_DEFAULT_RATE)}{$ETS_RV_DEFAULT_RATE|intval}{else}0{/if}"
|
|
data-input="criterion[{$criterion.id_ets_rv_product_comment_criterion|intval}]">
|
|
</div>
|
|
</div>
|
|
<p class="desc_error">{l s='%s is required' sprintf=[$criterion.name|ucfirst] mod='ets_reviews'}</p>
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
<tr class="criterion-item template">
|
|
<td>
|
|
<label style="font-weight: normal;margin-bottom: 0;"></label>
|
|
</td>
|
|
<td>
|
|
<div class="criterion-rating">
|
|
<div class="ets-rv-grade-stars" data-grade="0" data-input="criterion[0]"></div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{(Module::getInstanceByName('ets_reviews')->renderUploadImage()) nofilter}
|
|
<div class="row">
|
|
{(Module::getInstanceByName('ets_reviews')->hookRenderReCaptcha(['reCaptchaFor'=>'review', 'class'=>'col-md-12 col-sm-12 col-xs-12'])) nofilter}
|
|
</div>
|
|
</div>
|
|
<div class="ets-rv-post_content_footer_modal">
|
|
<div class="col-md-12 col-sm-12 col-xs-12 post-comment-buttons">
|
|
<button type="button" class="btn btn-primary ets-rv-btn-comment-inverse cancel_button ets-rv-btn-comment-big ets_button_gray" data-dismiss="ets-rv-modal" aria-label="{l s='Cancel' mod='ets_reviews'}">
|
|
{l s='Cancel' mod='ets_reviews'}
|
|
</button>
|
|
<button type="submit" class="btn ets-rv-btn-comment ets-rv-btn-comment-big{if !empty($ETS_RV_DESIGN_COLOR2)} background2{/if}{if !empty($ETS_RV_DESIGN_COLOR3)} bg_hover3 bd_hover3{/if}"
|
|
data-add-title="{l s='Submit review' mod='ets_reviews'}"
|
|
data-edit-title="{l s='Save' mod='ets_reviews'}">
|
|
<span class="title">{l s='Submit review' mod='ets_reviews'}</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{if isset($id_order) && $id_order|intval > 0}
|
|
<input type="hidden" name="id_order" value="{$id_order|intval}">
|
|
{/if}
|
|
<input type="hidden" name="id_product_comment" value="0">
|
|
</form>
|
|
{if $maximum_review_per_user|trim !== ''}
|
|
<div class="ets_rv_review_error{if $review_allowed} hide{/if}">
|
|
<div class="ets-rv-modal-header">
|
|
<h3>
|
|
<svg width="16" height="16" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 960v-128q0-26-19-45t-45-19h-256v-256q0-26-19-45t-45-19h-128q-26 0-45 19t-19 45v256h-256q-26 0-45 19t-19 45v128q0 26 19 45t45 19h256v256q0 26 19 45t45 19h128q26 0 45-19t19-45v-256h256q26 0 45-19t19-45zm320-64q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"/></svg>
|
|
{l s='Write your review' mod='ets_reviews'}
|
|
</h3>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
<p class="alert alert-warning">{l s='You are only allowed to leave %d review(s) for this product' sprintf=[$maximum_review_per_user|intval] mod='ets_reviews'}</p>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{if !$ETS_RV_ALLOW_GUESTS && !(!$freeDownload && $ETS_RV_CUSTOMER || $freeDownload && ($ETS_RV_CUSTOMER_INCL || $ETS_RV_CUSTOMER_EXCL)) && !$ETS_RV_PURCHASED_PRODUCT}
|
|
<div class="ets_rv_reviews_modal">
|
|
<div class="ets_rv_post_allowed">
|
|
<div class="ets-rv-modal-header">
|
|
<h2>{l s='Review status is not selected' mod='ets_reviews'}</h2>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
<p class="alert alert-warning text-center">{l s='You are not allowed to post reviews at the moment. Please contact the store admin for more details.' mod='ets_reviews'}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{elseif !$logged && !$ETS_RV_ALLOW_GUESTS && (!$freeDownload && $ETS_RV_CUSTOMER || $freeDownload && ($ETS_RV_CUSTOMER_INCL || $ETS_RV_CUSTOMER_EXCL) || $ETS_RV_PURCHASED_PRODUCT)}
|
|
<div class="ets_rv_login">
|
|
<div class="ets-rv-modal-header">
|
|
<h2> </h2>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
<p>{l s='Please sign in or register to write your review.' mod='ets_reviews'}</p>
|
|
<a class="btn btn-default btn-primary login" href="{$link->getPageLink('authentication') nofilter}?back={$currentUrl nofilter}"><i><svg width="14" height="14" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1536 1399q0 109-62.5 187t-150.5 78h-854q-88 0-150.5-78t-62.5-187q0-85 8.5-160.5t31.5-152 58.5-131 94-89 134.5-34.5q131 128 313 128t313-128q76 0 134.5 34.5t94 89 58.5 131 31.5 152 8.5 160.5zm-256-887q0 159-112.5 271.5t-271.5 112.5-271.5-112.5-112.5-271.5 112.5-271.5 271.5-112.5 271.5 112.5 112.5 271.5z"/></svg></i> {l s='Sign in' mod='ets_reviews'}</a>
|
|
<a class="btn btn-default btn-primary create_account" href="{$link->getPageLink('authentication') nofilter}?create_account=1&back={$currentUrl nofilter}"><svg width="16" height="14" viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M704 896q-159 0-271.5-112.5t-112.5-271.5 112.5-271.5 271.5-112.5 271.5 112.5 112.5 271.5-112.5 271.5-271.5 112.5zm960 128h352q13 0 22.5 9.5t9.5 22.5v192q0 13-9.5 22.5t-22.5 9.5h-352v352q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-352h-352q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h352v-352q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5v352zm-736 224q0 52 38 90t90 38h256v238q-68 50-171 50h-874q-121 0-194-69t-73-190q0-53 3.5-103.5t14-109 26.5-108.5 43-97.5 62-81 85.5-53.5 111.5-20q19 0 39 17 79 61 154.5 91.5t164.5 30.5 164.5-30.5 154.5-91.5q20-17 39-17 132 0 217 96h-223q-52 0-90 38t-38 90v192z"/></svg> {l s='Create account' mod='ets_reviews'}</a>
|
|
</div>
|
|
</div>
|
|
{elseif $logged && $is_block_customer}
|
|
<div class="ets_rv_is_block">
|
|
<div class="ets-rv-modal-header">
|
|
<h2><i class="ets_svg_fill_gray lh_22">
|
|
<svg width="20" height="20" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1024 1375v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z"/></svg>
|
|
</i> {l s='Review status' mod='ets_reviews'}</h2>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
<p class="alert alert-warning">{l s='Your account was blocked and not allowed to write a review' mod='ets_reviews'}</p>
|
|
</div>
|
|
</div>
|
|
{elseif $logged && !((!$purchased || $freeDownload && $productPrice <= 0) && (!$freeDownload && $ETS_RV_CUSTOMER || $freeDownload && ($ETS_RV_CUSTOMER_INCL && $productPrice <= 0 || $ETS_RV_CUSTOMER_EXCL && $productPrice > 0)) || $ETS_RV_PURCHASED_PRODUCT && $purchasedTime)}
|
|
<div class="ets_rv_purchase_product">
|
|
<div class="ets-rv-modal-header">
|
|
<h2><i class="ets_svg_fill_gray lh_22">
|
|
<svg width="20" height="20" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1024 1375v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z"/></svg>
|
|
</i> {l s='Review status' mod='ets_reviews'}</h2>
|
|
<button type="button" class="close" data-dismiss="ets-rv-modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="ets-rv-modal-body">
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12" id="ets-rv-product-comment-posted-modal-message">
|
|
{if $ETS_RV_ALLOW_GUESTS && !(!$freeDownload && $ETS_RV_CUSTOMER || $freeDownload && ($ETS_RV_CUSTOMER_INCL || $ETS_RV_CUSTOMER_EXCL)) && !$ETS_RV_PURCHASED_PRODUCT}
|
|
{*4*}{l s='Only guest user can write review' mod='ets_reviews'}
|
|
{elseif $ETS_RV_PURCHASED_PRODUCT && !$purchased && $orderNotValid}
|
|
{l s='Your order is waiting to be verified by the store admin. You have not been able to write a review or rate this product yet.' mod='ets_reviews'}
|
|
{elseif $freeDownload && $productPrice > 0 && !$purchased && $ETS_RV_PURCHASED_PRODUCT || !$freeDownload && $ETS_RV_PURCHASED_PRODUCT && !$purchased}
|
|
{*6*}{l s='You can only leave a review after purchasing this product' mod='ets_reviews'}
|
|
{elseif $freeDownload && !$purchasedTime && $productPrice > 0 && $ETS_RV_PURCHASED_PRODUCT || !$freeDownload && $ETS_RV_PURCHASED_PRODUCT && !$purchasedTime}
|
|
{*8*}{l s='You have exceeded the available time to write a review for this product' mod='ets_reviews'}
|
|
{elseif $freeDownload && !$purchased && $productPrice <= 0 && ($ETS_RV_PURCHASED_PRODUCT || $ETS_RV_CUSTOMER_EXCL)}
|
|
{*1*}{l s='Cannot write review for free product' mod='ets_reviews'}
|
|
{elseif $freeDownload && $purchased && $productPrice > 0 && $ETS_RV_CUSTOMER_EXCL || !$freeDownload && $ETS_RV_CUSTOMER && $purchased}
|
|
{*3*}{l s='Only user who has not purchased can write review.' mod='ets_reviews'}
|
|
{elseif $freeDownload && $ETS_RV_CUSTOMER_INCL && $productPrice > 0}
|
|
{*2*}{l s='Cannot write review for paid product' mod='ets_reviews'}
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ets-rv-modal-footer">
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12 post-comment-buttons button_center">
|
|
<button type="button" class="btn ets-rv-btn-comment ets-rv-btn-comment-huge button_ok_waiting ets_button_gray" data-dismiss="ets-rv-modal" aria-label="OK">
|
|
{l s='OK' mod='ets_reviews'}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{* Comment posted modal *}
|
|
{if !$moderation_active}
|
|
{assign var='comment_posted_message' value="{l s='Your review has been submitted and will be published once approved by a store admin.' mod='ets_reviews'}"}
|
|
{else}
|
|
{assign var='comment_posted_message' value="{l s='Your review has been added!' mod='ets_reviews'}"}
|
|
{/if}
|
|
{if isset($comment_posted_message)}
|
|
{include file='./alert-modal.tpl'
|
|
modal_id='ets-rv-product-comment-posted-modal'
|
|
modal_title="{l s='Review submitted' mod='ets_reviews'}"
|
|
modal_message=$comment_posted_message
|
|
}
|
|
{/if}
|
|
|
|
{* Comment post error modal *}
|
|
{include file='./alert-modal.tpl'
|
|
modal_id='ets-rv-product-comment-post-error'
|
|
modal_title="{l s='Your review cannot be submitted' mod='ets_reviews'}"
|
|
icon='error'
|
|
}
|