PageRenderTime 24ms CodeModel.GetById 2ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/themes/default/product.tpl

https://bitbucket.org/marcenuc/prestashop
Smarty Template | 636 lines | 557 code | 40 blank | 39 comment | 100 complexity | 229c4519c561ea456e4b083e79819955 MD5 | raw file
  1{*
  2* 2007-2012 PrestaShop
  3*
  4* NOTICE OF LICENSE
  5*
  6* This source file is subject to the Academic Free License (AFL 3.0)
  7* that is bundled with this package in the file LICENSE.txt.
  8* It is also available through the world-wide-web at this URL:
  9* http://opensource.org/licenses/afl-3.0.php
 10* If you did not receive a copy of the license and are unable to
 11* obtain it through the world-wide-web, please send an email
 12* to license@prestashop.com so we can send you a copy immediately.
 13*
 14* DISCLAIMER
 15*
 16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 17* versions in the future. If you wish to customize PrestaShop for your
 18* needs please refer to http://www.prestashop.com for more information.
 19*
 20*  @author PrestaShop SA <contact@prestashop.com>
 21*  @copyright  2007-2012 PrestaShop SA
 22*  @version  Release: $Revision: 6625 $
 23*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 24*  International Registered Trademark & Property of PrestaShop SA
 25*}
 26
 27{include file="$tpl_dir./errors.tpl"}
 28{if $errors|@count == 0}
 29<script type="text/javascript">
 30// <![CDATA[
 31
 32// PrestaShop internal settings
 33var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
 34var currencyRate = '{$currencyRate|floatval}';
 35var currencyFormat = '{$currencyFormat|intval}';
 36var currencyBlank = '{$currencyBlank|intval}';
 37var taxRate = {$tax_rate|floatval};
 38var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if};
 39
 40//JS Hook
 41var oosHookJsCodeFunctions = new Array();
 42
 43// Parameters
 44var id_product = '{$product->id|intval}';
 45var productHasAttributes = {if isset($groups)}true{else}false{/if};
 46var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};
 47var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};
 48var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};
 49var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';
 50var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';
 51var productPriceTaxExcluded = {$product->getPriceWithoutReduct(true)|default:'null'} - {$product->ecotax};
 52var reduction_percent = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'percentage'}{$product->specificPrice.reduction*100}{else}0{/if};
 53var reduction_price = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'amount'}{$product->specificPrice.reduction|floatval}{else}0{/if};
 54var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
 55var product_specific_price = new Array();
 56{foreach from=$product->specificPrice key='key_specific_price' item='specific_price_value'}
 57	product_specific_price['{$key_specific_price}'] = '{$specific_price_value}';
 58{/foreach}
 59var specific_currency = {if $product->specificPrice AND $product->specificPrice.id_currency}true{else}false{/if};
 60var group_reduction = '{$group_reduction}';
 61var default_eco_tax = {$product->ecotax};
 62var ecotaxTax_rate = {$ecotaxTax_rate};
 63var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}';
 64var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};
 65var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};
 66var displayPrice = {$priceDisplay};
 67var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';
 68var productAvailableForOrder = {if (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}'0'{else}'{$product->available_for_order}'{/if};
 69var productShowPrice = '{if !$PS_CATALOG_MODE}{$product->show_price}{else}0{/if}';
 70var productUnitPriceRatio = '{$product->unit_price_ratio}';
 71var idDefaultImage = {if isset($cover.id_image_only)}{$cover.id_image_only}{else}0{/if};
 72var stock_management = {$stock_management|intval};
 73{if !isset($priceDisplayPrecision)}
 74	{assign var='priceDisplayPrecision' value=2}
 75{/if}
 76{if !$priceDisplay || $priceDisplay == 2}
 77	{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
 78	{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
 79{elseif $priceDisplay == 1}
 80	{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
 81	{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
 82{/if}
 83
 84var productPriceWithoutRedution = '{$productPriceWithoutRedution}';
 85var productPrice = '{$productPrice}';
 86
 87// Customizable field
 88var img_ps_dir = '{$img_ps_dir}';
 89var customizationFields = new Array();
 90{assign var='imgIndex' value=0}
 91{assign var='textFieldIndex' value=0}
 92{foreach from=$customizationFields item='field' name='customizationFields'}
 93	{assign var="key" value="pictures_`$product->id`_`$field.id_customization_field`"}
 94	customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();
 95	customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';
 96	customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 && isset($pictures.$key) && $pictures.$key}2{else}{$field.required|intval}{/if};
 97{/foreach}
 98
 99// Images
100var img_prod_dir = '{$img_prod_dir}';
101var combinationImages = new Array();
102
103{if isset($combinationImages)}
104	{foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'}
105		combinationImages[{$combinationId}] = new Array();
106		{foreach from=$combination item='image' name='f_combinationImage'}
107			combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};
108		{/foreach}
109	{/foreach}
110{/if}
111
112combinationImages[0] = new Array();
113{if isset($images)}
114	{foreach from=$images item='image' name='f_defaultImages'}
115		combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};
116	{/foreach}
117{/if}
118
119// Translations
120var doesntExist = '{l s='This combination does not exist for this product. Please choose another.' js=1}';
121var doesntExistNoMore = '{l s='This product is no longer in stock' js=1}';
122var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}';
123var uploading_in_progress = '{l s='Uploading in progress, please wait...' js=1}';
124var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' js=1}';
125{if isset($groups)}
126	// Combinations
127	{foreach from=$combinations key=idCombination item=combination}
128		var specific_price_combination = new Array();
129		specific_price_combination['reduction_percent'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'percentage'}{$combination.specific_price.reduction*100}{else}0{/if};
130		specific_price_combination['reduction_price'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'amount'}{$combination.specific_price.reduction}{else}0{/if};
131		specific_price_combination['price'] = {if $combination.specific_price AND $combination.specific_price.price}{$combination.specific_price.price}{else}0{/if};
132		specific_price_combination['reduction_type'] = '{if $combination.specific_price}{$combination.specific_price.reduction_type}{/if}';
133		addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, '{$combination.available_date}', specific_price_combination);
134	{/foreach}
135{/if}
136
137{if isset($attributesCombinations)}
138	// Combinations attributes informations
139	var attributesCombinations = new Array();
140	{foreach from=$attributesCombinations key=id item=aC}
141		tabInfos = new Array();
142		tabInfos['id_attribute'] = '{$aC.id_attribute|intval}';
143		tabInfos['attribute'] = '{$aC.attribute}';
144		tabInfos['group'] = '{$aC.group}';
145		tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}';
146		attributesCombinations.push(tabInfos);
147	{/foreach}
148{/if}
149//]]>
150</script>
151
152{include file="$tpl_dir./breadcrumb.tpl"}
153<div id="primary_block" class="clearfix">
154
155	{if isset($adminActionDisplay) && $adminActionDisplay}
156	<div id="admin-action">
157		<p>{l s='This product is not visible to your customers.'}
158		<input type="hidden" id="admin-action-product-id" value="{$product->id}" />
159		<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 0, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
160		<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 1, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
161		</p>
162		<p id="admin-action-result"></p>
163		</p>
164	</div>
165	{/if}
166
167	{if isset($confirmation) && $confirmation}
168	<p class="confirmation">
169		{$confirmation}
170	</p>
171	{/if}
172
173	<!-- right infos-->
174	<div id="pb-right-column">
175		<!-- product img-->
176		<div id="image-block">
177		{if $have_image}
178			<span id="view_full_size">
179				<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}" />
180				<span class="span_link">{l s='View full size'}</span>
181			</span>
182		{else}
183			<span id="view_full_size">
184				<img src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" />
185				<span class="span_link">{l s='View full size'}</span>
186			</span>
187		{/if}
188		</div>
189		{if isset($images) && count($images) > 0}
190		<!-- thumbnails -->
191		<div id="views_block" class="clearfix {if isset($images) && count($images) < 2}hidden{/if}">
192		{if isset($images) && count($images) > 3}<span class="view_scroll_spacer"><a id="view_scroll_left" class="hidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a></span>{/if}
193		<div id="thumbs_list">
194			<ul id="thumbs_list_frame">
195				{if isset($images)}
196					{foreach from=$images item=image name=thumbnails}
197					{assign var=imageIds value="`$product->id`-`$image.id_image`"}
198					<li id="thumbnail_{$image.id_image}">
199						<a href="{$link->getImageLink($product->link_rewrite, $imageIds, thickbox_default)}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">
200							<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
201						</a>
202					</li>
203					{/foreach}
204				{/if}
205			</ul>
206		</div>
207		{if isset($images) && count($images) > 3}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Next'}</a>{/if}
208		</div>
209		{/if}
210		{if isset($images) && count($images) > 1}<p class="resetimg clear"><span id="wrapResetImages" style="display: none;"><img src="{$img_dir}icon/cancel_11x13.gif" alt="{l s='Cancel'}" width="11" height="13"/> <a id="resetImages" href="{$link->getProductLink($product)}" onclick="$('span#wrapResetImages').hide('slow');return (false);">{l s='Display all pictures'}</a></span></p>{/if}
211		<!-- usefull links-->
212		<ul id="usefull_link_block">
213			{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
214			<li class="print"><a href="javascript:print();">{l s='Print'}</a></li>
215			{if $have_image && !$jqZoomEnabled}
216			{/if}
217		</ul>
218	</div>
219
220	<!-- left infos-->
221	<div id="pb-left-column">
222		<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>
223
224		{if $product->description_short OR $packItems|@count > 0}
225		<div id="short_description_block">
226			{if $product->description_short}
227				<div id="short_description_content" class="rte align_justify">{$product->description_short}</div>
228			{/if}
229			{if $product->description}
230			<p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p>
231			{/if}
232			{if $packItems|@count > 0}
233			<div class="short_description_pack">
234				<h3>{l s='Pack content'}</h3>
235				{foreach from=$packItems item=packItem}
236				<div class="pack_content">
237					{$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a>
238					<p>{$packItem.description_short}</p>
239				</div>
240				{/foreach}
241			</div>
242			{/if}
243		</div>
244		{/if}
245
246		{*{if isset($colors) && $colors}
247		<!-- colors -->
248		<div id="color_picker">
249			<p>{l s='Pick a color:' js=1}</p>
250			<div class="clear"></div>
251			<ul id="color_to_pick_list" class="clearfix">
252			{foreach from=$colors key='id_attribute' item='color'}
253				<li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#wrapResetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li>
254			{/foreach}
255			</ul>
256			<div class="clear"></div>
257		</div>
258		{/if}*}
259
260		{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
261		<!-- add to cart form-->
262		<form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post">
263
264			<!-- hidden datas -->
265			<p class="hidden">
266				<input type="hidden" name="token" value="{$static_token}" />
267				<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
268				<input type="hidden" name="add" value="1" />
269				<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
270			</p>
271
272			<div class="product_attributes">
273				{if isset($groups)}
274				<!-- attributes -->
275				<div id="attributes">
276				{foreach from=$groups key=id_attribute_group item=group}
277					{if $group.attributes|@count}
278						<fieldset class="attribute_fieldset">
279							<label class="attribute_label" for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
280							{assign var="groupName" value="group_$id_attribute_group"}
281							<div class="attribute_list">
282							{if ($group.group_type == 'select')}
283								<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
284									{foreach from=$group.attributes key=id_attribute item=group_attribute}
285										<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
286									{/foreach}
287								</select>
288							{elseif ($group.group_type == 'color')}
289								<ul id="color_to_pick_list" class="clearfix">
290									{assign var="default_colorpicker" value=""}
291									{foreach from=$group.attributes key=id_attribute item=group_attribute}
292									<li{if $group.default == $id_attribute} class="selected"{/if}>
293										<a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}">
294											{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
295												<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br>
296											{/if}
297										</a>
298									</li>
299									{if ($group.default == $id_attribute)}
300										{$default_colorpicker = $id_attribute}
301									{/if}
302									{/foreach}
303								</ul>
304								<input type="hidden" class="color_pick_hidden" name="{$groupName}" value="{$default_colorpicker}" />
305							{elseif ($group.group_type == 'radio')}
306								{foreach from=$group.attributes key=id_attribute item=group_attribute}
307									<input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}">
308									{$group_attribute|escape:'htmlall':'UTF-8'}<br/>
309								{/foreach}
310							{/if}
311							</div>
312						</fieldset>
313					{/if}
314				{/foreach}
315				</div>
316			{/if}
317			<p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}>
318				<label for="product_reference">{l s='Reference:'} </label>
319				<span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span>
320			</p>
321
322			<!-- quantity wanted -->
323			<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
324				<label>{l s='Quantity:'}</label>
325				<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
326			</p>
327
328			<!-- minimal quantity wanted -->
329			<p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
330				{l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'}
331			</p>
332			{if $product->minimal_quantity > 1}
333			<script type="text/javascript">
334				checkMinimalQuantity();
335			</script>
336			{/if}
337
338			<!-- availability -->
339			<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
340				<span id="availability_label">{l s='Availability:'}</span>
341				<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>
342				{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}
343				</span>
344			</p>
345
346			<!-- number of item in stock -->
347			{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
348			<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
349				<span id="quantityAvailable">{$product->quantity|intval}</span>
350				<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}</span>
351				<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>
352			</p>
353			{/if}
354
355			<!-- Out of stock hook -->
356			<p id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
357				{$HOOK_PRODUCT_OOS}
358			</p>
359
360			<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
361		</div>
362
363		<div class="content_prices clearfix">
364			<!-- prices -->
365			{if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
366
367			{if $product->online_only}
368			<p class="online_only">{l s='Online only'}</p>
369			{/if}
370
371			<div class="price">
372				{if !$priceDisplay || $priceDisplay == 2}
373					{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
374					{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
375				{elseif $priceDisplay == 1}
376					{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
377					{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
378				{/if}
379
380				<p class="our_price_display">
381				{if $priceDisplay >= 0 && $priceDisplay <= 2}
382					<span id="our_price_display">{convertPrice price=$productPrice}</span>
383					<!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
384						{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
385					{/if}-->
386				{/if}
387				</p>
388
389				{if $product->on_sale}
390					<img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
391					<span class="on_sale">{l s='On sale!'}</span>
392				{elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice}
393					<span class="discount">{l s='Reduced price!'}</span>
394				{/if}
395				{if $priceDisplay == 2}
396					<br />
397					<span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
398				{/if}
399			</div>
400			<p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p>
401			<p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' && $product->specificPrice.reduction|intval ==0} style="display:none"{/if}><span id="reduction_amount_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0}-{convertPrice price=$product->specificPrice.reduction|floatval}{/if}</span></p>
402			{if $product->specificPrice AND $product->specificPrice.reduction}
403				<p id="old_price"><span class="bold">
404				{if $priceDisplay >= 0 && $priceDisplay <= 2}
405					{if $productPriceWithoutRedution > $productPrice}
406						<span id="old_price_display">{convertPrice price=$productPriceWithoutRedution}</span>
407						<!-- {if $tax_enabled && $display_tax_label == 1}
408							{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
409						{/if} -->
410					{/if}
411				{/if}
412				</span>
413				</p>
414			{/if}
415			{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
416				<p class="pack_price">{l s='instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
417				<br class="clear" />
418			{/if}
419			{if $product->ecotax != 0}
420				<p class="price-ecotax">{l s='include'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='for green tax'}
421					{if $product->specificPrice AND $product->specificPrice.reduction}
422					<br />{l s='(not impacted by the discount)'}
423					{/if}
424				</p>
425			{/if}
426			{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
427				 {math equation="pprice / punit_price"  pprice=$productPrice  punit_price=$product->unit_price_ratio assign=unit_price}
428				<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}</p>
429			{/if}
430			{*close if for show price*}
431			{/if}
432			{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}
433				<span class="exclusive">
434					<span></span>
435					{l s='Add to cart'}
436				</span>
437			{else}
438				<p id="add_to_cart" class="buttons_bottom_block">
439					<span></span>
440					<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />
441				</p>
442			{/if}
443			{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
444
445			<div class="clear"></div>
446		</div>
447		</form>
448		{/if}
449		{if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
450	</div>
451</div>
452
453{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
454<!-- quantity discount -->
455<ul class="idTabs clearfix">
456	<li><a href="#discount" style="cursor: pointer" class="selected">{l s='Quantity discount'}</a></li>
457</ul>
458<div id="quantityDiscount">
459	<table class="std">
460        <thead>
461            <tr>
462                <th>{l s='product'}</th>
463                <th>{l s='from (qty)'}</th>
464                <th>{l s='discount'}</th>
465            </tr>
466        </thead>
467		<tbody>
468            {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
469            <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}">
470                <td>
471                    {if (isset($quantity_discount.attributes) && ($quantity_discount.attributes))}
472                        {$product->getProductName($quantity_discount.id_product, $quantity_discount.id_product_attribute)}
473                    {else}
474                        {$product->getProductName($quantity_discount.id_product)}
475                    {/if}
476                </td>
477                <td>{$quantity_discount.quantity|intval}</td>
478                <td>
479                    {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'}
480                       -{convertPrice price=$quantity_discount.real_value|floatval}
481                   {else}
482                       -{$quantity_discount.real_value|floatval}%
483                   {/if}
484                </td>
485            </tr>
486            {/foreach}
487        </tbody>
488	</table>
489</div>
490{/if}
491{if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if}
492
493<!-- description and features -->
494{if (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments) || isset($product) && $product->customizable}
495<div id="more_info_block" class="clear">
496	<ul id="more_info_tabs" class="idTabs idTabsShort clearfix">
497		{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if}
498		{if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if}
499		{if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if}
500		{if isset($accessories) AND $accessories}<li><a href="#idTab4">{l s='Accessories'}</a></li>{/if}
501		{if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if}
502		{$HOOK_PRODUCT_TAB}
503	</ul>
504	<div id="more_info_sheets" class="sheets align_justify">
505	{if isset($product) && $product->description}
506		<!-- full description -->
507		<div id="idTab1" class="rte">{$product->description}</div>
508	{/if}
509	{if isset($features) && $features}
510		<!-- product's features -->
511		<ul id="idTab2" class="bullet">
512		{foreach from=$features item=feature}
513            {if isset($feature.value)}
514			    <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
515            {/if}
516		{/foreach}
517		</ul>
518	{/if}
519	{if isset($attachments) && $attachments}
520		<ul id="idTab9" class="bullet">
521		{foreach from=$attachments item=attachment}
522			<li><a href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")}">{$attachment.name|escape:'htmlall':'UTF-8'}</a><br />{$attachment.description|escape:'htmlall':'UTF-8'}</li>
523		{/foreach}
524		</ul>
525	{/if}
526	{if isset($accessories) AND $accessories}
527		<!-- accessories -->
528		<ul id="idTab4" class="bullet">
529			<div class="block products_block accessories_block clearfix">
530				<div class="block_content">
531					<ul>
532					{foreach from=$accessories item=accessory name=accessories_list}
533						{if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
534							{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
535							<li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
536								<h5>
537									<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|escape:'htmlall':'UTF-8'}</a>
538									{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} - <span class="price">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</span>{/if}
539								</h5>
540								<div class="product_desc">
541									<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium_default')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /></a>
542									<div class="block_description">
543										<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='More'}" class="product_description">{$accessory.description_short|strip_tags|truncate:400:'...'}</a>
544									</div>
545									<div class="clear_product_desc">&nbsp;</div>
546								</div>
547								<p class="clearfix" style="margin-top:5px">
548									<a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
549									<a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart', true, NULL, "qty=1&amp;id_product={$accessory.id_product|intval}&amp;token={$static_token}&amp;add")}" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
550								</p>
551							</li>
552						{/if}
553					{/foreach}
554					</ul>
555				</div>
556			</div>
557		</ul>
558	{/if}
559
560	<!-- Customizable products -->
561	{if isset($product) && $product->customizable}
562		<div id="idTab10" class="bullet customization_block">
563			<form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm" class="clearfix">
564				<p class="infoCustomizable">
565					{l s='After saving your customized product, remember to add it to your cart.'}
566					{if $product->uploadable_files}<br />{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}
567				</p>
568				{if $product->uploadable_files|intval}
569				<div class="customizableProductsFile">
570					<h3>{l s='Pictures'}</h3>
571					<ul id="uploadable_files" class="clearfix">
572						{counter start=0 assign='customizationField'}
573						{foreach from=$customizationFields item='field' name='customizationFields'}
574							{if $field.type == 0}
575								<li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
576									{if isset($pictures.$key)}
577									<div class="customizationUploadBrowse">
578										<img src="{$pic_dir}{$pictures.$key}_small" alt="" />
579										<a href="{$link->getProductDeletePictureLink($product, $field.id_customization_field)}" title="{l s='Delete'}" >
580											<img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="customization_delete_icon" width="11" height="13" />
581										</a>
582									</div>
583									{/if}
584									<div class="customizationUploadBrowse">
585										<label class="customizationUploadBrowseDescription">{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}{if $field.required}<sup>*</sup>{/if}</label>
586										<input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />
587									</div>
588								</li>
589								{counter}
590							{/if}
591						{/foreach}
592					</ul>
593				</div>
594				{/if}
595				{if $product->text_fields|intval}
596				<div class="customizableProductsText">
597					<h3>{l s='Text'}</h3>
598					<ul id="text_fields">
599					{counter start=0 assign='customizationField'}
600					{foreach from=$customizationFields item='field' name='customizationFields'}
601						{if $field.type == 1}
602						<li class="customizationUploadLine{if $field.required} required{/if}">
603							<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
604							<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
605						</li>
606						{counter}
607						{/if}
608					{/foreach}
609					</ul>
610				</div>
611				{/if}
612				<p id="customizedDatas">
613					<input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
614					<input type="hidden" name="submitCustomizedDatas" value="1" />
615					<input type="button" class="button" value="{l s='Save'}" onclick="javascript:saveCustomization()" />
616					<span id="ajax-loader" style="display:none"><img src="{$img_ps_dir}loader.gif" alt="loader" /></span>
617				</p>
618			</form>
619			<p class="clear required"><sup>*</sup> {l s='required fields'}</p>
620		</div>
621	{/if}
622
623	{if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
624	</div>
625</div>
626{/if}
627
628{if isset($packItems) && $packItems|@count > 0}
629	<div id="blockpack">
630		<h2>{l s='Pack content'}</h2>
631		{include file="$tpl_dir./product-list.tpl" products=$packItems}
632	</div>
633{/if}
634
635{/if}
636