Advertisement
Guest User

opa

a guest
Apr 28th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.63 KB | None | 0 0
  1. <modification>
  2. <id>OPA</id>
  3. <vqmver>1.0.8</vqmver>
  4. <version>1.85</version>
  5. <author>Poniyoco</author>
  6.  
  7. <file name="admin/view/template/catalog/product_form.tpl">
  8. <operation>
  9. <search position="after" index="1"><![CDATA[<?php echo $header; ?>]]></search>
  10. <add><![CDATA[<?php echo '<span style="font-weight:bold;padding:2px;padding-right:4px;padding-left:2px;display:inline;margin-right:15px;background-color:#ebf9fe;float:right;">OPA v1.85</span>'; ?>]]></add>
  11. </operation>
  12. </file>
  13.  
  14. <file name="catalog/controller/checkout/cart.php">
  15. <operation>
  16. <search position="before" index="1"><![CDATA[$product_options = $this->model_catalog_product->getProductOptions($this->request->post['product_id']);]]></search>
  17. <add><![CDATA[
  18. $product_id = $this->request->post['product_id'];
  19. $this->session->data['OTFCart'] = array();
  20. if(!$option) {
  21. $key = (int)$product_id;
  22. } else {
  23. $key = (int)$product_id . ':' . base64_encode(serialize($option));
  24. }
  25. $this->session->data['OTFCart_CFODebug'] = "";
  26. $this->session->data['OTFCart_CFODebugFormulas'] = "";
  27. $this->session->data['OTFCart_CFOReporting'] = "";
  28. $this->session->data['OTFCart_CFOForceFail'] = "";
  29. $this->session->data['OTFCart'][$key] = (int)$quantity;
  30. $product_data = $this->cart->getProducts("OTF");
  31. $this->session->data['OTFCart'] = array();
  32. if($this->session->data['OTFCart_CFOForceFail']!="") {
  33. $json['error'] = "Formula Forced to Fail via CFO";
  34. }
  35. ]]></add>
  36. </operation>
  37.  
  38. <operation>
  39. <search position="before" index="1"><![CDATA[public function index() {]]></search>
  40. <add><![CDATA[
  41. public function esponi_OTF() {
  42. $this->load->model('catalog/product');
  43. $result_OTF = "0";
  44. $resultText_OTF = "0xOPAx0xOPAx0xOPAx0xOPAx0";
  45. $product_id = 0;
  46. $this->session->data['OTFCart_CFODebug'] = "";
  47. if (isset($this->request->post['product_id'])) {
  48. $product_id = (int) $this->request->post['product_id'];
  49. }
  50. if (!empty($product_id)) {
  51. $product_info = $this->model_catalog_product->getProduct($product_id);
  52. if ($product_info) {
  53. // Minimum quantity validation
  54. $quantity = 1;
  55. if (isset($this->request->post['quantity'])) {
  56. $quantity = (int) $this->request->post['quantity'];
  57. }
  58. if (!$quantity) {
  59. $quantity = 1;
  60. }
  61. $product_total = 0;
  62. if ($product_info['minimum'] > ($product_total + $quantity)) {
  63. $result_OTF = "FAIL";
  64. }
  65. // Option validation
  66. $option = array();
  67. if (isset($this->request->post['option'])) {
  68. $option = array_filter((array) $this->request->post['option']);
  69. }
  70. $product_options = $this->model_catalog_product->getProductOptions($product_id);
  71. foreach ($product_options as $product_option) {
  72. if(!($product_option['type']=='file')) {
  73. if ($product_option['required'] && (!isset($this->request->post['option'][$product_option['product_option_id']]) ||
  74. !$this->request->post['option'][$product_option['product_option_id']])) {
  75. $result_OTF = "FAIL";
  76. }
  77. }
  78. }
  79. }
  80. if (!($result_OTF=="FAIL")) {
  81. //
  82. // ESPONI: on-the-fly get price
  83. $cartTotal_OTF = 0;
  84. $this->session->data['OTFCart'] = array();
  85. if(!$option) {
  86. $key = (int)$product_id;
  87. } else {
  88. $key = (int)$product_id . ':' . base64_encode(serialize($option));
  89. }
  90. $this->session->data['OTFCart_CFODebug'] = "";
  91. $this->session->data['OTFCart_CFODebugFormulas'] = "";
  92. $this->session->data['OTFCart_CFOReporting'] = "";
  93. $this->session->data['OTFCart_CFOForceFail'] = "";
  94. $this->session->data['OTFCart'][$key] = (int)$quantity;
  95. $product_data = $this->cart->getProducts("OTF");
  96. $this->session->data['OTFCart'] = array();
  97. foreach ($product_data as $product) {
  98. $cartTotal_OTF = $cartTotal_OTF + $product["price"];
  99. }
  100. $resultText_OTF = $this->currency->format($this->tax->calculate($cartTotal_OTF, $product_info['tax_class_id'], $this->config->get('config_tax')));
  101. $resultText_OTF = $resultText_OTF . "xOPAx" . $this->currency->format($cartTotal_OTF);
  102. $resultText_OTF = $resultText_OTF . "xOPAx" . $quantity;
  103. $resultText_OTF = $resultText_OTF . "xOPAx" . $this->currency->format($this->tax->calculate(($cartTotal_OTF * $quantity), $product_info['tax_class_id'], $this->config->get('config_tax')));
  104. $resultText_OTF = $resultText_OTF . "xOPAx" . $this->currency->format($cartTotal_OTF * $quantity);
  105. //
  106. //
  107. $result_OTF = "Ok";
  108. }
  109. }
  110. // Show site if logged in as admin
  111. $this->load->library('user');
  112. $this->user = new User($this->registry);
  113. $esponi_isAdmin = $this->user->isLogged() && $this->user->hasPermission('modify', 'catalog/product');
  114. //
  115. // $esponi_isAdmin = true;
  116. //
  117. $esponi_result = $result_OTF . "xOPAx" . $resultText_OTF . "xOPAx" . $this->request->get['timestamp'] . "xOPAx" . (($esponi_isAdmin)?$this->session->data['OTFCart_CFODebug']:"off");
  118. $esponi_result = $esponi_result . "xOPAx";
  119. if(isset($this->session->data['OTFCart_CFOReporting'])) {
  120. $esponi_result = $esponi_result . $this->session->data['OTFCart_CFOReporting'];
  121. }
  122. $this->response->setOutput($esponi_result);
  123. }
  124. ]]></add>
  125. </operation>
  126. </file>
  127.  
  128. <file name="system/library/cart.php">
  129. <operation>
  130. <search position="replace" index="1"><![CDATA[public function getProducts() {]]></search>
  131. <add><![CDATA[public function getProducts($mode = "NORMAL") {]]></add>
  132. </operation>
  133.  
  134. <operation>
  135. <search position="after" index="1"><![CDATA[public function getProducts(]]></search>
  136. <add><![CDATA[
  137. if($mode=="OTF") {
  138. $esponi_data = $this->session->data['OTFCart'];
  139. } else {
  140. $esponi_data = $this->session->data['cart'];
  141. }
  142. ]]></add>
  143. </operation>
  144.  
  145. <operation>
  146. <search position="replace" index="1"><![CDATA[foreach ($this->session->data['cart'] as $key => $quantity) {]]></search>
  147. <add><![CDATA[foreach ($esponi_data as $key => $quantity) {]]></add>
  148. </operation>
  149.  
  150. <operation>
  151. <search position="replace" index="1"><![CDATA[foreach ($this->session->data['cart'] as $key_2 => $quantity_2) {]]></search>
  152. <add><![CDATA[foreach ($esponi_data as $key_2 => $quantity_2) {]]></add>
  153. </operation>
  154. </file>
  155.  
  156.  
  157. <file name="catalog/view/theme/default/template/product/product.tpl">
  158. <operation>
  159. <search position="replace" index="1"><![CDATA[<div class="product-info">]]></search>
  160. <add><![CDATA[<div class="product-info" id="product_add_to_cart_form">]]></add>
  161. </operation>
  162.  
  163. <operation>
  164. <search position="before" index="1"><![CDATA[<div class="cart">]]></search>
  165. <add><![CDATA[
  166. <?php
  167. $this->language->load('product/product');
  168. $esponiExTaxText = $this->language->get('text_tax');
  169. ?>
  170. <div id="esponi_OTF_Container">
  171. <div id="esponi_OTF">
  172. <span id="esponi_OTF_LeftColumn">
  173. <span id="esponi_OTF_UnitText"><?php $this->language->load('product/product'); echo $this->language->get('text_price'); ?></span>
  174. <span id="esponi_OTF_UnitTextExtTax" class='price-tax' style='font-weight:normal; display:none;'><?php echo $esponiExTaxText; ?></span>
  175. <span id="esponi_OTF_TotalText"><?php $this->language->load('checkout/cart'); echo $this->language->get('column_total'); ?>:</span>
  176. <span id="esponi_OTF_TotalTextExtTax" class='price-tax' style='font-weight:normal; display:none;'><?php echo $esponiExTaxText; ?></span>
  177. </span>
  178. <span id="esponi_OTF_RightColumn">
  179. <span id="esponi_OTF_Unit"></span>
  180. <span id="esponi_OTF_Total"></span>
  181. </span>
  182. </div>
  183. <?php $this->language->load('product/product'); ?>
  184. </div>
  185. <div id="esponi_OTF_CFODebug" style="overflow:hidden; display:none;"></div>
  186. <div id="esponi_OTF_CFOReporting"></div>
  187. ]]></add>
  188. </operation>
  189.  
  190. <operation>
  191. <search position="after" index="1"><![CDATA[id="content"]]></search>
  192. <add><![CDATA[
  193. <script type="text/javascript">
  194. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  195. // Special Configurations (values true or false)
  196. var showUnitPriceAboveAvailableOptions = true; // if you set to false it will show under addtocart button
  197. var showExTaxPrices = true; // Prices without taxes will be shown under price and total values
  198. var alwaysHideCFODebugBlock = false; // Will be shown if you have installed CFO extension and you are admin user, but you can override
  199. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  200.  
  201. //
  202. //
  203. var timestamp = 0;
  204. var last_esponi_data = [];
  205. $(document).ready(function() {
  206. var back_PriceAboveAvailableOptions;
  207. back_PriceAboveAvailableOptions = $('#product_add_to_cart_form div[class=\'price\']').html();
  208. back_PriceAboveAvailableOptions = "<span id='esponidefaultPrice'>" + back_PriceAboveAvailableOptions + "</span>";
  209. $('#product_add_to_cart_form div[class=\'price\']').html(back_PriceAboveAvailableOptions);
  210.  
  211. if(showUnitPriceAboveAvailableOptions) {
  212. $('#product_add_to_cart_form div[class=\'price\']').append($('#esponi_OTF_Container'));
  213. } else {
  214. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_Container'));
  215. }
  216. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_CFODebug'));
  217.  
  218. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_CFOReporting')); // Below quantity and "add to cart" button
  219. $('#product_add_to_cart_form input[type=\'radio\'], #product_add_to_cart_form input[type=\'checkbox\'], #product_add_to_cart_form select').bind("change", function(){ esponi_OTF($(this)); });
  220. $('#product_add_to_cart_form input[type=\'text\'], #product_add_to_cart_form textarea').bind("keyup", function(){ esponi_OTF($(this)); });
  221. $('#product_add_to_cart_form input[type=\'hidden\']').bind("change", function(){ esponi_OTF($(this)); });
  222. $("#product_add_to_cart_form a.dd-option").bind("click", function(){ esponi_OTF($(this)); });
  223. });
  224. function esponi_OTF(el) {
  225. try {
  226. var esponi_name = el.prop("name");
  227. if(esponi_name.substr(0, 11)=="ESPONI_CHK_") return;
  228. }
  229. catch(err) { }
  230. var esponi_data = $('#product_add_to_cart_form input[type=\'text\'], #product_add_to_cart_form input[type=\'hidden\'], #product_add_to_cart_form input[type=\'radio\']:checked, #product_add_to_cart_form input[type=\'checkbox\']:checked, #product_add_to_cart_form select, #product_add_to_cart_form textarea');
  231. if(esponi_specArrayCompare(last_esponi_data, esponi_data)) {
  232. return;
  233. }
  234. last_esponi_data = esponi_specArrayCopy(esponi_data);
  235. timestamp = timestamp + 1;
  236. blurStand("blur");
  237. blurStandReporting("blur");
  238. $.ajax({
  239. url: 'index.php?route=checkout/cart/esponi_OTF&timestamp=' + timestamp,
  240. type: 'post',
  241. data: esponi_data,
  242. dataType: 'html',
  243. success: function(rhtml) {
  244. if(rhtml!="") {
  245. recv = rhtml.split("xOPAx");
  246. if(recv.length>0) {
  247. thisok = recv[0];
  248. thisunit = recv[1];
  249. thisunitextax = recv[2];
  250. thisqt = recv[3];
  251. thistotal = recv[4];
  252. thistotalextax = recv[5];
  253. thistimestamp = recv[6];
  254. thisdebug = recv[7];
  255. }
  256. if(thistimestamp==timestamp) {
  257. if(thisok=="Ok") {
  258. if(!showExTaxPrices) {
  259. $('#esponi_OTF_Unit').html(thisunit);
  260. $('#esponi_OTF_Total').html(thistotal);
  261. } else {
  262. $('#esponi_OTF_Unit').html(thisunit + "<BR><span class='price-tax' style='font-weight:normal;'>" + thisunitextax + "</span>");
  263. $('#esponi_OTF_Total').html(thistotal + "<BR><span class='price-tax' style='font-weight:normal;'>" + thistotalextax + "</span>");
  264. }
  265. //
  266. // show Unit Price Above Available Options?
  267. if(showUnitPriceAboveAvailableOptions) {
  268. $('#esponidefaultPrice').css("display", "none");
  269. }
  270. //
  271. //
  272. if(!(thisqt=="1")) {
  273. $('#esponi_OTF_Unit').css("display","block");
  274. $('#esponi_OTF_UnitText').css("display","block");
  275. $('#esponi_OTF_Total').css("display","block");
  276. $('#esponi_OTF_TotalText').css("display","block");
  277. } else {
  278. $('#esponi_OTF_Unit').css("display","block");
  279. $('#esponi_OTF_UnitText').css("display","block");
  280. $('#esponi_OTF_Total').css("display","none");
  281. $('#esponi_OTF_TotalText').css("display","none");
  282. }
  283. //
  284. //
  285. if(showExTaxPrices) {
  286. if($('#esponi_OTF_Unit').css("display")=="block") {
  287. $('#esponi_OTF_UnitTextExtTax').css("display","block");
  288. } else {
  289. $('#esponi_OTF_UnitTextExtTax').css("display","none");
  290. }
  291. if($('#esponi_OTF_Total').css("display")=="block") {
  292. $('#esponi_OTF_TotalTextExtTax').css("display","block");
  293. } else {
  294. $('#esponi_OTF_TotalTextExtTax').css("display","none");
  295. }
  296. }
  297. //
  298. //
  299. if(alwaysHideCFODebugBlock) thisdebug="off";
  300. if(!(thisdebug=="off" || thisdebug=="")) {
  301. $('#esponi_OTF_CFODebug').html(thisdebug);
  302. $('#esponi_OTF_CFODebug').css("display","block");
  303. } else {
  304. $('#esponi_OTF_CFODebug').html('');
  305. $('#esponi_OTF_CFODebug').css("display","none");
  306. }
  307. $('#esponi_OTF').css("display","block");
  308. blurStand("show");
  309. } else {
  310. esponi_hideAll();
  311. if(showUnitPriceAboveAvailableOptions) {
  312. $('#esponidefaultPrice').css("display", "block");
  313. }
  314. }
  315. if(thisok=="Ok" && recv.length>7) {
  316. if(recv[8]!="") {
  317. $('#esponi_OTF_CFOReporting').html(recv[8]);
  318. blurStandReporting("show");
  319. } else {
  320. blurStandReporting("hide");
  321. $('#esponi_OTF_CFOReporting').html('');
  322. }
  323. } else {
  324. blurStandReporting("hide");
  325. $('#esponi_OTF_CFOReporting').html('');
  326. }
  327. // -
  328. }
  329. }
  330. }
  331. });
  332. }
  333. function esponi_hideAll() {
  334. $('#esponi_OTF').css("display","none");
  335. $('#esponi_OTF_Unit').css("display","none");
  336. $('#esponi_OTF_UnitText').css("display","none");
  337. $('#esponi_OTF_Total').css("display","none");
  338. $('#esponi_OTF_TotalText').css("display","none");
  339. $('#esponi_OTF_Unit').html('');
  340. $('#esponi_OTF_Total').html('');
  341. $('#esponi_OTF_CFODebug').html('');
  342. $('#esponi_OTF_CFODebug').css("display","none");
  343. }
  344. function blurStand(state) {
  345. if($('#esponi_OTF').css("display")=="block") {
  346. if(state=="blur") {
  347. ealpha = 0.45;
  348. } else {
  349. ealpha = 1;
  350. }
  351. if($('#esponi_OTF_Unit').css("display")=="block") $('#esponi_OTF_Unit').fadeTo(150, ealpha);
  352. if($('#esponi_OTF_Total').css("display")=="block") $('#esponi_OTF_Total').fadeTo(150, ealpha);
  353. }
  354. }
  355. function blurStandReporting(state) {
  356. if(state=="hide") {
  357. $('#esponi_OTF_CFOReporting').css("display","none");
  358. return;
  359. }
  360. if(state=="show") {
  361. $('#esponi_OTF_CFOReporting').css("display","block");
  362. }
  363. if($('#esponi_OTF_CFOReporting').css("display")=="block") {
  364. if(state=="blur") {
  365. ealpha = 0.45;
  366. } else {
  367. ealpha = 1;
  368. }
  369. if($('#esponi_OTF_CFOReporting').css("display")=="block") $('#esponi_OTF_CFOReporting').fadeTo(150, ealpha);
  370. }
  371. }
  372. function esponi_specArrayCopy(obj1) {
  373. var ret = [];
  374. for(ii=0; ii<obj1.length; ii++) {
  375. ret.push(obj1[ii].value);
  376. }
  377. return ret;
  378. }
  379. function esponi_specArrayCompare(obj1, obj2) {
  380. if(obj1.length!=obj2.length) return false;
  381. for(ii=0; ii<obj2.length; ii++) {
  382. if(obj1[ii]!=obj2[ii].value) {
  383. return false;
  384. }
  385. }
  386. return true;
  387. }
  388. </script>
  389. ]]></add>
  390. </operation>
  391. </file>
  392.  
  393. <file name="catalog/view/theme/marketshop/template/product/product.tpl">
  394. <operation>
  395. <search position="replace" index="1"><![CDATA[<div class="row product-info">]]></search>
  396. <add><![CDATA[<div class="row product-info" id="product_add_to_cart_form">]]></add>
  397. </operation>
  398.  
  399. <operation>
  400. <search position="before" index="1"><![CDATA[<div class="cart">]]></search>
  401. <add><![CDATA[
  402. <?php
  403. $this->language->load('product/product');
  404. $esponiExTaxText = $this->language->get('text_tax');
  405. ?>
  406. <div id="esponi_OTF_Container">
  407. <div id="esponi_OTF">
  408. <span id="esponi_OTF_LeftColumn">
  409. <span id="esponi_OTF_UnitText"><?php $this->language->load('product/product'); echo $this->language->get('text_price'); ?></span>
  410. <span id="esponi_OTF_UnitTextExtTax" class='price-tax' style='font-weight:normal; display:none;'><?php echo $esponiExTaxText; ?></span>
  411. <span id="esponi_OTF_TotalText"><?php $this->language->load('checkout/cart'); echo $this->language->get('column_total'); ?>:</span>
  412. <span id="esponi_OTF_TotalTextExtTax" class='price-tax' style='font-weight:normal; display:none;'><?php echo $esponiExTaxText; ?></span>
  413. </span>
  414. <span id="esponi_OTF_RightColumn">
  415. <span id="esponi_OTF_Unit"></span>
  416. <span id="esponi_OTF_Total"></span>
  417. </span>
  418. </div>
  419. <?php $this->language->load('product/product'); ?>
  420. </div>
  421. <div id="esponi_OTF_CFODebug" style="overflow:hidden; display:none;"></div>
  422. <div id="esponi_OTF_CFOReporting"></div>
  423. ]]></add>
  424. </operation>
  425.  
  426. <operation>
  427. <search position="after" index="1"><![CDATA[id="content"]]></search>
  428. <add><![CDATA[
  429. <script type="text/javascript">
  430. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  431. // Special Configurations (values true or false)
  432. var showUnitPriceAboveAvailableOptions = true; // if you set to false it will show under addtocart button
  433. var showExTaxPrices = true; // Prices without taxes will be shown under price and total values
  434. var alwaysHideCFODebugBlock = false; // Will be shown if you have installed CFO extension and you are admin user, but you can override
  435. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  436.  
  437. //
  438. //
  439. var timestamp = 0;
  440. var last_esponi_data = [];
  441. $(document).ready(function() {
  442. var back_PriceAboveAvailableOptions;
  443. back_PriceAboveAvailableOptions = $('#product_add_to_cart_form div[class=\'price\']').html();
  444. back_PriceAboveAvailableOptions = "<span id='esponidefaultPrice'>" + back_PriceAboveAvailableOptions + "</span>";
  445. $('#product_add_to_cart_form div[class=\'price\']').html(back_PriceAboveAvailableOptions);
  446.  
  447. if(showUnitPriceAboveAvailableOptions) {
  448. $('#product_add_to_cart_form div[class=\'price\']').append($('#esponi_OTF_Container'));
  449. } else {
  450. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_Container'));
  451. }
  452. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_CFODebug'));
  453.  
  454. $('#product_add_to_cart_form div[class=\'cart\']').append($('#esponi_OTF_CFOReporting')); // Below quantity and "add to cart" button
  455. $('#product_add_to_cart_form input[type=\'radio\'], #product_add_to_cart_form input[type=\'checkbox\'], #product_add_to_cart_form select').bind("change", function(){ esponi_OTF($(this)); });
  456. $('#product_add_to_cart_form input[type=\'text\'], #product_add_to_cart_form textarea').bind("keyup", function(){ esponi_OTF($(this)); });
  457. $('#product_add_to_cart_form input[type=\'hidden\']').bind("change", function(){ esponi_OTF($(this)); });
  458. $("#product_add_to_cart_form a.dd-option").bind("click", function(){ esponi_OTF($(this)); });
  459. });
  460. function esponi_OTF(el) {
  461. try {
  462. var esponi_name = el.prop("name");
  463. if(esponi_name.substr(0, 11)=="ESPONI_CHK_") return;
  464. }
  465. catch(err) { }
  466. var esponi_data = $('#product_add_to_cart_form input[type=\'text\'], #product_add_to_cart_form input[type=\'hidden\'], #product_add_to_cart_form input[type=\'radio\']:checked, #product_add_to_cart_form input[type=\'checkbox\']:checked, #product_add_to_cart_form select, #product_add_to_cart_form textarea');
  467. if(esponi_specArrayCompare(last_esponi_data, esponi_data)) {
  468. return;
  469. }
  470. last_esponi_data = esponi_specArrayCopy(esponi_data);
  471. timestamp = timestamp + 1;
  472. blurStand("blur");
  473. blurStandReporting("blur");
  474. $.ajax({
  475. url: 'index.php?route=checkout/cart/esponi_OTF&timestamp=' + timestamp,
  476. type: 'post',
  477. data: esponi_data,
  478. dataType: 'html',
  479. success: function(rhtml) {
  480. if(rhtml!="") {
  481. recv = rhtml.split("xOPAx");
  482. if(recv.length>0) {
  483. thisok = recv[0];
  484. thisunit = recv[1];
  485. thisunitextax = recv[2];
  486. thisqt = recv[3];
  487. thistotal = recv[4];
  488. thistotalextax = recv[5];
  489. thistimestamp = recv[6];
  490. thisdebug = recv[7];
  491. }
  492. if(thistimestamp==timestamp) {
  493. if(thisok=="Ok") {
  494. if(!showExTaxPrices) {
  495. $('#esponi_OTF_Unit').html(thisunit);
  496. $('#esponi_OTF_Total').html(thistotal);
  497. } else {
  498. $('#esponi_OTF_Unit').html(thisunit + "<BR><span class='price-tax' style='font-weight:normal;'>" + thisunitextax + "</span>");
  499. $('#esponi_OTF_Total').html(thistotal + "<BR><span class='price-tax' style='font-weight:normal;'>" + thistotalextax + "</span>");
  500. }
  501. //
  502. // show Unit Price Above Available Options?
  503. if(showUnitPriceAboveAvailableOptions) {
  504. $('#esponidefaultPrice').css("display", "none");
  505. }
  506. //
  507. //
  508. if(!(thisqt=="1")) {
  509. $('#esponi_OTF_Unit').css("display","block");
  510. $('#esponi_OTF_UnitText').css("display","block");
  511. $('#esponi_OTF_Total').css("display","block");
  512. $('#esponi_OTF_TotalText').css("display","block");
  513. } else {
  514. $('#esponi_OTF_Unit').css("display","block");
  515. $('#esponi_OTF_UnitText').css("display","block");
  516. $('#esponi_OTF_Total').css("display","none");
  517. $('#esponi_OTF_TotalText').css("display","none");
  518. }
  519. //
  520. //
  521. if(showExTaxPrices) {
  522. if($('#esponi_OTF_Unit').css("display")=="block") {
  523. $('#esponi_OTF_UnitTextExtTax').css("display","block");
  524. } else {
  525. $('#esponi_OTF_UnitTextExtTax').css("display","none");
  526. }
  527. if($('#esponi_OTF_Total').css("display")=="block") {
  528. $('#esponi_OTF_TotalTextExtTax').css("display","block");
  529. } else {
  530. $('#esponi_OTF_TotalTextExtTax').css("display","none");
  531. }
  532. }
  533. //
  534. //
  535. if(alwaysHideCFODebugBlock) thisdebug="off";
  536. if(!(thisdebug=="off" || thisdebug=="")) {
  537. $('#esponi_OTF_CFODebug').html(thisdebug);
  538. $('#esponi_OTF_CFODebug').css("display","block");
  539. } else {
  540. $('#esponi_OTF_CFODebug').html('');
  541. $('#esponi_OTF_CFODebug').css("display","none");
  542. }
  543. $('#esponi_OTF').css("display","block");
  544. blurStand("show");
  545. } else {
  546. esponi_hideAll();
  547. if(showUnitPriceAboveAvailableOptions) {
  548. $('#esponidefaultPrice').css("display", "block");
  549. }
  550. }
  551. if(thisok=="Ok" && recv.length>7) {
  552. if(recv[8]!="") {
  553. $('#esponi_OTF_CFOReporting').html(recv[8]);
  554. blurStandReporting("show");
  555. } else {
  556. blurStandReporting("hide");
  557. $('#esponi_OTF_CFOReporting').html('');
  558. }
  559. } else {
  560. blurStandReporting("hide");
  561. $('#esponi_OTF_CFOReporting').html('');
  562. }
  563. // -
  564. }
  565. }
  566. }
  567. });
  568. }
  569. function esponi_hideAll() {
  570. $('#esponi_OTF').css("display","none");
  571. $('#esponi_OTF_Unit').css("display","none");
  572. $('#esponi_OTF_UnitText').css("display","none");
  573. $('#esponi_OTF_Total').css("display","none");
  574. $('#esponi_OTF_TotalText').css("display","none");
  575. $('#esponi_OTF_Unit').html('');
  576. $('#esponi_OTF_Total').html('');
  577. $('#esponi_OTF_CFODebug').html('');
  578. $('#esponi_OTF_CFODebug').css("display","none");
  579. }
  580. function blurStand(state) {
  581. if($('#esponi_OTF').css("display")=="block") {
  582. if(state=="blur") {
  583. ealpha = 0.45;
  584. } else {
  585. ealpha = 1;
  586. }
  587. if($('#esponi_OTF_Unit').css("display")=="block") $('#esponi_OTF_Unit').fadeTo(150, ealpha);
  588. if($('#esponi_OTF_Total').css("display")=="block") $('#esponi_OTF_Total').fadeTo(150, ealpha);
  589. }
  590. }
  591. function blurStandReporting(state) {
  592. if(state=="hide") {
  593. $('#esponi_OTF_CFOReporting').css("display","none");
  594. return;
  595. }
  596. if(state=="show") {
  597. $('#esponi_OTF_CFOReporting').css("display","block");
  598. }
  599. if($('#esponi_OTF_CFOReporting').css("display")=="block") {
  600. if(state=="blur") {
  601. ealpha = 0.45;
  602. } else {
  603. ealpha = 1;
  604. }
  605. if($('#esponi_OTF_CFOReporting').css("display")=="block") $('#esponi_OTF_CFOReporting').fadeTo(150, ealpha);
  606. }
  607. }
  608. function esponi_specArrayCopy(obj1) {
  609. var ret = [];
  610. for(ii=0; ii<obj1.length; ii++) {
  611. ret.push(obj1[ii].value);
  612. }
  613. return ret;
  614. }
  615. function esponi_specArrayCompare(obj1, obj2) {
  616. if(obj1.length!=obj2.length) return false;
  617. for(ii=0; ii<obj2.length; ii++) {
  618. if(obj1[ii]!=obj2[ii].value) {
  619. return false;
  620. }
  621. }
  622. return true;
  623. }
  624. </script>
  625. ]]></add>
  626. </operation>
  627. </file>
  628. </modification>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement