PageRenderTime 37ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/blockcart/blockcart.tpl

https://gitlab.com/ptisky/API_prestashop
Smarty Template | 176 lines | 142 code | 7 blank | 27 comment | 27 complexity | e335a5bcce7c63734a6e293b8c19b954 MD5 | raw file
  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. {*************************************************************************************************************************************}
  26. {* IMPORTANT : If you change some data here, you have to report these changes in the ./blockcart-json.js (to let ajaxCart available) *}
  27. {*************************************************************************************************************************************}
  28. {if $ajax_allowed}
  29. <script type="text/javascript">
  30. var CUSTOMIZE_TEXTFIELD = {$CUSTOMIZE_TEXTFIELD};
  31. var img_dir = '{$img_dir|addslashes}';
  32. </script>
  33. {/if}
  34. <script type="text/javascript">
  35. var customizationIdMessage = '{l s='Customization #' mod='blockcart' js=1}';
  36. var removingLinkText = '{l s='remove this product from my cart' mod='blockcart' js=1}';
  37. var freeShippingTranslation = '{l s='Free shipping!' mod='blockcart' js=1}';
  38. var freeProductTranslation = '{l s='Free!' mod='blockcart' js=1}';
  39. var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
  40. var generated_date = {$smarty.now|intval};
  41. </script>
  42. <!-- MODULE Block cart -->
  43. <div id="cart_block" class="block exclusive">
  44. <h4 class="title_block">
  45. <a href="{$link->getPageLink("$order_process", true)|escape:'html'}" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{l s='Cart' mod='blockcart'}</a>
  46. {if $ajax_allowed}
  47. <span id="block_cart_expand" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !isset($colapseExpandStatus)}class="hidden"{/if}>&nbsp;</span>
  48. <span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed'}class="hidden"{/if}>&nbsp;</span>
  49. {/if}
  50. </h4>
  51. <div class="block_content">
  52. <!-- block summary -->
  53. <div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}collapsed{else}expanded{/if}">
  54. <span class="ajax_cart_quantity" {if $cart_qties <= 0}style="display:none;"{/if}>{$cart_qties}</span>
  55. <span class="ajax_cart_product_txt_s" {if $cart_qties <= 1}style="display:none"{/if}>{l s='Products' mod='blockcart'}</span>
  56. <span class="ajax_cart_product_txt" {if $cart_qties > 1}style="display:none"{/if}>{l s='Product' mod='blockcart'}</span>
  57. <span class="ajax_cart_total" {if $cart_qties == 0}style="display:none"{/if}>
  58. {if $cart_qties > 0}
  59. {if $priceDisplay == 1}
  60. {convertPrice price=$cart->getOrderTotal(false)}
  61. {else}
  62. {convertPrice price=$cart->getOrderTotal(true)}
  63. {/if}
  64. {/if}
  65. </span>
  66. <span class="ajax_cart_no_product" {if $cart_qties != 0}style="display:none"{/if}>{l s='(empty)' mod='blockcart'}</span>
  67. </div>
  68. <!-- block list of products -->
  69. <div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}expanded{else}collapsed{/if}">
  70. {if $products}
  71. <dl class="products">
  72. {foreach from=$products item='product' name='myLoop'}
  73. {assign var='productId' value=$product.id_product}
  74. {assign var='productAttributeId' value=$product.id_product_attribute}
  75. <dt id="cart_block_product_{$product.id_product}_{if $product.id_product_attribute}{$product.id_product_attribute}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
  76. <span class="quantity-formated"><span class="quantity">{$product.cart_quantity}</span>x</span>
  77. <a class="cart_block_product_name" href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}">
  78. {$product.name|truncate:13:'...'|escape:html:'UTF-8'}</a>
  79. <span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product}&amp;ipa={$product.id_product_attribute}&amp;id_address_delivery={$product.id_address_delivery}&amp;token={$static_token}", true)|escape:'html'}" title="{l s='Please remove this product from my cart.' mod='blockcart'}">&nbsp;</a>{/if}</span>
  80. <span class="price">
  81. {if !isset($product.is_gift) || !$product.is_gift}
  82. {if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}
  83. {else}
  84. <b>{l s='Free!' mod='blockcart'}</b>
  85. {/if}
  86. </span>
  87. </dt>
  88. {if isset($product.attributes_small)}
  89. <dd id="cart_block_combination_of_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}_{$product.id_address_delivery|intval}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
  90. <a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}" title="{l s='Product detail' mod='blockcart'}">{$product.attributes_small}</a>
  91. {/if}
  92. <!-- Customizable datas -->
  93. {if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
  94. {if !isset($product.attributes_small)}<dd id="cart_block_combination_of_{$product.id_product}_{if $product.id_product_attribute}{$product.id_product_attribute}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">{/if}
  95. <ul class="cart_block_customizations" id="customization_{$productId}_{$productAttributeId}">
  96. {foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizations'}
  97. <li name="customization">
  98. <div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_customization={$id_customization}&amp;token={$static_token}", true)|escape:'html'}" rel="nofollow"> </a></div>
  99. <span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
  100. {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:html:'UTF-8'}
  101. {else}
  102. {l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
  103. {/if}
  104. </li>
  105. {/foreach}
  106. </ul>
  107. {if !isset($product.attributes_small)}</dd>{/if}
  108. {/if}
  109. {if isset($product.attributes_small)}</dd>{/if}
  110. {/foreach}
  111. </dl>
  112. {/if}
  113. <p {if $products}class="hidden"{/if} id="cart_block_no_products">{l s='No products' mod='blockcart'}</p>
  114. {if $discounts|@count > 0}
  115. <table id="vouchers"{if $discounts|@count == 0} style="display:none;"{/if}>
  116. {foreach from=$discounts item=discount}
  117. {if $discount.value_real > 0}
  118. <tr class="bloc_cart_voucher" id="bloc_cart_voucher_{$discount.id_discount}">
  119. <td class="quantity">1x</td>
  120. <td class="name" title="{$discount.description}">{$discount.name|truncate:18:'...'|escape:'html':'UTF-8'}</td>
  121. <td class="price">-{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}</td>
  122. <td class="delete">
  123. {if strlen($discount.code)}
  124. <a class="delete_voucher" href="{$link->getPageLink('$order_process', true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete' mod='blockcart'}" rel="nofollow"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete' mod='blockcart'}" class="icon" /></a>
  125. {/if}
  126. </td>
  127. </tr>
  128. {/if}
  129. {/foreach}
  130. </table>
  131. {/if}
  132. <p id="cart-prices">
  133. <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  134. <span>{l s='Shipping' mod='blockcart'}</span>
  135. <br/>
  136. {if $show_wrapping}
  137. {assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant}
  138. <span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span>
  139. <span>{l s='Wrapping' mod='blockcart'}</span>
  140. <br/>
  141. {/if}
  142. {if $show_tax && isset($tax_cost)}
  143. <span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span>
  144. <span>{l s='Tax' mod='blockcart'}</span>
  145. <br/>
  146. {/if}
  147. <span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>
  148. <span>{l s='Total' mod='blockcart'}</span>
  149. </p>
  150. {if $use_taxes && $display_tax_label == 1 && $show_tax}
  151. {if $priceDisplay == 0}
  152. <p id="cart-price-precisions">
  153. {l s='Prices are tax included' mod='blockcart'}
  154. </p>
  155. {/if}
  156. {if $priceDisplay == 1}
  157. <p id="cart-price-precisions">
  158. {l s='Prices are tax excluded' mod='blockcart'}
  159. </p>
  160. {/if}
  161. {/if}
  162. <p id="cart-buttons">
  163. {if $order_process == 'order'}<a href="{$link->getPageLink("$order_process", true)|escape:'html'}" class="button_small" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{l s='Cart' mod='blockcart'}</a>{/if}
  164. <a href="{$link->getPageLink("$order_process", true)|escape:'html'}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}" rel="nofollow"><span></span>{l s='Check out' mod='blockcart'}</a>
  165. </p>
  166. </div>
  167. </div>
  168. </div>
  169. <!-- /MODULE Block cart -->