Advertisement
Guest User

Untitled

a guest
Feb 25th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.47 KB | None | 0 0
  1. {*
  2. * 2007-2015 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-2015 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. {if isset($products) && $products}
  26. {*define number of products per line in other page for desktop*}
  27. {if $page_name !='index' && $page_name !='product'}
  28. {assign var='nbItemsPerLine' value=3}
  29. {assign var='nbItemsPerLineTablet' value=2}
  30. {assign var='nbItemsPerLineMobile' value=3}
  31. {else}
  32. {assign var='nbItemsPerLine' value=4}
  33. {assign var='nbItemsPerLineTablet' value=3}
  34. {assign var='nbItemsPerLineMobile' value=2}
  35. {/if}
  36. {*define numbers of product per line in other page for tablet*}
  37. {assign var='nbLi' value=$products|@count}
  38. {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
  39. {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet}
  40. <!-- Products list -->
  41. <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}">
  42. {foreach from=$products item=product name=products}
  43. {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo}
  44. {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet}
  45. {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile}
  46. {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if}
  47. {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if}
  48. {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if}
  49. <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">
  50. <div class="product-container" itemscope itemtype="https://schema.org/Product">
  51. <div class="left-block">
  52. <div class="product-image-container">
  53. <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
  54. <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />
  55. </a>
  56. {if isset($quick_view) && $quick_view}
  57. <div class="quick-view-wrapper-mobile">
  58. <a class="quick-view-mobile" href="{$product.link|escape:'html':'UTF-8'}" rel="{$product.link|escape:'html':'UTF-8'}">
  59. <i class="icon-eye-open"></i>
  60. </a>
  61. </div>
  62. <a class="quick-view" href="{$product.link|escape:'html':'UTF-8'}" rel="{$product.link|escape:'html':'UTF-8'}">
  63. <span>{l s='Quick view'}</span>
  64. </a>
  65. {/if}
  66. {if (!$PS_CATALOG_MODE && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  67. <div class="content_price" itemprop="offers" itemscope itemtype="https://schema.org/Offer">
  68. {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
  69. <span itemprop="price" class="price product-price">
  70. {hook h="displayProductPriceBlock" product=$product type="before_price"}
  71. {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
  72. </span>
  73. <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
  74. {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  75. {hook h="displayProductPriceBlock" product=$product type="old_price"}
  76. <span class="old-price product-price">
  77. {displayWtPrice p=$product.price_without_reduction}
  78. </span>
  79. {if $product.specific_prices.reduction_type == 'percentage'}
  80. <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
  81. {/if}
  82. {/if}
  83. {if isset($product.color_list)}
  84. <div class="color-list-container">{$product.color_list}</div>
  85. {/if}
  86. {if $PS_STOCK_MANAGEMENT && isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
  87. <span class="unvisible">
  88. {if ($product.allow_oosp || $product.quantity > 0)}
  89. <link itemprop="availability" href="https://schema.org/InStock" />{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
  90. {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
  91. <link itemprop="availability" href="https://schema.org/LimitedAvailability" />{l s='Product available with different options'}
  92.  
  93. {else}
  94. <link itemprop="availability" href="https://schema.org/OutOfStock" />{l s='Out of stock'}
  95. {/if}
  96. </span>
  97. {/if}
  98. {hook h="displayProductPriceBlock" product=$product type="price"}
  99. {hook h="displayProductPriceBlock" product=$product type="unit_price"}
  100. {/if}
  101. </div>
  102. {/if}
  103. {if isset($product.new) && $product.new == 1}
  104. <a class="new-box" href="{$product.link|escape:'html':'UTF-8'}">
  105. <span class="new-label">{l s='New'}</span>
  106. </a>
  107. {/if}
  108. {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  109. <a class="sale-box" href="{$product.link|escape:'html':'UTF-8'}">
  110. <span class="sale-label">{l s='Sale!'}</span>
  111. </a>
  112. {/if}
  113. </div>
  114. {if isset($product.is_virtual) && !$product.is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}
  115. {hook h="displayProductPriceBlock" product=$product type="weight"}
  116. </div>
  117. <div class="right-block">
  118. <h5 itemprop="name">
  119. {if isset($product.pack_quantity) && $product.manufacturer_name && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
  120. <img src="{$base_dir}img/tmp/manufacturer_{$product.id_manufacturer}.jpg" width="50%" height="50%" alt="{$product.manufacturer_name}" title="{$product.manufacturer_name}" />
  121. <a class="product-name" style="line-height: 1cm; font-size: x-large;" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" >
  122. {$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
  123. </a>
  124. </h5>
  125. {capture name='displayProductListReviews'}{hook h='displayProductListReviews' product=$product}{/capture}
  126. {if $smarty.capture.displayProductListReviews}
  127. <div class="hook-reviews">
  128. {hook h='displayProductListReviews' product=$product}
  129. </div>
  130. {/if}
  131. <p class="product-desc" itemprop="description">
  132. {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
  133. </p>
  134. {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  135. <div class="content_price">
  136. {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
  137. {hook h="displayProductPriceBlock" product=$product type='before_price'}
  138. <span class="price product-price">
  139. {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
  140. </span>
  141. {if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
  142. {hook h="displayProductPriceBlock" product=$product type="old_price"}
  143. <span class="old-price product-price">
  144. {displayWtPrice p=$product.price_without_reduction}
  145. </span>
  146. {hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
  147. {if $product.specific_prices.reduction_type == 'percentage'}
  148. <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
  149. {/if}
  150. {/if}
  151. {hook h="displayProductPriceBlock" product=$product type="price"}
  152. {hook h="displayProductPriceBlock" product=$product type="unit_price"}
  153. {hook h="displayProductPriceBlock" product=$product type='after_price'}
  154. {/if}
  155. </div>
  156. {/if}
  157. <div class="button-container">
  158. {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE}
  159. {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
  160. {capture}add=1&amp;id_product={$product.id_product|intval}{if isset($product.id_product_attribute) && $product.id_product_attribute}&amp;ipa={$product.id_product_attribute|intval}{/if}{if isset($static_token)}&amp;token={$static_token}{/if}{/capture}
  161.  
  162. {else}
  163. <span class="button ajax_add_to_cart_button btn btn-default disabled">
  164. <span>{l s='Add to cart'}</span>
  165. </span>
  166. {/if}
  167. {/if}
  168. <a class="button lnk_view btn btn-default" href="{$product.link|escape:'html':'UTF-8'}" title="{l s='View'}">
  169. <span>{if (isset($product.customization_required) && $product.customization_required)}{l s='Customize'}{else}{l s='More'}{/if}</span>
  170. </a>
  171. </div>
  172. <div class="product-flags">
  173. {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  174. {if isset($product.online_only) && $product.online_only}
  175. <span class="online_only">{l s='Online only'}</span>
  176. {/if}
  177. {/if}
  178. {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  179. {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
  180. <span class="discount">{l s='Reduced price!'}</span>
  181. {/if}
  182. </div>
  183. {if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
  184. {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
  185. <span class="availability">
  186. {if ($product.allow_oosp || $product.quantity > 0)}
  187. <span class="{if $product.quantity <= 0 && isset($product.allow_oosp) && !$product.allow_oosp} label-danger{elseif $product.quantity <= 0} label-warning{else} label-success{/if}">
  188. {if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
  189. </span>
  190. {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
  191. <span class="label-warning">
  192. {l s='Product available with different options'}
  193. </span>
  194. {else}
  195. <span class="label-danger">
  196. {l s='Out of stock'}
  197. </span>
  198. {/if}
  199. </span>
  200. {/if}
  201. {/if}
  202. </div>
  203. {if $page_name != 'index'}
  204. <div class="functional-buttons clearfix">
  205. {hook h='displayProductListFunctionalButtons' product=$product}
  206. {if isset($comparator_max_item) && $comparator_max_item}
  207. <div class="compare">
  208. <a class="add_to_compare" href="{$product.link|escape:'html':'UTF-8'}" data-id-product="{$product.id_product}">{l s='Add to Compare'}</a>
  209. </div>
  210. {/if}
  211. </div>
  212. {/if}
  213. </div><!-- .product-container> -->
  214. </li>
  215. {/foreach}
  216. </ul>
  217. {addJsDefL name=min_item}{l s='Please select at least one product' js=1}{/addJsDefL}
  218. {addJsDefL name=max_item}{l s='You cannot add more than %d product(s) to the product comparison' sprintf=$comparator_max_item js=1}{/addJsDefL}
  219. {addJsDef comparator_max_item=$comparator_max_item}
  220. {addJsDef comparedProductsIds=$compared_products}
  221. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement