Guest User

Untitled

a guest
Sep 5th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.89 KB | None | 0 0
  1. {*
  2. * 2007-2016 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 [email protected] 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 <[email protected]>
  21. * @copyright 2007-2016 PrestaShop SA
  22. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  23. * International Registered Trademark & Property of PrestaShop SA
  24. *}
  25. {include file="$tpl_dir./errors.tpl"}
  26. {if $errors|@count == 0}
  27. {if !isset($priceDisplayPrecision)}
  28. {assign var='priceDisplayPrecision' value=2}
  29. {/if}
  30. {if !$priceDisplay || $priceDisplay == 2}
  31. {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, 6)}
  32. {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
  33. {elseif $priceDisplay == 1}
  34. {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, 6)}
  35. {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
  36. {/if}
  37. <div itemscope itemtype="https://schema.org/Product">
  38. <meta itemprop="url" content="{$link->getProductLink($product)}">
  39. <div class="primary_block row">
  40. {if !$content_only}
  41. <div class="container">
  42. <div class="top-hr"></div>
  43. </div>
  44. {/if}
  45. {if isset($adminActionDisplay) && $adminActionDisplay}
  46. <div id="admin-action" class="container">
  47. <p class="alert alert-info">{l s='This product is not visible to your customers.'}
  48. <input type="hidden" id="admin-action-product-id" value="{$product->id}" />
  49. <a id="publish_button" class="btn btn-default button button-small" href="#">
  50. <span>{l s='Publish'}</span>
  51. </a>
  52. <a id="lnk_view" class="btn btn-default button button-small" href="#">
  53. <span>{l s='Back'}</span>
  54. </a>
  55. </p>
  56. <p id="admin-action-result"></p>
  57. </div>
  58. {/if}
  59. {if isset($confirmation) && $confirmation}
  60. <p class="confirmation">
  61. {$confirmation}
  62. </p>
  63. {/if}
  64. <!-- left infos-->
  65. <div class="pb-left-column col-xs-12 col-sm-4 col-md-5">
  66. <!-- product img-->
  67. <div id="image-block" class="clearfix">
  68. {if $product->new}
  69. <span class="new-box">
  70. <span class="new-label">{l s='New'}</span>
  71. </span>
  72. {/if}
  73. {if $product->on_sale}
  74. <span class="sale-box no-print">
  75. <span class="sale-label">{l s='Sale!'}</span>
  76. </span>
  77. {elseif $product->specificPrice && $product->specificPrice.reduction && $productPriceWithoutReduction > $productPrice}
  78. <span class="discount">{l s='Reduced price!'}</span>
  79. {/if}
  80. {if $have_image}
  81. <span id="view_full_size">
  82. {if $jqZoomEnabled && $have_image && !$content_only}
  83. <a class="jqzoom" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" rel="gal1" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')|escape:'html':'UTF-8'}">
  84. <img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"/>
  85. </a>
  86. {else}
  87. <img id="bigpic" itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" width="{$largeSize.width}" height="{$largeSize.height}"/>
  88. {if !$content_only}
  89. <span class="span_link no-print">{l s='View larger'}</span>
  90. {/if}
  91. {/if}
  92. </span>
  93. {else}
  94. <span id="view_full_size">
  95. <img itemprop="image" src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'html':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}"/>
  96. {if !$content_only}
  97. <span class="span_link">
  98. {l s='View larger'}
  99. </span>
  100. {/if}
  101. </span>
  102. {/if}
  103. </div> <!-- end image-block -->
  104. {if isset($images) && count($images) > 0}
  105. <!-- thumbnails -->
  106. <div id="views_block" class="clearfix {if isset($images) && count($images) < 2}hidden{/if}">
  107. {if isset($images) && count($images) > 2}
  108. <span class="view_scroll_spacer">
  109. <a id="view_scroll_left" class="" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">
  110. {l s='Previous'}
  111. </a>
  112. </span>
  113. {/if}
  114. <div id="thumbs_list">
  115. <ul id="thumbs_list_frame">
  116. {if isset($images)}
  117. {foreach from=$images item=image name=thumbnails}
  118. {assign var=imageIds value="`$product->id`-`$image.id_image`"}
  119. {if !empty($image.legend)}
  120. {assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
  121. {else}
  122. {assign var=imageTitle value=$product->name|escape:'html':'UTF-8'}
  123. {/if}
  124. <li id="thumbnail_{$image.id_image}"{if $smarty.foreach.thumbnails.last} class="last"{/if}>
  125. <a{if $jqZoomEnabled && $have_image && !$content_only} href="javascript:void(0);" rel="{literal}{{/literal}gallery: 'gal1', smallimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'large_default')|escape:'html':'UTF-8'}',largeimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}'{literal}}{/literal}"{else} href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}" data-fancybox-group="other-views" class="fancybox{if $image.id_image == $cover.id_image} shown{/if}"{/if} title="{$imageTitle}">
  126. <img class="img-responsive" id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'cart_default')|escape:'html':'UTF-8'}" alt="{$imageTitle}" title="{$imageTitle}"{if isset($cartSize)} height="{$cartSize.height}" width="{$cartSize.width}"{/if} itemprop="image" />
  127. </a>
  128. </li>
  129. {/foreach}
  130. {/if}
  131. </ul>
  132. </div> <!-- end thumbs_list -->
  133. {if isset($images) && count($images) > 2}
  134. <a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">
  135. {l s='Next'}
  136. </a>
  137. {/if}
  138. </div> <!-- end views-block -->
  139. <!-- end thumbnails -->
  140. {/if}
  141. {if isset($images) && count($images) > 1}
  142. <p class="resetimg clear no-print">
  143. <span id="wrapResetImages" style="display: none;">
  144. <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" data-id="resetImages">
  145. <i class="icon-repeat"></i>
  146. {l s='Display all pictures'}
  147. </a>
  148. </span>
  149. </p>
  150. {/if}
  151. </div> <!-- end pb-left-column -->
  152. <!-- end left infos-->
  153. <!-- center infos -->
  154. <div class="pb-center-column col-xs-12 col-sm-4">
  155. {if $product->online_only}
  156. <p class="online_only">{l s='Online only'}</p>
  157. {/if}
  158. <h1 itemprop="name">{$product->name|escape:'html':'UTF-8'}</h1>
  159. <p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
  160. <label>{l s='Reference:'} </label>
  161. <span class="editable" itemprop="sku"{if !empty($product->reference) && $product->reference} content="{$product->reference}"{/if}>{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
  162. </p>
  163. {if !$product->is_virtual && $product->condition}
  164. <p id="product_condition">
  165. <label>{l s='Condition:'} </label>
  166. {if $product->condition == 'new'}
  167. <link itemprop="itemCondition" href="https://schema.org/NewCondition"/>
  168. <span class="editable">{l s='New product'}</span>
  169. {elseif $product->condition == 'used'}
  170. <link itemprop="itemCondition" href="https://schema.org/UsedCondition"/>
  171. <span class="editable">{l s='Used'}</span>
  172. {elseif $product->condition == 'refurbished'}
  173. <link itemprop="itemCondition" href="https://schema.org/RefurbishedCondition"/>
  174. <span class="editable">{l s='Refurbished'}</span>
  175. {/if}
  176. </p>
  177. {/if}
  178. {if $product->description_short || $packItems|@count > 0}
  179. <div id="short_description_block">
  180. {if $product->description_short}
  181. <div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description_short}</div>
  182. {/if}
  183.  
  184. {if $product->description}
  185. <p class="buttons_bottom_block">
  186. <a href="javascript:{ldelim}{rdelim}" class="button">
  187. {l s='More details'}
  188. </a>
  189. </p>
  190. {/if}
  191. <!--{if $packItems|@count > 0}
  192. <div class="short_description_pack">
  193. <h3>{l s='Pack content'}</h3>
  194. {foreach from=$packItems item=packItem}
  195.  
  196. <div class="pack_content">
  197. {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)|escape:'html':'UTF-8'}">{$packItem.name|escape:'html':'UTF-8'}</a>
  198. <p>{$packItem.description_short}</p>
  199. </div>
  200. {/foreach}
  201. </div>
  202. {/if}-->
  203. </div> <!-- end short_description_block -->
  204. {/if}
  205. {if ($display_qties == 1 && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
  206. <!-- number of item in stock -->
  207. <p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
  208. <span id="quantityAvailable">{$product->quantity|intval}</span>
  209. <span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item'}</span>
  210. <span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
  211. </p>
  212. {/if}
  213. <!-- availability or doesntExist -->
  214. <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
  215. {*<span id="availability_label">{l s='Availability:'}</span>*}
  216. <span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
  217. </p>
  218. {if $PS_STOCK_MANAGEMENT}
  219. {if !$product->is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}
  220. <p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties || $product->quantity <= 0) || $allow_oosp || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
  221. {/if}
  222. <p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
  223. <span id="availability_date_label">{l s='Availability date:'}</span>
  224. <span id="availability_date_value">{if Validate::isDate($product->available_date)}{dateFormat date=$product->available_date full=false}{/if}</span>
  225. </p>
  226. <!-- Out of stock hook -->
  227. <div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
  228. {$HOOK_PRODUCT_OOS}
  229. </div>
  230. {if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
  231. {if !$content_only}
  232. <!-- usefull links-->
  233. <ul id="usefull_link_block" class="clearfix no-print">
  234. {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
  235. <li class="print">
  236. <a href="javascript:print();">
  237. {l s='Print'}
  238. </a>
  239. </li>
  240. </ul>
  241. {/if}
  242. </div>
  243. <!-- end center infos-->
  244. <!-- pb-right-column-->
  245. <div class="pb-right-column col-xs-12 col-sm-4 col-md-3">
  246. {if ($product->show_price && !isset($restricted_country_mode)) || isset($groups) || $product->reference || (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
  247. <!-- add to cart form-->
  248. <form id="buy_block"{if $PS_CATALOG_MODE && !isset($groups) && $product->quantity > 0} class="hidden"{/if} action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}" method="post">
  249. <!-- hidden datas -->
  250. <p class="hidden">
  251. <input type="hidden" name="token" value="{$static_token}" />
  252. <input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
  253. <input type="hidden" name="add" value="1" />
  254. <input type="hidden" name="id_product_attribute" id="idCombination" value="" />
  255. </p>
  256. <div class="box-info-product">
  257. <div class="content_prices clearfix">
  258. {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
  259. <!-- prices -->
  260. <div>
  261. <p class="our_price_display" itemprop="offers" itemscope itemtype="https://schema.org/Offer">{strip}
  262. {if $product->quantity > 0}<link itemprop="availability" href="https://schema.org/InStock"/>{/if}
  263. {if $priceDisplay >= 0 && $priceDisplay <= 2}
  264. <span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span>
  265. {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
  266. {if $priceDisplay == 1} {l s='tax excl.'}{else} {l s='tax incl.'}{/if}
  267. {/if}
  268. <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
  269. {hook h="displayProductPriceBlock" product=$product type="price"}
  270. {/if}
  271. {/strip}</p>
  272. <p id="reduction_percent" {if $productPriceWithoutReduction <= 0 || !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>{strip}
  273. <span id="reduction_percent_display">
  274. {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
  275. </span>
  276. {/strip}</p>
  277. <p id="reduction_amount" {if $productPriceWithoutReduction <= 0 || !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}>{strip}
  278. <span id="reduction_amount_display">
  279. {if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0}
  280. -{convertPrice price=$productPriceWithoutReduction|floatval-$productPrice|floatval}
  281. {/if}
  282. </span>
  283. {/strip}</p>
  284. <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction)} class="hidden"{/if}>{strip}
  285. {if $priceDisplay >= 0 && $priceDisplay <= 2}
  286. {hook h="displayProductPriceBlock" product=$product type="old_price"}
  287. <span id="old_price_display"><span class="price">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction|floatval}{/if}</span>{if $productPriceWithoutReduction > $productPrice && $tax_enabled && $display_tax_label == 1} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}</span>
  288. {/if}
  289. {/strip}</p>
  290. {if $priceDisplay == 2}
  291. <br />
  292. <span id="pretaxe_price">{strip}
  293. <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}
  294. {/strip}</span>
  295. {/if}
  296. </div> <!-- end prices -->
  297. {if $packItems|@count && $productPrice < $product->getNoPackPrice()}
  298. <p class="pack_price">{l s='Instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
  299. {/if}
  300. {if $product->ecotax != 0}
  301. <p class="price-ecotax">{l s='Including'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='for ecotax'}
  302. {if $product->specificPrice && $product->specificPrice.reduction}
  303. <br />{l s='(not impacted by the discount)'}
  304. {/if}
  305. </p>
  306. {/if}
  307. {if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
  308. {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}
  309. <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p>
  310. {hook h="displayProductPriceBlock" product=$product type="unit_price"}
  311. {/if}
  312. {/if} {*close if for show price*}
  313. {hook h="displayProductPriceBlock" product=$product type="weight" hook_origin='product_sheet'}
  314. {hook h="displayProductPriceBlock" product=$product type="after_price"}
  315. <div class="clear"></div>
  316. </div> <!-- end content_prices -->
  317. <div class="product_attributes clearfix">
  318. <!-- quantity wanted -->
  319. {if !$PS_CATALOG_MODE}
  320. <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
  321. <label for="quantity_wanted">{l s='Quantity'}</label>
  322. <input type="number" min="1" 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}" />
  323. <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down">
  324. <span><i class="icon-minus"></i></span>
  325. </a>
  326. <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up">
  327. <span><i class="icon-plus"></i></span>
  328. </a>
  329. <span class="clearfix"></span>
  330. </p>
  331. {/if}
  332. <!-- minimal quantity wanted -->
  333. <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
  334. {l s='The minimum purchase order quantity for the product is'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b>
  335. </p>
  336. {if isset($groups)}
  337. <!-- attributes -->
  338. <div id="attributes">
  339. <div class="clearfix"></div>
  340. {foreach from=$groups key=id_attribute_group item=group}
  341. {if $group.attributes|@count}
  342. <fieldset class="attribute_fieldset">
  343. <label class="attribute_label" {if $group.group_type != 'color' && $group.group_type != 'radio'}for="group_{$id_attribute_group|intval}"{/if}>{$group.name|escape:'html':'UTF-8'}&nbsp;</label>
  344. {assign var="groupName" value="group_$id_attribute_group"}
  345. <div class="attribute_list">
  346. {if ($group.group_type == 'select')}
  347. <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
  348. {foreach from=$group.attributes key=id_attribute item=group_attribute}
  349. <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:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
  350. {/foreach}
  351. </select>
  352. {elseif ($group.group_type == 'color')}
  353. <ul id="color_to_pick_list" class="clearfix">
  354. {assign var="default_colorpicker" value=""}
  355. {foreach from=$group.attributes key=id_attribute item=group_attribute}
  356. {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
  357. <li{if $group.default == $id_attribute} class="selected"{/if}>
  358. <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
  359. {if $img_color_exists}
  360. <img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" />
  361. {/if}
  362. </a>
  363. </li>
  364. {if ($group.default == $id_attribute)}
  365. {$default_colorpicker = $id_attribute}
  366. {/if}
  367. {/foreach}
  368. </ul>
  369. <input type="hidden" class="color_pick_hidden" name="{$groupName|escape:'html':'UTF-8'}" value="{$default_colorpicker|intval}" />
  370. {elseif ($group.group_type == 'radio')}
  371. <ul>
  372. {foreach from=$group.attributes key=id_attribute item=group_attribute}
  373. <li>
  374. <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} />
  375. <span>{$group_attribute|escape:'html':'UTF-8'}</span>
  376. </li>
  377. {/foreach}
  378. </ul>
  379. {/if}
  380. </div> <!-- end attribute_list -->
  381. </fieldset>
  382. {/if}
  383. {/foreach}
  384. </div> <!-- end attributes -->
  385. {/if}
  386. </div> <!-- end product_attributes -->
  387. <div class="box-cart-bottom">
  388. <div{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE} class="unvisible"{/if}>
  389. <p id="add_to_cart" class="buttons_bottom_block no-print">
  390. <button type="submit" name="Submit" class="exclusive">
  391. <span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span>
  392. </button>
  393. </p>
  394. </div>
  395. {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
  396. </div> <!-- end box-cart-bottom -->
  397. </div> <!-- end box-info-product -->
  398. </form>
  399. {/if}
  400. </div> <!-- end pb-right-column-->
  401. </div> <!-- end primary_block -->
  402. {if !$content_only}
  403. {if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
  404. <!-- quantity discount -->
  405. <section class="page-product-box">
  406. <h3 class="page-product-heading">{l s='Volume discounts'}</h3>
  407. <div id="quantityDiscount">
  408. <table class="std table-product-discounts">
  409. <thead>
  410. <tr>
  411. <th>{l s='Quantity'}</th>
  412. <th>{if $display_discount_price}{l s='Price'}{else}{l s='Discount'}{/if}</th>
  413. <th>{l s='You Save'}</th>
  414. </tr>
  415. </thead>
  416. <tbody>
  417. {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
  418. {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
  419. {$realDiscountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
  420. {else}
  421. {$realDiscountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
  422. {/if}
  423. <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-real-discount-value="{convertPrice price = $realDiscountPrice}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}">
  424. <td>
  425. {$quantity_discount.quantity|intval}
  426. </td>
  427. <td>
  428. {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
  429. {if $display_discount_price}
  430. {if $quantity_discount.reduction_tax == 0 && !$quantity_discount.price}
  431. {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
  432. {else}
  433. {convertPrice price=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
  434. {/if}
  435. {else}
  436. {convertPrice price=$quantity_discount.real_value|floatval}
  437. {/if}
  438. {else}
  439. {if $display_discount_price}
  440. {if $quantity_discount.reduction_tax == 0}
  441. {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
  442. {else}
  443. {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
  444. {/if}
  445. {else}
  446. {$quantity_discount.real_value|floatval}%
  447. {/if}
  448. {/if}
  449. </td>
  450. <td>
  451. <span>{l s='Up to'}</span>
  452. {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
  453. {$discountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
  454. {else}
  455. {$discountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
  456. {/if}
  457. {$discountPrice=$discountPrice * $quantity_discount.quantity}
  458. {$qtyProductPrice=$productPriceWithoutReduction|floatval * $quantity_discount.quantity}
  459. {convertPrice price=$qtyProductPrice - $discountPrice}
  460. </td>
  461. </tr>
  462. {/foreach}
  463. </tbody>
  464. </table>
  465. </div>
  466. </section>
  467. {/if}
  468. {if isset($features) && $features}
  469. <!-- Data sheet -->
  470. <section class="page-product-box">
  471. <h3 class="page-product-heading">{l s='Data sheet'}</h3>
  472. <table class="table-data-sheet">
  473. {foreach from=$features item=feature}
  474. <tr class="{cycle values="odd,even"}">
  475. {if isset($feature.value)}
  476. <td>{$feature.name|escape:'html':'UTF-8'}</td>
  477. <td>{$feature.value|escape:'html':'UTF-8'}</td>
  478. {/if}
  479. </tr>
  480. {/foreach}
  481. </table>
  482. </section>
  483. <!--end Data sheet -->
  484. {/if}
  485. {if isset($product) && $product->description}
  486. <!-- More info -->
  487. <section class="page-product-box">
  488. <h3 class="page-product-heading">{l s='More info'}</h3>
  489. <!-- full description -->
  490. <div class="rte">{$product->description}</div>
  491. </section>
  492. <!--end More info -->
  493. {/if}
  494. {if isset($packItems) && $packItems|@count > 0}
  495. <section id="blockpack">
  496. <h3 class="page-product-heading">{l s='Pack content'}</h3>
  497. {include file="$tpl_dir./product-list.tpl" products=$packItems}
  498. </section>
  499. {/if}
  500. <!--HOOK_PRODUCT_TAB -->
  501. <section class="page-product-box">
  502. {$HOOK_PRODUCT_TAB}
  503. {if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
  504. </section>
  505. <!--end HOOK_PRODUCT_TAB -->
  506. {if isset($accessories) && $accessories}
  507. <!--Accessories -->
  508. <section class="page-product-box">
  509. <h3 class="page-product-heading">{l s='Accessories'}</h3>
  510. <div class="block products_block accessories-block clearfix">
  511. <div class="block_content">
  512. <ul id="bxslider" class="bxslider clearfix">
  513. {foreach from=$accessories item=accessory name=accessories_list}
  514. {if ($accessory.allow_oosp || $accessory.quantity_all_versions > 0 || $accessory.quantity > 0) && $accessory.available_for_order && !isset($restricted_country_mode)}
  515. {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
  516. <li class="item product-box 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">
  517. <div class="product_desc">
  518. <a href="{$accessoryLink|escape:'html':'UTF-8'}" title="{$accessory.legend|escape:'html':'UTF-8'}" class="product-image product_image">
  519. <img class="lazyOwl" src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{$accessory.legend|escape:'html':'UTF-8'}" width="{$homeSize.width}" height="{$homeSize.height}"/>
  520. </a>
  521. <div class="block_description">
  522. <a href="{$accessoryLink|escape:'html':'UTF-8'}" title="{l s='More'}" class="product_description">
  523. {$accessory.description_short|strip_tags|truncate:25:'...'}
  524. </a>
  525. </div>
  526. </div>
  527. <div class="s_title_block">
  528. <h5 itemprop="name" class="product-name">
  529. <a href="{$accessoryLink|escape:'html':'UTF-8'}">
  530. {$accessory.name|truncate:20:'...':true|escape:'html':'UTF-8'}
  531. </a>
  532. </h5>
  533. {if $accessory.show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
  534. <span class="price">
  535. {if $priceDisplay != 1}
  536. {displayWtPrice p=$accessory.price}
  537. {else}
  538. {displayWtPrice p=$accessory.price_tax_exc}
  539. {/if}
  540. {hook h="displayProductPriceBlock" product=$accessory type="price"}
  541. </span>
  542. {/if}
  543. {hook h="displayProductPriceBlock" product=$accessory type="after_price"}
  544. </div>
  545. <div class="clearfix" style="margin-top:5px">
  546. {if !$PS_CATALOG_MODE && ($accessory.allow_oosp || $accessory.quantity > 0) && isset($add_prod_display) && $add_prod_display == 1}
  547. <div class="no-print">
  548. <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")|escape:'html':'UTF-8'}" data-id-product="{$accessory.id_product|intval}" title="{l s='Add to cart'}">
  549. <span>{l s='Add to cart'}</span>
  550. </a>
  551. </div>
  552. {/if}
  553. </div>
  554. </li>
  555. {/if}
  556. {/foreach}
  557. </ul>
  558. </div>
  559. </div>
  560. </section>
  561. <!--end Accessories -->
  562. {/if}
  563. {if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if}
  564. <!-- description & features -->
  565. {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}
  566. {if isset($attachments) && $attachments}
  567. <!--Download -->
  568. <section class="page-product-box">
  569. <h3 class="page-product-heading">{l s='Download'}</h3>
  570. {foreach from=$attachments item=attachment name=attachements}
  571. {if $smarty.foreach.attachements.iteration %3 == 1}<div class="row">{/if}
  572. <div class="col-lg-4">
  573. <h4><a href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")|escape:'html':'UTF-8'}">{$attachment.name|escape:'html':'UTF-8'}</a></h4>
  574. <p class="text-muted">{$attachment.description|escape:'html':'UTF-8'}</p>
  575. <a class="btn btn-default btn-block" href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")|escape:'html':'UTF-8'}">
  576. <i class="icon-download"></i>
  577. {l s="Download"} ({Tools::formatBytes($attachment.file_size, 2)})
  578. </a>
  579. <hr />
  580. </div>
  581. {if $smarty.foreach.attachements.iteration %3 == 0 || $smarty.foreach.attachements.last}</div>{/if}
  582. {/foreach}
  583. </section>
  584. <!--end Download -->
  585. {/if}
  586. {if isset($product) && $product->customizable}
  587. <!--Customization -->
  588. <section class="page-product-box">
  589. <h3 class="page-product-heading">{l s='Product customization'}</h3>
  590. <!-- Customizable products -->
  591. <form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm" class="clearfix">
  592. <p class="infoCustomizable">
  593. {l s='After saving your customized product, remember to add it to your cart.'}
  594. {if $product->uploadable_files}
  595. <br />
  596. {l s='Allowed file formats are: GIF, JPG, PNG'}{/if}
  597. </p>
  598. {if $product->uploadable_files|intval}
  599. <div class="customizableProductsFile">
  600. <h5 class="product-heading-h5">{l s='Pictures'}</h5>
  601. <ul id="uploadable_files" class="clearfix">
  602. {counter start=0 assign='customizationField'}
  603. {foreach from=$customizationFields item='field' name='customizationFields'}
  604. {if $field.type == 0}
  605. <li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
  606. {if isset($pictures.$key)}
  607. <div class="customizationUploadBrowse">
  608. <img src="{$pic_dir}{$pictures.$key}_small" alt="" />
  609. <a href="{$link->getProductDeletePictureLink($product, $field.id_customization_field)|escape:'html':'UTF-8'}" title="{l s='Delete'}" >
  610. <img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="customization_delete_icon" width="11" height="13" />
  611. </a>
  612. </div>
  613. {/if}
  614. <div class="customizationUploadBrowse form-group">
  615. <label class="customizationUploadBrowseDescription">
  616. {if !empty($field.name)}
  617. {$field.name}
  618. {else}
  619. {l s='Please select an image file from your computer'}
  620. {/if}
  621. {if $field.required}<sup>*</sup>{/if}
  622. </label>
  623. <input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="form-control customization_block_input {if isset($pictures.$key)}filled{/if}" />
  624. </div>
  625. </li>
  626. {counter}
  627. {/if}
  628. {/foreach}
  629. </ul>
  630. </div>
  631. {/if}
  632. {if $product->text_fields|intval}
  633. <div class="customizableProductsText">
  634. <h5 class="product-heading-h5">{l s='text'}</h5>
  635. <ul id="text_fields">
  636. {counter start=0 assign='customizationField'}
  637. {foreach from=$customizationFields item='field' name='customizationFields'}
  638. {if $field.type == 1}
  639. <li class="customizationUploadLine{if $field.required} required{/if}">
  640. <label for ="textField{$customizationField}">
  641. {assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
  642. {if !empty($field.name)}
  643. {$field.name}
  644. {/if}
  645. {if $field.required}<sup>*</sup>{/if}
  646. </label>
  647. <textarea name="textField{$field.id_customization_field}" class="form-control customization_block_input" id="textField{$customizationField}" rows="3" cols="20">{strip}
  648. {if isset($textFields.$key)}
  649. {$textFields.$key|stripslashes}
  650. {/if}
  651. {/strip}</textarea>
  652. </li>
  653. {counter}
  654. {/if}
  655. {/foreach}
  656. </ul>
  657. </div>
  658. {/if}
  659. <p id="customizedDatas">
  660. <input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
  661. <input type="hidden" name="submitCustomizedDatas" value="1" />
  662. <button class="button btn btn-default button button-small" name="saveCustomization">
  663. <span>{l s='Save'}</span>
  664. </button>
  665. <span id="ajax-loader" class="unvisible">
  666. <img src="{$img_ps_dir}loader.gif" alt="loader" />
  667. </span>
  668. </p>
  669. </form>
  670. <p class="clear required"><sup>*</sup> {l s='required fields'}</p>
  671. </section>
  672. <!--end Customization -->
  673. {/if}
  674. {/if}
  675. {/if}
  676. </div> <!-- itemscope product wrapper -->
  677. {strip}
  678. {if isset($smarty.get.ad) && $smarty.get.ad}
  679. {addJsDefL name=ad}{$base_dir|cat:$smarty.get.ad|escape:'html':'UTF-8'}{/addJsDefL}
  680. {/if}
  681. {if isset($smarty.get.adtoken) && $smarty.get.adtoken}
  682. {addJsDefL name=adtoken}{$smarty.get.adtoken|escape:'html':'UTF-8'}{/addJsDefL}
  683. {/if}
  684. {addJsDef allowBuyWhenOutOfStock=$allow_oosp|boolval}
  685. {addJsDef availableNowValue=$product->available_now|escape:'quotes':'UTF-8'}
  686. {addJsDef availableLaterValue=$product->available_later|escape:'quotes':'UTF-8'}
  687. {addJsDef attribute_anchor_separator=$attribute_anchor_separator|escape:'quotes':'UTF-8'}
  688. {addJsDef attributesCombinations=$attributesCombinations}
  689. {addJsDef currentDate=$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}
  690. {if isset($combinations) && $combinations}
  691. {addJsDef combinations=$combinations}
  692. {addJsDef combinationsFromController=$combinations}
  693. {addJsDef displayDiscountPrice=$display_discount_price}
  694. {addJsDefL name='upToTxt'}{l s='Up to' js=1}{/addJsDefL}
  695. {/if}
  696. {if isset($combinationImages) && $combinationImages}
  697. {addJsDef combinationImages=$combinationImages}
  698. {/if}
  699. {addJsDef customizationId=$id_customization}
  700. {addJsDef customizationFields=$customizationFields}
  701. {addJsDef default_eco_tax=$product->ecotax|floatval}
  702. {addJsDef displayPrice=$priceDisplay|intval}
  703. {addJsDef ecotaxTax_rate=$ecotaxTax_rate|floatval}
  704. {if isset($cover.id_image_only)}
  705. {addJsDef idDefaultImage=$cover.id_image_only|intval}
  706. {else}
  707. {addJsDef idDefaultImage=0}
  708. {/if}
  709. {addJsDef img_ps_dir=$img_ps_dir}
  710. {addJsDef img_prod_dir=$img_prod_dir}
  711. {addJsDef id_product=$product->id|intval}
  712. {addJsDef jqZoomEnabled=$jqZoomEnabled|boolval}
  713. {addJsDef maxQuantityToAllowDisplayOfLastQuantityMessage=$last_qties|intval}
  714. {addJsDef minimalQuantity=$product->minimal_quantity|intval}
  715. {addJsDef noTaxForThisProduct=$no_tax|boolval}
  716. {if isset($customer_group_without_tax)}
  717. {addJsDef customerGroupWithoutTax=$customer_group_without_tax|boolval}
  718. {else}
  719. {addJsDef customerGroupWithoutTax=false}
  720. {/if}
  721. {if isset($group_reduction)}
  722. {addJsDef groupReduction=$group_reduction|floatval}
  723. {else}
  724. {addJsDef groupReduction=false}
  725. {/if}
  726. {addJsDef oosHookJsCodeFunctions=Array()}
  727. {addJsDef productHasAttributes=isset($groups)|boolval}
  728. {addJsDef productPriceTaxExcluded=($product->getPriceWithoutReduct(true)|default:'null' - $product->ecotax)|floatval}
  729. {addJsDef productPriceTaxIncluded=($product->getPriceWithoutReduct(false)|default:'null' - $product->ecotax * (1 + $ecotaxTax_rate / 100))|floatval}
  730. {addJsDef productBasePriceTaxExcluded=($product->getPrice(false, null, 6, null, false, false) - $product->ecotax)|floatval}
  731. {addJsDef productBasePriceTaxExcl=($product->getPrice(false, null, 6, null, false, false)|floatval)}
  732. {addJsDef productBasePriceTaxIncl=($product->getPrice(true, null, 6, null, false, false)|floatval)}
  733. {addJsDef productReference=$product->reference|escape:'html':'UTF-8'}
  734. {addJsDef productAvailableForOrder=$product->available_for_order|boolval}
  735. {addJsDef productPriceWithoutReduction=$productPriceWithoutReduction|floatval}
  736. {addJsDef productPrice=$productPrice|floatval}
  737. {addJsDef productUnitPriceRatio=$product->unit_price_ratio|floatval}
  738. {addJsDef productShowPrice=(!$PS_CATALOG_MODE && $product->show_price)|boolval}
  739. {addJsDef PS_CATALOG_MODE=$PS_CATALOG_MODE}
  740. {if $product->specificPrice && $product->specificPrice|@count}
  741. {addJsDef product_specific_price=$product->specificPrice}
  742. {else}
  743. {addJsDef product_specific_price=array()}
  744. {/if}
  745. {if $display_qties == 1 && $product->quantity}
  746. {addJsDef quantityAvailable=$product->quantity}
  747. {else}
  748. {addJsDef quantityAvailable=0}
  749. {/if}
  750. {addJsDef quantitiesDisplayAllowed=$display_qties|boolval}
  751. {if $product->specificPrice && $product->specificPrice.reduction && $product->specificPrice.reduction_type == 'percentage'}
  752. {addJsDef reduction_percent=$product->specificPrice.reduction*100|floatval}
  753. {else}
  754. {addJsDef reduction_percent=0}
  755. {/if}
  756. {if $product->specificPrice && $product->specificPrice.reduction && $product->specificPrice.reduction_type == 'amount'}
  757. {addJsDef reduction_price=$product->specificPrice.reduction|floatval}
  758. {else}
  759. {addJsDef reduction_price=0}
  760. {/if}
  761. {if $product->specificPrice && $product->specificPrice.price}
  762. {addJsDef specific_price=$product->specificPrice.price|floatval}
  763. {else}
  764. {addJsDef specific_price=0}
  765. {/if}
  766. {addJsDef specific_currency=($product->specificPrice && $product->specificPrice.id_currency)|boolval} {* TODO: remove if always false *}
  767. {addJsDef stock_management=$PS_STOCK_MANAGEMENT|intval}
  768. {addJsDef taxRate=$tax_rate|floatval}
  769. {addJsDefL name=doesntExist}{l s='This combination does not exist for this product. Please select another combination.' js=1}{/addJsDefL}
  770. {addJsDefL name=doesntExistNoMore}{l s='This product is no longer in stock' js=1}{/addJsDefL}
  771. {addJsDefL name=doesntExistNoMoreBut}{l s='with those attributes but is available with others.' js=1}{/addJsDefL}
  772. {addJsDefL name=fieldRequired}{l s='Please fill in all the required fields before saving your customization.' js=1}{/addJsDefL}
  773. {addJsDefL name=uploading_in_progress}{l s='Uploading in progress, please be patient.' js=1}{/addJsDefL}
  774. {addJsDefL name='product_fileDefaultHtml'}{l s='No file selected' js=1}{/addJsDefL}
  775. {addJsDefL name='product_fileButtonHtml'}{l s='Choose File' js=1}{/addJsDefL}
  776. {/strip}
  777. {/if}
Advertisement
Add Comment
Please, Sign In to add comment