2016-01-04 12:48:08 +01:00
{ *
* 2007-2011 PrestaShop
*
* 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-2011 PrestaShop SA
* @version Release: $Revision: 8084 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{ capture name = path } <a href=" { $link - > getPageLink ( 'my-account.php' , true ) } "> { l s = 'My account' } </a><span class="navigation-pipe"> { $navigationPipe } </span> { l s = 'My loyalty points' mod = 'loyalty' } { /capture }
{ include file = "$tpl_dir./breadcrumb.tpl" }
<h1 class="title"><span> { l s = 'My loyalty points' mod = 'loyalty' } </span></h1>
2016-04-21 17:41:04 +02:00
{ if $displayorders }
<div class="block-center" id="block-history">
{ if $displayorders & & count ( $displayorders ) }
2016-01-04 12:48:08 +01:00
<table id="order-list" class="std">
<thead>
<tr>
<th class="first_item"> { l s = 'Order' mod = 'loyalty' } </th>
<th class="item"> { l s = 'Date' mod = 'loyalty' } </th>
2016-04-21 17:41:04 +02:00
<th class="item"> { l s = 'Discount' mod = 'loyalty' } </th>
2016-01-04 12:48:08 +01:00
<th class="last_item"> { l s = 'Points Status' mod = 'loyalty' } </th>
</tr>
</thead>
2016-04-25 16:04:51 +02:00
{ * < tfoot >
2016-01-04 12:48:08 +01:00
<tr class="alternate_item">
2016-04-21 17:41:04 +02:00
<td colspan="2" class="history_method bold" style="text-align:right;"> { l s = 'Total discount available:' mod = 'loyalty' } </td>
<td class="history_method" style="text-align:left;"><span class='total-discount-loyalty'> { Tools : : displayPrice ( $voucher ) } </span></td>
2016-01-04 12:48:08 +01:00
<td class="history_method"> </td>
</tr>
2016-04-25 16:04:51 +02:00
</tfoot>*}
2016-01-04 12:48:08 +01:00
<tbody>
2016-04-25 12:45:13 +02:00
{ foreach from = $displayorders item = 'order' name = orders }
2016-04-21 17:41:04 +02:00
{ if $order.id_loyalty_state = = 3 }
{ continue }
{ /if }
2016-04-25 12:45:13 +02:00
<tr class="alternate_item { if $smarty.foreach.orders.index % 2 = = 0 } odd { else } even { /if } " >
2016-01-04 12:48:08 +01:00
<td class="history_link bold"> { l s = '#' mod = 'loyalty' } { $order.id | string_format : "%06d" } </td>
2016-04-21 17:41:04 +02:00
<td class="history_date"> { dateFormat date = $order.date } </td>
2016-04-22 16:30:18 +02:00
<td class="history_method"> { Tools : : displayPrice ( $order.discount_value ) } </td>
2016-01-04 12:48:08 +01:00
<td class="history_method"> { $order.state | escape : 'htmlall' : 'UTF-8' } </td>
</tr>
{ /foreach }
</tbody>
</table>
<div id="block-order-detail" class="hidden"> </div>
2016-04-25 16:04:51 +02:00
<p class='total-discount'> { l s = 'Total discount available: ' mod = 'loyalty' } <span class='total-discount-loyalty'> { Tools : : displayPrice ( $voucher ) } </span></p>
2016-01-04 12:48:08 +01:00
{ else }
<p class="warning"> { l s = 'You have not placed any orders.' } </p>
{ /if }
</div>
<div id="pagination" class="pagination">
2016-04-21 17:41:04 +02:00
{ if $nbpagination < $displayorders | @ count }
2016-01-04 12:48:08 +01:00
<ul class="pagination">
{ if $page ! = 1 }
{ assign var = 'p_previous' value = $page - 1 }
<li id="pagination_previous"><a href=" { $pagination_link } ?p= { $p_previous } &n= { $nbpagination } ">
2016-04-25 12:45:13 +02:00
« </a></li>
2016-01-04 12:48:08 +01:00
{ else }
2016-04-25 12:45:13 +02:00
<li id="pagination_previous" class="disabled"><span>« </span></li>
2016-01-04 12:48:08 +01:00
{ /if }
{ if $page > 2 }
<li><a href=" { $pagination_link } ?p=1&n= { $nbpagination } ">1</a></li>
{ if $page > 3 }
<li class="truncate">...</li>
{ /if }
{ /if }
{ section name = pagination start = $page - 1 loop = $page + 2 step = 1 }
{ if $page = = $smarty.section.pagination.index }
<li class="current"><span> { $page | escape : 'htmlall' : 'UTF-8' } </span></li>
{ elseif $smarty.section.pagination.index > 0 & & $orders | @ count + $nbpagination > ( $smarty.section.pagination.index ) * ( $nbpagination ) }
<li><a href=" { $pagination_link } ?p= { $smarty.section.pagination.index } &n= { $nbpagination } "> { $smarty.section.pagination.index | escape : 'htmlall' : 'UTF-8' } </a></li>
{ /if }
{ /section }
{ if $max_page - $page > 1 }
{ if $max_page - $page > 2 }
<li class="truncate">...</li>
{ /if }
<li><a href=" { $pagination_link } ?p= { $max_page } &n= { $nbpagination } "> { $max_page } </a></li>
{ /if }
2016-04-21 17:41:04 +02:00
{ if $displayorders | @ count > $page * $nbpagination }
2016-01-04 12:48:08 +01:00
{ assign var = 'p_next' value = $page + 1 }
2016-04-25 12:45:13 +02:00
<li id="pagination_next"><a href=" { $pagination_link } ?p= { $p_next } &n= { $nbpagination } "> »</a></li>
2016-01-04 12:48:08 +01:00
{ else }
2016-04-25 12:45:13 +02:00
<li id="pagination_next" class="disabled"><span> »</span></li>
2016-01-04 12:48:08 +01:00
{ /if }
</ul>
{ /if }
2016-04-21 17:41:04 +02:00
{ if $displayorders | @ count > 1 0 }
2016-01-04 12:48:08 +01:00
<form action=" { $pagination_link } " method="get" class="pagination">
<p>
<input type="submit" class="button_mini" value=" { l s = 'OK' } " />
<label for="nb_item"> { l s = 'items:' mod = 'loyalty' } </label>
<select name="n" id="nb_item">
{ foreach from = $nArray item = nValue }
2016-04-21 17:41:04 +02:00
{ if $nValue < = $displayorders | @ count }
2016-01-04 12:48:08 +01:00
<option value=" { $nValue | escape : 'htmlall' : 'UTF-8' } " { if $nbpagination = = $nValue } selected="selected" { /if } > { $nValue | escape : 'htmlall' : 'UTF-8' } </option>
{ /if }
{ /foreach }
</select>
<input type="hidden" name="p" value="1" />
</p>
</form>
{ /if }
</div>
<br />
{ if $transformation_allowed }
<p style="text-align:center; margin-top:20px">
2016-04-21 17:41:04 +02:00
<a class="exclusive loyalty-transform" href=" { $base_dir } modules/loyalty/loyalty-program.php?transform-points=true" onclick="return confirm(' { l s = 'Are you sure you want to transform your discounts into vouchers?' mod = 'loyalty' js = 1 } ');"> { l s = 'Transform into voucher of' mod = 'loyalty' } <span class="price"> { convertPrice price = $voucher } </span>.</a>
2016-01-04 12:48:08 +01:00
</p>
{ /if }
<br />
<h2 class="title"><span> { l s = 'My vouchers from loyalty points' mod = 'loyalty' } </span></h2>
{ if $nbDiscounts }
<div class="block-center" id="block-history">
<table id="order-list" class="std">
<thead>
<tr>
<!-- <th class="first_item"> { l s = 'Created' mod = 'loyalty' } </th> -->
<th class="item"> { l s = 'Value' mod = 'loyalty' } <br /> { l s = 'Code' mod = 'loyalty' } </th>
<th class="item"> { l s = 'Valid from' mod = 'loyalty' } <br /> { l s = 'Valid until' mod = 'loyalty' } </th>
<th class="item"> { l s = 'Status' mod = 'loyalty' } </th>
<th class="last_item"> { l s = 'Details' mod = 'loyalty' } </th>
</tr>
</thead>
<tbody>
{ foreach from = $discounts item = discount name = myLoop }
<tr class="alternate_item">
<!-- <td class="history_date"> { dateFormat date = $discount - > date_add } </td> -->
<td class="history_price"><span class="price"> { if $discount - > id_discount_type = = 1 }
{ $discount - > value } %
{ elseif $discount - > id_discount_type = = 2 }
{ displayPrice price = $discount - > value currency = $discount - > id_currency }
{ else }
{ l s = 'Free shipping' mod = 'loyalty' }
{ /if } </span>
<br/>
{ $discount - > name }
</td>
<td class="history_date"> { dateFormat date = $discount - > date_from }
<br /> { dateFormat date = $discount - > date_to }
</td>
<td class="history_method bold"> { if $discount - > quantity > 0 } { l s = 'To use' mod = 'loyalty' } { else } { l s = 'Used' mod = 'loyalty' } { /if } </td>
2016-04-21 17:41:04 +02:00
<td class="history_method"><a href=" { $smarty.server.SCRIPT_NAME } " onclick="return false" class="tips" title=" { l s = 'Generated by these following orders' mod = 'loyalty' } | { foreach from = $discount - > orders item = myorder name = myLoop } { l s = 'Order #' mod = 'loyalty' } { $myorder.id_order } ( { displayPrice price = $myorder.total_paid currency = $myorder.id_currency } ) : { if $myorder.discount_value > 0 } { displayPrice price = $myorder.discount_value currency = $myorder.id_currency } { else } { l s = 'Cancelled' mod = 'loyalty' } { /if } { if ! $smarty.foreach.myLoop.last } | { /if } { /foreach } "> { l s = 'more...' mod = 'loyalty' } </a></td>
2016-01-04 12:48:08 +01:00
</tr>
{ /foreach }
</tbody>
</table>
<div id="block-order-detail" class="hidden"> </div>
</div>
{ if $minimalLoyalty > 0 } <p> { l s = 'The minimum order amount in order to use these vouchers is:' } { convertPrice price = $minimalLoyalty } </p> { /if }
<script type="text/javascript">
{ literal }
$(document).ready(function()
{
$('a.tips').cluetip( {
showTitle: false,
splitTitle: '|',
arrows: false,
fx: {
open: 'fadeIn',
openSpeed: 'fast'
}
});
});
{ /literal }
</script>
{ else }
<p class="warning"> { l s = 'No vouchers yet.' mod = 'loyalty' } </p>
{ /if }
{ else }
<p class="warning"> { l s = 'No reward points yet.' mod = 'loyalty' } </p>
{ /if }
<br />
2016-04-21 17:41:04 +02:00
<p class="footer_links" style="text-align:center;">
2016-01-04 12:48:08 +01:00
<a class="back_account" href=" { $link - > getPageLink ( 'my-account.php' , true ) } " class="button">
<i class="icon-user"></i><span> { l s = 'Back to my account' mod = 'loyalty' } </span>
</a>
</p>