PageRenderTime 29ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/prestashop/_/cache/smarty/compile/8f/a2/ae/8fa2ae01921b1b9b67f8ebd83865194beb463564.file.content.tpl.php

https://gitlab.com/A.Julien/sendstockbymail-module-prestashop
PHP | 242 lines | 226 code | 16 blank | 0 comment | 20 complexity | 4487c4fbd4772b28688770ffa057d403 MD5 | raw file
  1. <?php /* Smarty version Smarty-3.1.19, created on 2016-08-29 22:06:33
  2. compiled from "C:\xampp\htdocs\prestashop\prestashop\_\admin\themes\default\template\controllers\attribute_generator\content.tpl" */ ?>
  3. <?php /*%%SmartyHeaderCode:2008957c495c99394c3-32613491%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
  4. $_valid = $_smarty_tpl->decodeProperties(array (
  5. 'file_dependency' =>
  6. array (
  7. '8fa2ae01921b1b9b67f8ebd83865194beb463564' =>
  8. array (
  9. 0 => 'C:\\xampp\\htdocs\\prestashop\\prestashop\\_\\admin\\themes\\default\\template\\controllers\\attribute_generator\\content.tpl',
  10. 1 => 1472500717,
  11. 2 => 'file',
  12. ),
  13. ),
  14. 'nocache_hash' => '2008957c495c99394c3-32613491',
  15. 'function' =>
  16. array (
  17. ),
  18. 'variables' =>
  19. array (
  20. 'attribute_js' => 0,
  21. 'idgrp' => 0,
  22. 'group' => 0,
  23. 'row' => 0,
  24. 'idattr' => 0,
  25. 'attrname' => 0,
  26. 'tax_rates' => 0,
  27. 'generate' => 0,
  28. 'combinations_size' => 0,
  29. 'url_generator' => 0,
  30. 'attribute_groups' => 0,
  31. 'attribute_group' => 0,
  32. 'k' => 0,
  33. 'v' => 0,
  34. 'product_name' => 0,
  35. 'currency_sign' => 0,
  36. 'weight_unit' => 0,
  37. 'attributes' => 0,
  38. 'attribute' => 0,
  39. 'product_reference' => 0,
  40. ),
  41. 'has_nocache_code' => false,
  42. 'version' => 'Smarty-3.1.19',
  43. 'unifunc' => 'content_57c495c9b29353_72540570',
  44. ),false); /*/%%SmartyHeaderCode%%*/?>
  45. <?php if ($_valid && !is_callable('content_57c495c9b29353_72540570')) {function content_57c495c9b29353_72540570($_smarty_tpl) {?>
  46. <script type="text/javascript">
  47. var attrs = new Array();
  48. attrs[0] = new Array(0, '---');
  49. <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['group']->_loop = false;
  50. $_smarty_tpl->tpl_vars['idgrp'] = new Smarty_Variable;
  51. $_from = $_smarty_tpl->tpl_vars['attribute_js']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  52. foreach ($_from as $_smarty_tpl->tpl_vars['group']->key => $_smarty_tpl->tpl_vars['group']->value) {
  53. $_smarty_tpl->tpl_vars['group']->_loop = true;
  54. $_smarty_tpl->tpl_vars['idgrp']->value = $_smarty_tpl->tpl_vars['group']->key;
  55. ?>
  56. <?php $_smarty_tpl->tpl_vars["row"] = new Smarty_variable("attrs[".((string)$_smarty_tpl->tpl_vars['idgrp']->value)."] = new Array(0, '---'", null, 0);?>
  57. <?php $_smarty_tpl->tpl_vars['attrname'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['attrname']->_loop = false;
  58. $_smarty_tpl->tpl_vars['idattr'] = new Smarty_Variable;
  59. $_from = $_smarty_tpl->tpl_vars['group']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  60. foreach ($_from as $_smarty_tpl->tpl_vars['attrname']->key => $_smarty_tpl->tpl_vars['attrname']->value) {
  61. $_smarty_tpl->tpl_vars['attrname']->_loop = true;
  62. $_smarty_tpl->tpl_vars['idattr']->value = $_smarty_tpl->tpl_vars['attrname']->key;
  63. ?>
  64. <?php ob_start();?><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attrname']->value, ENT_QUOTES, 'UTF-8', true);?>
  65. <?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["row"] = new Smarty_variable(((string)$_smarty_tpl->tpl_vars['row']->value).", ".((string)$_smarty_tpl->tpl_vars['idattr']->value).", '".$_tmp1."'", null, 0);?>
  66. <?php } ?>
  67. <?php $_smarty_tpl->tpl_vars["row"] = new Smarty_variable(((string)$_smarty_tpl->tpl_vars['row']->value).");", null, 0);?>
  68. <?php echo $_smarty_tpl->tpl_vars['row']->value;?>
  69. <?php } ?>
  70. i18n_tax_exc = '<?php echo smartyTranslate(array('s'=>'Tax Excluded'),$_smarty_tpl);?>
  71. ';
  72. i18n_tax_inc = '<?php echo smartyTranslate(array('s'=>'Tax Included'),$_smarty_tpl);?>
  73. ';
  74. var product_tax = '<?php echo $_smarty_tpl->tpl_vars['tax_rates']->value;?>
  75. ';
  76. function calcPrice(element, element_has_tax)
  77. {
  78. var element_price = element.val().replace(/,/g, '.');
  79. var other_element_price = 0;
  80. if (!isNaN(element_price))
  81. {
  82. if (element_has_tax)
  83. other_element_price = parseFloat(element_price / ((product_tax / 100) + 1)).toFixed(6);
  84. else
  85. other_element_price = ps_round(parseFloat(element_price * ((product_tax / 100) + 1)), 2).toFixed(2);
  86. }
  87. $('#related_to_'+element.attr('name')).val(other_element_price);
  88. }
  89. $(document).ready(function() { $('.price_impact').each(function() { calcPrice($(this), false); }); });
  90. </script>
  91. <div class="leadin"></div>
  92. <?php if ($_smarty_tpl->tpl_vars['generate']->value) {?><div class="alert alert-success clearfix"><?php echo smartyTranslate(array('s'=>'%d product(s) successfully created.','sprintf'=>$_smarty_tpl->tpl_vars['combinations_size']->value),$_smarty_tpl);?>
  93. </div><?php }?>
  94. <form enctype="multipart/form-data" method="post" id="generator" action="<?php echo $_smarty_tpl->tpl_vars['url_generator']->value;?>
  95. ">
  96. <div class="panel">
  97. <h3>
  98. <i class="icon-asterisk"></i>
  99. <?php echo smartyTranslate(array('s'=>'Attributes generator'),$_smarty_tpl);?>
  100. </h3>
  101. <div class="row">
  102. <div class="col-lg-3">
  103. <div class="form-group">
  104. <select multiple name="attributes[]" id="attribute_group" style="height: 500px">
  105. <?php $_smarty_tpl->tpl_vars['attribute_group'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['attribute_group']->_loop = false;
  106. $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
  107. $_from = $_smarty_tpl->tpl_vars['attribute_groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  108. foreach ($_from as $_smarty_tpl->tpl_vars['attribute_group']->key => $_smarty_tpl->tpl_vars['attribute_group']->value) {
  109. $_smarty_tpl->tpl_vars['attribute_group']->_loop = true;
  110. $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['attribute_group']->key;
  111. ?>
  112. <?php if (isset($_smarty_tpl->tpl_vars['attribute_js']->value[$_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group']])) {?>
  113. <optgroup name="<?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  114. " id="<?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  115. " label="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute_group']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
  116. ">
  117. <?php $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
  118. $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
  119. $_from = $_smarty_tpl->tpl_vars['attribute_js']->value[$_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  120. foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
  121. $_smarty_tpl->tpl_vars['v']->_loop = true;
  122. $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
  123. ?>
  124. <option name="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  125. " id="attr_<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  126. " value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8', true);?>
  127. " title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8', true);?>
  128. "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8', true);?>
  129. </option>
  130. <?php } ?>
  131. </optgroup>
  132. <?php }?>
  133. <?php } ?>
  134. </select>
  135. </div>
  136. <div class="form-group">
  137. <button type="button" class="btn btn-default" onclick="del_attr_multiple();"><i class="icon-minus-sign"></i> <?php echo smartyTranslate(array('s'=>'Delete'),$_smarty_tpl);?>
  138. </button>
  139. <button type="button" class="btn btn-default pull-right" onclick="add_attr_multiple();"><i class="icon-plus-sign"></i> <?php echo smartyTranslate(array('s'=>'Add'),$_smarty_tpl);?>
  140. </button>
  141. </div>
  142. </div>
  143. <div class="col-lg-8 col-lg-offset-1">
  144. <div class="alert alert-info"><?php echo smartyTranslate(array('s'=>'The Combinations Generator is a tool that allows you to easily create a series of combinations by selecting the related attributes. For example, if you\'re selling t-shirts in three different sizes and two different colors, the generator will create six combinations for you.'),$_smarty_tpl);?>
  145. </div>
  146. <div class="alert alert-info"><?php echo smartyTranslate(array('s'=>'You\'re currently generating combinations for the following product:'),$_smarty_tpl);?>
  147. <b><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product_name']->value, ENT_QUOTES, 'UTF-8', true);?>
  148. </b></div>
  149. <div class="alert alert-info"><strong><?php echo smartyTranslate(array('s'=>'Step 1: On the left side, select the attributes you want to use (Hold down the "Ctrl" key on your keyboard and validate by clicking on "Add")'),$_smarty_tpl);?>
  150. </strong></div>
  151. <?php $_smarty_tpl->tpl_vars['attribute_group'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['attribute_group']->_loop = false;
  152. $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
  153. $_from = $_smarty_tpl->tpl_vars['attribute_groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  154. foreach ($_from as $_smarty_tpl->tpl_vars['attribute_group']->key => $_smarty_tpl->tpl_vars['attribute_group']->value) {
  155. $_smarty_tpl->tpl_vars['attribute_group']->_loop = true;
  156. $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['attribute_group']->key;
  157. ?>
  158. <?php if (isset($_smarty_tpl->tpl_vars['attribute_js']->value[$_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group']])) {?>
  159. <div class="row">
  160. <table class="table" style="display:none">
  161. <thead>
  162. <tr>
  163. <th id="tab_h1" class="fixed-width-md"><span class="title_box"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute_group']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
  164. </span></th>
  165. <th id="tab_h2" colspan="2"><span class="title_box"><?php echo smartyTranslate(array('s'=>'Impact on the product price'),$_smarty_tpl);?>
  166. (<?php echo $_smarty_tpl->tpl_vars['currency_sign']->value;?>
  167. )</span></th>
  168. <th><span class="title_box"><?php echo smartyTranslate(array('s'=>'Impact on the product weight'),$_smarty_tpl);?>
  169. (<?php echo $_smarty_tpl->tpl_vars['weight_unit']->value;?>
  170. )</span></th>
  171. </tr>
  172. </thead>
  173. <tbody id="table_<?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  174. " name="result_table">
  175. </tbody>
  176. </table>
  177. </div>
  178. <?php if (isset($_smarty_tpl->tpl_vars['attributes']->value[$_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group']])) {?>
  179. <?php $_smarty_tpl->tpl_vars['attribute'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['attribute']->_loop = false;
  180. $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
  181. $_from = $_smarty_tpl->tpl_vars['attributes']->value[$_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  182. foreach ($_from as $_smarty_tpl->tpl_vars['attribute']->key => $_smarty_tpl->tpl_vars['attribute']->value) {
  183. $_smarty_tpl->tpl_vars['attribute']->_loop = true;
  184. $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['attribute']->key;
  185. ?>
  186. <script type="text/javascript">
  187. $('#table_<?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  188. ').append(create_attribute_row(<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  189. , <?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  190. , '<?php echo addslashes($_smarty_tpl->tpl_vars['attribute']->value['attribute_name']);?>
  191. ', <?php echo $_smarty_tpl->tpl_vars['attribute']->value['price'];?>
  192. , <?php echo $_smarty_tpl->tpl_vars['attribute']->value['weight'];?>
  193. ));
  194. toggle(getE('table_' + <?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
  195. ).parentNode, true);
  196. </script>
  197. <?php } ?>
  198. <?php }?>
  199. <?php }?>
  200. <?php } ?>
  201. <div class="alert alert-info"><?php echo smartyTranslate(array('s'=>'Select a default quantity, and reference, for each combination the generator will create for this product.'),$_smarty_tpl);?>
  202. </div>
  203. <table class="table">
  204. <tbody>
  205. <tr>
  206. <td><?php echo smartyTranslate(array('s'=>'Default Quantity:'),$_smarty_tpl);?>
  207. </td>
  208. <td><input type="text" name="quantity" value="0" /></td>
  209. </tr>
  210. <tr>
  211. <td><?php echo smartyTranslate(array('s'=>'Default Reference:'),$_smarty_tpl);?>
  212. </td>
  213. <td><input type="text" name="reference" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product_reference']->value, ENT_QUOTES, 'UTF-8', true);?>
  214. " /></td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. <div class="alert alert-info"><?php echo smartyTranslate(array('s'=>'Please click on "Generate these Combinations"'),$_smarty_tpl);?>
  219. </div>
  220. <button type="submit" class="btn btn-default" name="generate"><i class="icon-random"></i> <?php echo smartyTranslate(array('s'=>'Generate these Combinations'),$_smarty_tpl);?>
  221. </button>
  222. </div>
  223. </div>
  224. </div>
  225. </form>
  226. <?php }} ?>