PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/smarty_v2/compile/%%BE^BE6^BE684E69%%order-address.tpl.php

http://marocmall.googlecode.com/
PHP | 302 lines | 258 code | 42 blank | 2 comment | 60 complexity | e79281fb5af54536e0b4336008ddc6af MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php /* Smarty version 2.6.20, created on 2011-12-03 16:26:52
  2. compiled from C:%5CD%5CMarocMall/themes/prestashop/order-address.tpl */ ?>
  3. <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
  4. smarty_core_load_plugins(array('plugins' => array(array('function', 'counter', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 48, false),array('function', 'l', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 69, false),array('modifier', 'html_entity_decode', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 65, false),array('modifier', 'floatval', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 66, false),array('modifier', 'intval', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 67, false),array('modifier', 'escape', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 171, false),array('modifier', 'count', 'C:\\D\\MarocMall/themes/prestashop/order-address.tpl', 177, false),)), $this); ?>
  5. <?php if (! isset ( $this->_tpl_vars['formatedAddressFieldsValuesList'] )): ?>
  6. <?php echo $this->_tpl_vars['ignoreList']['0']; ?>
  7. <?php echo $this->_tpl_vars['ignoreList']['1']; ?>
  8. <?php echo $this->_tpl_vars['ignoreList']['2']; ?>
  9. <?php echo $this->_tpl_vars['ignoreList']['3']; ?>
  10. <?php echo $this->_tpl_vars['ignoreList']['4']; ?>
  11. <?php echo $this->_tpl_vars['ignoreList']['5']; ?>
  12. <?php echo $this->_tpl_vars['ignoreList']['6']; ?>
  13. <?php echo $this->_tpl_vars['ignoreList']['7']; ?>
  14. <?php echo $this->_tpl_vars['ignoreList']['8']; ?>
  15. <?php echo $this->_tpl_vars['ignoreList']['9']; ?>
  16. <?php if (isset ( $this->_tpl_vars['addresses'] )): ?>
  17. <?php $_from = $this->_tpl_vars['addresses']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  18. foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['address']):
  19. ?>
  20. <?php echo smarty_function_counter(array('start' => 0,'skip' => 1,'assign' => 'address_key_number'), $this);?>
  21. <?php echo $this->_tpl_vars['id_address']; ?>
  22. <?php $_from = $this->_tpl_vars['address']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  23. foreach ($_from as $this->_tpl_vars['address_key'] => $this->_tpl_vars['address_content']):
  24. ?>
  25. <?php if (! in_array ( $this->_tpl_vars['address_key'] , $this->_tpl_vars['ignoreList'] )): ?>
  26. <?php echo $this->_tpl_vars['formatedAddressFieldsValuesList'][$this->_tpl_vars['id_address']]['ordered_fields'][$this->_tpl_vars['address_key_number']]; ?>
  27. <?php echo $this->_tpl_vars['formatedAddressFieldsValuesList'][$this->_tpl_vars['id_address']]['formated_fields_values'][$this->_tpl_vars['address_key']]; ?>
  28. <?php echo smarty_function_counter(array(), $this);?>
  29. <?php endif; ?>
  30. <?php endforeach; endif; unset($_from); ?>
  31. <?php endforeach; endif; unset($_from); ?>
  32. <?php endif; ?>
  33. <?php endif; ?>
  34. <script type="text/javascript">
  35. // <![CDATA[
  36. <?php if (! $this->_tpl_vars['opc']): ?>
  37. var orderProcess = 'order';
  38. var currencySign = '<?php echo ((is_array($_tmp=$this->_tpl_vars['currencySign'])) ? $this->_run_mod_handler('html_entity_decode', true, $_tmp, 2, "UTF-8") : html_entity_decode($_tmp, 2, "UTF-8")); ?>
  39. ';
  40. var currencyRate = '<?php echo ((is_array($_tmp=$this->_tpl_vars['currencyRate'])) ? $this->_run_mod_handler('floatval', true, $_tmp) : floatval($_tmp)); ?>
  41. ';
  42. var currencyFormat = '<?php echo ((is_array($_tmp=$this->_tpl_vars['currencyFormat'])) ? $this->_run_mod_handler('intval', true, $_tmp) : intval($_tmp)); ?>
  43. ';
  44. var currencyBlank = '<?php echo ((is_array($_tmp=$this->_tpl_vars['currencyBlank'])) ? $this->_run_mod_handler('intval', true, $_tmp) : intval($_tmp)); ?>
  45. ';
  46. var txtProduct = "<?php echo smartyTranslate(array('s' => 'product'), $this);?>
  47. ";
  48. var txtProducts = "<?php echo smartyTranslate(array('s' => 'products'), $this);?>
  49. ";
  50. <?php endif; ?>
  51. var formatedAddressFieldsValuesList = new Array();
  52. <?php $_from = $this->_tpl_vars['formatedAddressFieldsValuesList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  53. foreach ($_from as $this->_tpl_vars['id_address'] => $this->_tpl_vars['type']):
  54. ?>
  55. formatedAddressFieldsValuesList[<?php echo $this->_tpl_vars['id_address']; ?>
  56. ] =
  57. {
  58. 'ordered_fields':[
  59. <?php $_from = $this->_tpl_vars['type']['ordered_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['inv_loop'] = array('total' => count($_from), 'iteration' => 0);
  60. if ($this->_foreach['inv_loop']['total'] > 0):
  61. foreach ($_from as $this->_tpl_vars['num_field'] => $this->_tpl_vars['field_name']):
  62. $this->_foreach['inv_loop']['iteration']++;
  63. ?>
  64. <?php if (! ($this->_foreach['inv_loop']['iteration'] <= 1)): ?>,<?php endif; ?>"<?php echo $this->_tpl_vars['field_name']; ?>
  65. "
  66. <?php endforeach; endif; unset($_from); ?>
  67. ],
  68. 'formated_fields_values':{
  69. <?php $_from = $this->_tpl_vars['type']['formated_fields_values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['inv_loop'] = array('total' => count($_from), 'iteration' => 0);
  70. if ($this->_foreach['inv_loop']['total'] > 0):
  71. foreach ($_from as $this->_tpl_vars['pattern_name'] => $this->_tpl_vars['field_name']):
  72. $this->_foreach['inv_loop']['iteration']++;
  73. ?>
  74. <?php if (! ($this->_foreach['inv_loop']['iteration'] <= 1)): ?>,<?php endif; ?>"<?php echo $this->_tpl_vars['pattern_name']; ?>
  75. ":"<?php echo $this->_tpl_vars['field_name']; ?>
  76. "
  77. <?php endforeach; endif; unset($_from); ?>
  78. }
  79. }
  80. <?php endforeach; endif; unset($_from); ?>
  81. function getAddressesTitles()
  82. {
  83. return {
  84. 'invoice': "<?php echo smartyTranslate(array('s' => 'Your billing address'), $this);?>
  85. ",
  86. 'delivery': "<?php echo smartyTranslate(array('s' => 'Your delivery address'), $this);?>
  87. "
  88. };
  89. }
  90. function buildAddressBlock(id_address, address_type, dest_comp)
  91. {
  92. var adr_titles_vals = getAddressesTitles();
  93. var li_content = formatedAddressFieldsValuesList[id_address]['formated_fields_values'];
  94. var ordered_fields_name = ['title'];
  95. ordered_fields_name = ordered_fields_name.concat(formatedAddressFieldsValuesList[id_address]['ordered_fields']);
  96. ordered_fields_name = ordered_fields_name.concat(['update']);
  97. dest_comp.html('');
  98. li_content['title'] = adr_titles_vals[address_type];
  99. li_content['update'] = '<a href="<?php echo $this->_tpl_vars['link']->getPageLink('address.php',true); ?>
  100. ?id_address='+id_address+'&amp;back=order.php?step=1<?php if ($this->_tpl_vars['back']): ?>&mod=<?php echo $this->_tpl_vars['back']; ?>
  101. <?php endif; ?>" title="<?php echo smartyTranslate(array('s' => 'Update'), $this);?>
  102. "><?php echo smartyTranslate(array('s' => 'Update'), $this);?>
  103. </a>';
  104. appendAddressList(dest_comp, li_content, ordered_fields_name);
  105. }
  106. function appendAddressList(dest_comp, values, fields_name)
  107. {
  108. for (var item in fields_name)
  109. {
  110. var name = fields_name[item];
  111. var value = getFieldValue(name, values);
  112. if (value != "")
  113. {
  114. var new_li = document.createElement('li');
  115. new_li.className = 'address_'+ name;
  116. new_li.innerHTML = getFieldValue(name, values);
  117. dest_comp.append(new_li);
  118. }
  119. }
  120. }
  121. function getFieldValue(field_name, values)
  122. {
  123. var reg=new RegExp("[ ]+", "g");
  124. var items = field_name.split(reg);
  125. var vals = new Array();
  126. for (var field_item in items)
  127. vals.push(values[items[field_item]]);
  128. return vals.join(" ");
  129. }
  130. //]]>
  131. </script>
  132. <?php if (! $this->_tpl_vars['opc']): ?>
  133. <?php ob_start(); ?><?php echo smartyTranslate(array('s' => 'Addresses'), $this);?>
  134. <?php $this->_smarty_vars['capture']['path'] = ob_get_contents(); ob_end_clean(); ?>
  135. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  136. $this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['tpl_dir'])."./breadcrumb.tpl", 'smarty_include_vars' => array()));
  137. $this->_tpl_vars = $_smarty_tpl_vars;
  138. unset($_smarty_tpl_vars);
  139. ?>
  140. <?php endif; ?>
  141. <?php if (! $this->_tpl_vars['opc']): ?><h1><?php echo smartyTranslate(array('s' => 'Addresses'), $this);?>
  142. </h1><?php else: ?><h2>1. <?php echo smartyTranslate(array('s' => 'Addresses'), $this);?>
  143. </h2><?php endif; ?>
  144. <?php if (! $this->_tpl_vars['opc']): ?>
  145. <?php $this->assign('current_step', 'address'); ?>
  146. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  147. $this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['tpl_dir'])."./order-steps.tpl", 'smarty_include_vars' => array()));
  148. $this->_tpl_vars = $_smarty_tpl_vars;
  149. unset($_smarty_tpl_vars);
  150. ?>
  151. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  152. $this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['tpl_dir'])."./errors.tpl", 'smarty_include_vars' => array()));
  153. $this->_tpl_vars = $_smarty_tpl_vars;
  154. unset($_smarty_tpl_vars);
  155. ?>
  156. <form action="<?php echo $this->_tpl_vars['link']->getPageLink('order.php',true); ?>
  157. " method="post">
  158. <?php else: ?>
  159. <div id="opc_account" class="opc-main-block">
  160. <div id="opc_account-overlay" class="opc-overlay" style="display:none;"></div>
  161. <?php endif; ?>
  162. <div class="addresses">
  163. <p class="address_delivery select">
  164. <label for="id_address_delivery"><?php echo smartyTranslate(array('s' => 'Choose a delivery address:'), $this);?>
  165. </label>
  166. <select name="id_address_delivery" id="id_address_delivery" class="address_select" onchange="updateAddressesDisplay();<?php if ($this->_tpl_vars['opc']): ?>updateAddressSelection();<?php endif; ?>">
  167. <?php $_from = $this->_tpl_vars['addresses']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  168. foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['address']):
  169. ?>
  170. <option value="<?php echo ((is_array($_tmp=$this->_tpl_vars['address']['id_address'])) ? $this->_run_mod_handler('intval', true, $_tmp) : intval($_tmp)); ?>
  171. " <?php if ($this->_tpl_vars['address']['id_address'] == $this->_tpl_vars['cart']->id_address_delivery): ?>selected="selected"<?php endif; ?>><?php echo ((is_array($_tmp=$this->_tpl_vars['address']['alias'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlall', 'UTF-8') : smarty_modifier_escape($_tmp, 'htmlall', 'UTF-8')); ?>
  172. </option>
  173. <?php endforeach; endif; unset($_from); ?>
  174. </select>
  175. </p>
  176. <p class="checkbox" <?php if ($this->_tpl_vars['cart']->isVirtualCart()): ?>style="display:none;"<?php endif; ?>>
  177. <input type="checkbox" name="same" id="addressesAreEquals" value="1" onclick="updateAddressesDisplay();<?php if ($this->_tpl_vars['opc']): ?>updateAddressSelection();<?php endif; ?>" <?php if ($this->_tpl_vars['cart']->id_address_invoice == $this->_tpl_vars['cart']->id_address_delivery || count($this->_tpl_vars['addresses']) == 1): ?>checked="checked"<?php endif; ?> />
  178. <label for="addressesAreEquals"><?php echo smartyTranslate(array('s' => 'Use the same address for billing.'), $this);?>
  179. </label>
  180. </p>
  181. <p id="address_invoice_form" class="select" <?php if ($this->_tpl_vars['cart']->id_address_invoice == $this->_tpl_vars['cart']->id_address_delivery): ?>style="display: none;"<?php endif; ?>>
  182. <?php if (count($this->_tpl_vars['addresses']) > 1): ?>
  183. <label for="id_address_invoice" class="strong"><?php echo smartyTranslate(array('s' => 'Choose a billing address:'), $this);?>
  184. </label>
  185. <select name="id_address_invoice" id="id_address_invoice" class="address_select" onchange="updateAddressesDisplay();<?php if ($this->_tpl_vars['opc']): ?>updateAddressSelection();<?php endif; ?>">
  186. <?php unset($this->_sections['address']);
  187. $this->_sections['address']['loop'] = is_array($_loop=$this->_tpl_vars['addresses']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
  188. $this->_sections['address']['step'] = ((int)-1) == 0 ? 1 : (int)-1;
  189. $this->_sections['address']['name'] = 'address';
  190. $this->_sections['address']['show'] = true;
  191. $this->_sections['address']['max'] = $this->_sections['address']['loop'];
  192. $this->_sections['address']['start'] = $this->_sections['address']['step'] > 0 ? 0 : $this->_sections['address']['loop']-1;
  193. if ($this->_sections['address']['show']) {
  194. $this->_sections['address']['total'] = min(ceil(($this->_sections['address']['step'] > 0 ? $this->_sections['address']['loop'] - $this->_sections['address']['start'] : $this->_sections['address']['start']+1)/abs($this->_sections['address']['step'])), $this->_sections['address']['max']);
  195. if ($this->_sections['address']['total'] == 0)
  196. $this->_sections['address']['show'] = false;
  197. } else
  198. $this->_sections['address']['total'] = 0;
  199. if ($this->_sections['address']['show']):
  200. for ($this->_sections['address']['index'] = $this->_sections['address']['start'], $this->_sections['address']['iteration'] = 1;
  201. $this->_sections['address']['iteration'] <= $this->_sections['address']['total'];
  202. $this->_sections['address']['index'] += $this->_sections['address']['step'], $this->_sections['address']['iteration']++):
  203. $this->_sections['address']['rownum'] = $this->_sections['address']['iteration'];
  204. $this->_sections['address']['index_prev'] = $this->_sections['address']['index'] - $this->_sections['address']['step'];
  205. $this->_sections['address']['index_next'] = $this->_sections['address']['index'] + $this->_sections['address']['step'];
  206. $this->_sections['address']['first'] = ($this->_sections['address']['iteration'] == 1);
  207. $this->_sections['address']['last'] = ($this->_sections['address']['iteration'] == $this->_sections['address']['total']);
  208. ?>
  209. <option value="<?php echo ((is_array($_tmp=$this->_tpl_vars['addresses'][$this->_sections['address']['index']]['id_address'])) ? $this->_run_mod_handler('intval', true, $_tmp) : intval($_tmp)); ?>
  210. " <?php if ($this->_tpl_vars['addresses'][$this->_sections['address']['index']]['id_address'] == $this->_tpl_vars['cart']->id_address_invoice && $this->_tpl_vars['cart']->id_address_delivery != $this->_tpl_vars['cart']->id_address_invoice): ?>selected="selected"<?php endif; ?>><?php echo ((is_array($_tmp=$this->_tpl_vars['addresses'][$this->_sections['address']['index']]['alias'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlall', 'UTF-8') : smarty_modifier_escape($_tmp, 'htmlall', 'UTF-8')); ?>
  211. </option>
  212. <?php endfor; endif; ?>
  213. </select>
  214. <?php else: ?>
  215. <a style="margin-left: 221px;" href="<?php echo $this->_tpl_vars['link']->getPageLink('address.php',true); ?>
  216. ?back=order.php?step=1&select_address=1<?php if ($this->_tpl_vars['back']): ?>&mod=<?php echo $this->_tpl_vars['back']; ?>
  217. <?php endif; ?>" title="<?php echo smartyTranslate(array('s' => 'Add'), $this);?>
  218. " class="button_large"><?php echo smartyTranslate(array('s' => 'Add a new address'), $this);?>
  219. </a>
  220. <?php endif; ?>
  221. </p>
  222. <div class="clear"></div>
  223. <ul class="address item" id="address_delivery" <?php if ($this->_tpl_vars['cart']->isVirtualCart()): ?>style="display:none;"<?php endif; ?>>
  224. </ul>
  225. <ul class="address alternate_item <?php if ($this->_tpl_vars['cart']->isVirtualCart()): ?>full_width<?php endif; ?>" id="address_invoice">
  226. </ul>
  227. <br class="clear" />
  228. <p class="address_add submit">
  229. <a href="<?php echo $this->_tpl_vars['link']->getPageLink('address.php',true); ?>
  230. ?back=order.php?step=1<?php if ($this->_tpl_vars['back']): ?>&mod=<?php echo $this->_tpl_vars['back']; ?>
  231. <?php endif; ?>" title="<?php echo smartyTranslate(array('s' => 'Add'), $this);?>
  232. " class="button_large"><?php echo smartyTranslate(array('s' => 'Add a new address'), $this);?>
  233. </a>
  234. </p>
  235. <?php if (! $this->_tpl_vars['opc']): ?>
  236. <div id="ordermsg">
  237. <p><?php echo smartyTranslate(array('s' => 'If you would like to add a comment about your order, please write it below.'), $this);?>
  238. </p>
  239. <p class="textarea"><textarea cols="60" rows="3" name="message"><?php if (isset ( $this->_tpl_vars['oldMessage'] )): ?><?php echo $this->_tpl_vars['oldMessage']; ?>
  240. <?php endif; ?></textarea></p>
  241. </div>
  242. <?php endif; ?>
  243. </div>
  244. <?php if (! $this->_tpl_vars['opc']): ?>
  245. <p class="cart_navigation submit">
  246. <input type="hidden" class="hidden" name="step" value="2" />
  247. <input type="hidden" name="back" value="<?php echo $this->_tpl_vars['back']; ?>
  248. " />
  249. <a href="<?php echo $this->_tpl_vars['link']->getPageLink('order.php',true); ?>
  250. ?step=0<?php if ($this->_tpl_vars['back']): ?>&back=<?php echo $this->_tpl_vars['back']; ?>
  251. <?php endif; ?>" title="<?php echo smartyTranslate(array('s' => 'Previous'), $this);?>
  252. " class="button">&laquo; <?php echo smartyTranslate(array('s' => 'Previous'), $this);?>
  253. </a>
  254. <input type="submit" name="processAddress" value="<?php echo smartyTranslate(array('s' => 'Next'), $this);?>
  255. &raquo;" class="exclusive" />
  256. </p>
  257. </form>
  258. <?php else: ?>
  259. </div>
  260. <?php endif; ?>