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

/tools/smarty/compile/a062d9fcfdfc8eee4db2c2e06da78867f483f53e.file.blockcart-json.tpl.php

http://marocmall.googlecode.com/
PHP | 206 lines | 197 code | 9 blank | 0 comment | 38 complexity | aa13e1018df7a1c76f3be2a45a684df3 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php /* Smarty version Smarty-3.0.7, created on 2011-12-30 10:15:19
  2. compiled from "C:\D\prestashoplf\prestashop/modules/blockcart/blockcart-json.tpl" */ ?>
  3. <?php /*%%SmartyHeaderCode:59294efd8f371bc512-06639396%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
  4. $_smarty_tpl->decodeProperties(array (
  5. 'file_dependency' =>
  6. array (
  7. 'a062d9fcfdfc8eee4db2c2e06da78867f483f53e' =>
  8. array (
  9. 0 => 'C:\\D\\prestashoplf\\prestashop/modules/blockcart/blockcart-json.tpl',
  10. 1 => 1324997574,
  11. 2 => 'file',
  12. ),
  13. ),
  14. 'nocache_hash' => '59294efd8f371bc512-06639396',
  15. 'function' =>
  16. array (
  17. ),
  18. 'has_nocache_code' => false,
  19. )); /*/%%SmartyHeaderCode%%*/?>
  20. <?php if (!is_callable('smarty_modifier_replace')) include 'C:\D\prestashoplf\prestashop\tools\smarty\plugins\modifier.replace.php';
  21. if (!is_callable('smarty_modifier_escape')) include 'C:\D\prestashoplf\prestashop\tools\smarty\plugins\modifier.escape.php';
  22. ?>
  23. {
  24. "products": [
  25. <?php if ($_smarty_tpl->getVariable('products')->value){?>
  26. <?php $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable;
  27. $_from = $_smarty_tpl->getVariable('products')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  28. $_smarty_tpl->tpl_vars['product']->total= $_smarty_tpl->_count($_from);
  29. $_smarty_tpl->tpl_vars['product']->iteration=0;
  30. if ($_smarty_tpl->tpl_vars['product']->total > 0){
  31. foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value){
  32. $_smarty_tpl->tpl_vars['product']->iteration++;
  33. $_smarty_tpl->tpl_vars['product']->last = $_smarty_tpl->tpl_vars['product']->iteration === $_smarty_tpl->tpl_vars['product']->total;
  34. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['products']['last'] = $_smarty_tpl->tpl_vars['product']->last;
  35. ?>
  36. <?php $_smarty_tpl->tpl_vars['productId'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['id_product'], null, null);?>
  37. <?php $_smarty_tpl->tpl_vars['productAttributeId'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['id_product_attribute'], null, null);?>
  38. {
  39. "id": <?php echo $_smarty_tpl->tpl_vars['product']->value['id_product'];?>
  40. ,
  41. "link": "<?php echo smarty_modifier_replace(addslashes($_smarty_tpl->getVariable('link')->value->getProductLink($_smarty_tpl->tpl_vars['product']->value['id_product'],$_smarty_tpl->tpl_vars['product']->value['link_rewrite'],$_smarty_tpl->tpl_vars['product']->value['category'])),'\\\'','\'');?>
  42. ",
  43. "quantity": <?php echo $_smarty_tpl->tpl_vars['product']->value['cart_quantity'];?>
  44. ,
  45. "priceByLine": "<?php if ($_smarty_tpl->getVariable('priceDisplay')->value==@PS_TAX_EXC){?><?php ob_start();?><?php echo Product::displayWtPrice(array('p'=>$_smarty_tpl->tpl_vars['product']->value['total']),$_smarty_tpl);?>
  46. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }else{ ?><?php ob_start();?><?php echo Product::displayWtPrice(array('p'=>$_smarty_tpl->tpl_vars['product']->value['total_wt']),$_smarty_tpl);?>
  47. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }?>",
  48. "name": "<?php echo smarty_modifier_truncate(smarty_modifier_escape(html_entity_decode($_smarty_tpl->tpl_vars['product']->value['name'],2,'UTF-8')),15,'...',true);?>
  49. ",
  50. "price": "<?php if ($_smarty_tpl->getVariable('priceDisplay')->value==@PS_TAX_EXC){?><?php ob_start();?><?php echo Product::displayWtPrice(array('p'=>$_smarty_tpl->tpl_vars['product']->value['total']),$_smarty_tpl);?>
  51. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }else{ ?><?php ob_start();?><?php echo Product::displayWtPrice(array('p'=>$_smarty_tpl->tpl_vars['product']->value['total_wt']),$_smarty_tpl);?>
  52. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }?>",
  53. "idCombination": <?php if (isset($_smarty_tpl->tpl_vars['product']->value['attributes_small'])){?><?php echo $_smarty_tpl->getVariable('productAttributeId')->value;?>
  54. <?php }else{ ?>0<?php }?>,
  55. <?php if (isset($_smarty_tpl->tpl_vars['product']->value['attributes_small'])){?>
  56. "hasAttributes": true,
  57. "attributes": "<?php echo smarty_modifier_replace(addslashes($_smarty_tpl->tpl_vars['product']->value['attributes_small']),'\\\'','\'');?>
  58. ",
  59. <?php }else{ ?>
  60. "hasAttributes": false,
  61. <?php }?>
  62. "hasCustomizedDatas": <?php if (isset($_smarty_tpl->getVariable('customizedDatas',null,true,false)->value[$_smarty_tpl->getVariable('productId',null,true,false)->value][$_smarty_tpl->getVariable('productAttributeId',null,true,false)->value])){?>true<?php }else{ ?>false<?php }?>,
  63. "customizedDatas":[
  64. <?php if (isset($_smarty_tpl->getVariable('customizedDatas',null,true,false)->value[$_smarty_tpl->getVariable('productId',null,true,false)->value][$_smarty_tpl->getVariable('productAttributeId',null,true,false)->value])){?>
  65. <?php $_smarty_tpl->tpl_vars['customization'] = new Smarty_Variable;
  66. $_smarty_tpl->tpl_vars['id_customization'] = new Smarty_Variable;
  67. $_from = $_smarty_tpl->getVariable('customizedDatas')->value[$_smarty_tpl->getVariable('productId')->value][$_smarty_tpl->getVariable('productAttributeId')->value]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  68. $_smarty_tpl->tpl_vars['customization']->total= $_smarty_tpl->_count($_from);
  69. $_smarty_tpl->tpl_vars['customization']->iteration=0;
  70. if ($_smarty_tpl->tpl_vars['customization']->total > 0){
  71. foreach ($_from as $_smarty_tpl->tpl_vars['customization']->key => $_smarty_tpl->tpl_vars['customization']->value){
  72. $_smarty_tpl->tpl_vars['id_customization']->value = $_smarty_tpl->tpl_vars['customization']->key;
  73. $_smarty_tpl->tpl_vars['customization']->iteration++;
  74. $_smarty_tpl->tpl_vars['customization']->last = $_smarty_tpl->tpl_vars['customization']->iteration === $_smarty_tpl->tpl_vars['customization']->total;
  75. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizedDatas']['last'] = $_smarty_tpl->tpl_vars['customization']->last;
  76. ?>{
  77. "customizationId": <?php echo $_smarty_tpl->tpl_vars['id_customization']->value;?>
  78. ,
  79. "quantity": "<?php echo $_smarty_tpl->tpl_vars['customization']->value['quantity'];?>
  80. ",
  81. "datas": [
  82. <?php $_smarty_tpl->tpl_vars['datas'] = new Smarty_Variable;
  83. $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable;
  84. $_from = $_smarty_tpl->tpl_vars['customization']->value['datas']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  85. $_smarty_tpl->tpl_vars['datas']->total= $_smarty_tpl->_count($_from);
  86. $_smarty_tpl->tpl_vars['datas']->iteration=0;
  87. if ($_smarty_tpl->tpl_vars['datas']->total > 0){
  88. foreach ($_from as $_smarty_tpl->tpl_vars['datas']->key => $_smarty_tpl->tpl_vars['datas']->value){
  89. $_smarty_tpl->tpl_vars['type']->value = $_smarty_tpl->tpl_vars['datas']->key;
  90. $_smarty_tpl->tpl_vars['datas']->iteration++;
  91. $_smarty_tpl->tpl_vars['datas']->last = $_smarty_tpl->tpl_vars['datas']->iteration === $_smarty_tpl->tpl_vars['datas']->total;
  92. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customization']['last'] = $_smarty_tpl->tpl_vars['datas']->last;
  93. ?>
  94. {
  95. "type": "<?php echo $_smarty_tpl->tpl_vars['type']->value;?>
  96. ",
  97. "datas":
  98. [
  99. <?php $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable;
  100. $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable;
  101. $_from = $_smarty_tpl->tpl_vars['datas']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  102. $_smarty_tpl->tpl_vars['data']->total= $_smarty_tpl->_count($_from);
  103. $_smarty_tpl->tpl_vars['data']->iteration=0;
  104. if ($_smarty_tpl->tpl_vars['data']->total > 0){
  105. foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
  106. $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['data']->key;
  107. $_smarty_tpl->tpl_vars['data']->iteration++;
  108. $_smarty_tpl->tpl_vars['data']->last = $_smarty_tpl->tpl_vars['data']->iteration === $_smarty_tpl->tpl_vars['data']->total;
  109. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['datas']['last'] = $_smarty_tpl->tpl_vars['data']->last;
  110. ?>
  111. {
  112. "index": <?php echo $_smarty_tpl->tpl_vars['index']->value;?>
  113. ,
  114. "value": "<?php echo smarty_modifier_replace(addslashes($_smarty_tpl->tpl_vars['data']->value['value']),'\\\'','\'');?>
  115. ",
  116. "truncatedValue": "<?php echo smarty_modifier_replace(addslashes(smarty_modifier_truncate($_smarty_tpl->tpl_vars['data']->value['value'],28,'...')),'\\\'','\'');?>
  117. "
  118. }<?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['datas']['last']){?>,<?php }?>
  119. <?php }} ?>]
  120. }<?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['customization']['last']){?>,<?php }?>
  121. <?php }} ?>
  122. ]
  123. }<?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['customizedDatas']['last']){?>,<?php }?>
  124. <?php }} ?>
  125. <?php }?>
  126. ]
  127. }<?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['products']['last']){?>,<?php }?>
  128. <?php }} ?><?php }?>
  129. ],
  130. "discounts": [
  131. <?php if ($_smarty_tpl->getVariable('discounts')->value){?><?php $_smarty_tpl->tpl_vars['discount'] = new Smarty_Variable;
  132. $_from = $_smarty_tpl->getVariable('discounts')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  133. $_smarty_tpl->tpl_vars['discount']->total= $_smarty_tpl->_count($_from);
  134. $_smarty_tpl->tpl_vars['discount']->iteration=0;
  135. if ($_smarty_tpl->tpl_vars['discount']->total > 0){
  136. foreach ($_from as $_smarty_tpl->tpl_vars['discount']->key => $_smarty_tpl->tpl_vars['discount']->value){
  137. $_smarty_tpl->tpl_vars['discount']->iteration++;
  138. $_smarty_tpl->tpl_vars['discount']->last = $_smarty_tpl->tpl_vars['discount']->iteration === $_smarty_tpl->tpl_vars['discount']->total;
  139. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['discounts']['last'] = $_smarty_tpl->tpl_vars['discount']->last;
  140. ?>
  141. {
  142. "id": "<?php echo $_smarty_tpl->tpl_vars['discount']->value['id_discount'];?>
  143. ",
  144. "name": "<?php echo smarty_modifier_replace(addslashes(smarty_modifier_truncate((($_smarty_tpl->tpl_vars['discount']->value['name']).(' : ')).($_smarty_tpl->tpl_vars['discount']->value['description']),18,'...')),'\\\'','\'');?>
  145. ",
  146. "description": "<?php echo smarty_modifier_replace(addslashes($_smarty_tpl->tpl_vars['discount']->value['description']),'\\\'','\'');?>
  147. ",
  148. "nameDescription": "<?php echo smarty_modifier_replace(addslashes(smarty_modifier_truncate((($_smarty_tpl->tpl_vars['discount']->value['name']).(' : ')).($_smarty_tpl->tpl_vars['discount']->value['description']),18,'...')),'\\\'','\'');?>
  149. ",
  150. "link": "<?php echo $_smarty_tpl->getVariable('link')->value->getPageLink('order.php',true);?>
  151. ?deleteDiscount=<?php echo $_smarty_tpl->tpl_vars['discount']->value['id_discount'];?>
  152. ",
  153. "price": "-<?php if ($_smarty_tpl->tpl_vars['discount']->value['value_real']!='!'){?><?php if ($_smarty_tpl->getVariable('priceDisplay')->value==1){?><?php ob_start();?><?php echo Product::convertPrice(array('price'=>$_smarty_tpl->tpl_vars['discount']->value['value_tax_exc']),$_smarty_tpl);?>
  154. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }else{ ?><?php ob_start();?><?php echo Product::convertPrice(array('price'=>$_smarty_tpl->tpl_vars['discount']->value['value_real']),$_smarty_tpl);?>
  155. <?php echo html_entity_decode(ob_get_clean(),2,'UTF-8')?><?php }?><?php }?>"
  156. }
  157. <?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['discounts']['last']){?>,<?php }?>
  158. <?php }} ?><?php }?>
  159. ],
  160. "shippingCost": "<?php echo html_entity_decode($_smarty_tpl->getVariable('shipping_cost')->value,2,'UTF-8');?>
  161. ",
  162. <?php if (isset($_smarty_tpl->getVariable('tax_cost',null,true,false)->value)){?>
  163. "taxCost": "<?php echo html_entity_decode($_smarty_tpl->getVariable('tax_cost')->value,2,'UTF-8');?>
  164. ",
  165. <?php }?>
  166. "wrappingCost": "<?php echo html_entity_decode($_smarty_tpl->getVariable('wrapping_cost')->value,2,'UTF-8');?>
  167. ",
  168. "nbTotalProducts": "<?php echo $_smarty_tpl->getVariable('nb_total_products')->value;?>
  169. ",
  170. "total": "<?php echo html_entity_decode($_smarty_tpl->getVariable('total')->value,2,'UTF-8');?>
  171. ",
  172. "productTotal": "<?php echo html_entity_decode($_smarty_tpl->getVariable('product_total')->value,2,'UTF-8');?>
  173. ",
  174. <?php if (isset($_smarty_tpl->getVariable('errors',null,true,false)->value)&&$_smarty_tpl->getVariable('errors')->value){?>
  175. "hasError" : true,
  176. "errors" : [
  177. <?php $_smarty_tpl->tpl_vars['error'] = new Smarty_Variable;
  178. $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
  179. $_from = $_smarty_tpl->getVariable('errors')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  180. $_smarty_tpl->tpl_vars['error']->total= $_smarty_tpl->_count($_from);
  181. $_smarty_tpl->tpl_vars['error']->iteration=0;
  182. if ($_smarty_tpl->tpl_vars['error']->total > 0){
  183. foreach ($_from as $_smarty_tpl->tpl_vars['error']->key => $_smarty_tpl->tpl_vars['error']->value){
  184. $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['error']->key;
  185. $_smarty_tpl->tpl_vars['error']->iteration++;
  186. $_smarty_tpl->tpl_vars['error']->last = $_smarty_tpl->tpl_vars['error']->iteration === $_smarty_tpl->tpl_vars['error']->total;
  187. $_smarty_tpl->tpl_vars['smarty']->value['foreach']['errors']['last'] = $_smarty_tpl->tpl_vars['error']->last;
  188. ?>
  189. "<?php echo html_entity_decode(addslashes($_smarty_tpl->tpl_vars['error']->value),2,'UTF-8');?>
  190. "
  191. <?php if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['errors']['last']){?>,<?php }?>
  192. <?php }} ?>
  193. ]
  194. <?php }else{ ?>
  195. "hasError" : false
  196. <?php }?>
  197. }