PageRenderTime 27ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/blockcart/blockcart.tpl

https://bitbucket.org/enurkov/prestashop
Smarty Template | 178 lines | 143 code | 8 blank | 27 comment | 24 complexity | 84beef0066918cea93b2f5e248265ca8 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. * @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}';
  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. </script>
  41. <!-- MODULE Block cart -->
  42. <div id="cart_block" class="block exclusive">
  43. <h4 class="title_block">
  44. <a href="{$link->getPageLink("$order_process", true)}" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{l s='Cart' mod='blockcart'}</a>
  45. {if $ajax_allowed}
  46. <span id="block_cart_expand" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !isset($colapseExpandStatus)}class="hidden"{/if}>&nbsp;</span>
  47. <span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed'}class="hidden"{/if}>&nbsp;</span>
  48. {/if}
  49. </h4>
  50. <div class="block_content">
  51. <!-- block summary -->
  52. <div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}collapsed{else}expanded{/if}">
  53. <span class="ajax_cart_quantity" {if $cart_qties <= 0}style="display:none;"{/if}>{$cart_qties}</span>
  54. <span class="ajax_cart_product_txt_s" {if $cart_qties <= 1}style="display:none"{/if}>{l s='products' mod='blockcart'}</span>
  55. <span class="ajax_cart_product_txt" {if $cart_qties > 1}style="display:none"{/if}>{l s='product' mod='blockcart'}</span>
  56. <span class="ajax_cart_total" {if $cart_qties == 0}style="display:none"{/if}>
  57. {if $cart_qties > 0}
  58. {if $priceDisplay == 1}
  59. {convertPrice price=$cart->getOrderTotal(false)}
  60. {else}
  61. {convertPrice price=$cart->getOrderTotal(true)}
  62. {/if}
  63. {/if}
  64. </span>
  65. <span class="ajax_cart_no_product" {if $cart_qties != 0}style="display:none"{/if}>{l s='(empty)' mod='blockcart'}</span>
  66. </div>
  67. <!-- block list of products -->
  68. <div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}expanded{else}collapsed{/if}">
  69. {if $products}
  70. <dl class="products">
  71. {foreach from=$products item='product' name='myLoop'}
  72. {assign var='productId' value=$product.id_product}
  73. {assign var='productAttributeId' value=$product.id_product_attribute}
  74. <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}">
  75. <span class="quantity-formated"><span class="quantity">{$product.cart_quantity}</span>x</span>
  76. <a class="cart_block_product_name" href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)}" title="{$product.name|escape:html:'UTF-8'}">
  77. {$product.name|truncate:13:'...'|escape:html:'UTF-8'}</a>
  78. <span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId) && ($product.total > 0)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete&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)}" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>{/if}</span>
  79. <span class="price">
  80. {if $product.total > 0}
  81. {if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}
  82. {else}
  83. <b>{l s='Free!' mod='blockcart'}</b>
  84. {/if}
  85. </span>
  86. </dt>
  87. {if isset($product.attributes_small)}
  88. <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}">
  89. <a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)}" title="{l s='Product detail' mod='blockcart'}">{$product.attributes_small}</a>
  90. {/if}
  91. <!-- Customizable datas -->
  92. {if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
  93. {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}
  94. <ul class="cart_block_customizations" id="customization_{$productId}_{$productAttributeId}">
  95. {foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizations'}
  96. <li name="customization">
  97. <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&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_customization={$id_customization}&amp;token={$static_token}", true)}" rel="nofollow"> </a></div>
  98. <span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
  99. {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|escape:html:'UTF-8'|replace:"<br />":" "|truncate:28}
  100. {else}
  101. {l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
  102. {/if}
  103. </li>
  104. {/foreach}
  105. </ul>
  106. {if !isset($product.attributes_small)}</dd>{/if}
  107. {/if}
  108. {if isset($product.attributes_small)}</dd>{/if}
  109. {/foreach}
  110. </dl>
  111. {/if}
  112. <p {if $products}class="hidden"{/if} id="cart_block_no_products">{l s='No products' mod='blockcart'}</p>
  113. {if $discounts|@count > 0}
  114. <table id="vouchers">
  115. <tbody>
  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|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'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. </tbody>
  131. </table>
  132. {/if}
  133. <p id="cart-prices">
  134. <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  135. <span>{l s='Shipping' mod='blockcart'}</span>
  136. <br/>
  137. {if $show_wrapping}
  138. {assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant}
  139. <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>
  140. <span>{l s='Wrapping' mod='blockcart'}</span>
  141. <br/>
  142. {/if}
  143. {if $show_tax && isset($tax_cost)}
  144. <span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span>
  145. <span>{l s='Tax' mod='blockcart'}</span>
  146. <br/>
  147. {/if}
  148. <span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>
  149. <span>{l s='Total' mod='blockcart'}</span>
  150. </p>
  151. {if $use_taxes && $display_tax_label == 1 && $show_tax}
  152. {if $priceDisplay == 0}
  153. <p id="cart-price-precisions">
  154. {l s='Prices are tax included' mod='blockcart'}
  155. </p>
  156. {/if}
  157. {if $priceDisplay == 1}
  158. <p id="cart-price-precisions">
  159. {l s='Prices are tax excluded' mod='blockcart'}
  160. </p>
  161. {/if}
  162. {/if}
  163. <p id="cart-buttons">
  164. {if $order_process == 'order'}<a href="{$link->getPageLink("$order_process", true)}" class="button_small" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{l s='Cart' mod='blockcart'}</a>{/if}
  165. <a href="{$link->getPageLink("$order_process", true)}" 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>
  166. </p>
  167. </div>
  168. </div>
  169. </div>
  170. <!-- /MODULE Block cart -->