scripts_js_file.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. package template
  2. var VarScriptsJsFile = []byte(`(function(window, $) {
  3. var frontend = function(window, $) {
  4. var ShopProductsLightGalleryLastImage = '';
  5. // Private
  6. function ShopProductsInitLightGallery() {
  7. $('#product_thumbnails').lightGallery({
  8. pager: false,
  9. showThumbByDefault: false,
  10. toogleThumb: false,
  11. controls: false,
  12. download: false
  13. });
  14. $('#product_image img').css('cursor', 'pointer').click(function() {
  15. $($('#product_thumbnails a.thumbnail').get($(this).data('index'))).click();
  16. });
  17. $('#product_thumbnails a.thumbnail').each(function() {
  18. $(this).mouseover(function() {
  19. if($(this).data('hover') != ShopProductsLightGalleryLastImage) {
  20. ShopProductsLightGalleryLastImage = $(this).data('hover');
  21. $('#product_image img').attr('src', $(this).data('hover'));
  22. $('#product_image img').data('index', $(this).data('index'));
  23. }
  24. });
  25. });
  26. };
  27. function ShopBasketBlockObject(object) {
  28. if(object && !$(object).hasClass('click-blocked')) {
  29. $(object).addClass('click-blocked');
  30. }
  31. };
  32. function ShopBasketUnBlockObject(object) {
  33. if(object && $(object).hasClass('click-blocked')) {
  34. $(object).removeClass('click-blocked');
  35. }
  36. };
  37. function ShopBasketObjectIsNotBlocked(object) {
  38. if(!object) {
  39. return true;
  40. }
  41. return !$(object).hasClass('click-blocked');
  42. };
  43. function ShopBasketSetNavBtnProductsCount(value) {
  44. $('#basket-nav-btn .badge').html(value);
  45. $('#basket-mobile-btn').html(value);
  46. };
  47. function ShopBasketAjaxCommand(cmd, product_id, success, fail, always) {
  48. $.ajax({
  49. type: "GET",
  50. dataType: 'json',
  51. url: '/shop/basket/' + cmd + '/' + product_id + '/'
  52. }).done(function(data) {
  53. if(success) { success(data); }
  54. }).fail(function(xhr, status, error) {
  55. if(fail) { fail(xhr, status, error); }
  56. }).always(function() {
  57. if(always) { always(); }
  58. });
  59. };
  60. function ShopBasketAjaxGetInfo(success, fail, always) {
  61. $.ajax({
  62. type: "GET",
  63. dataType: 'json',
  64. url: '/shop/basket/info/'
  65. }).done(function(data) {
  66. if(success && data) { success(data); }
  67. }).fail(function(xhr, status, error) {
  68. if(fail) { fail(xhr, status, error); }
  69. }).always(function() {
  70. if(always) { always(); }
  71. });
  72. };
  73. function ShopBasketAjaxGetCount(success, fail, always) {
  74. ShopBasketAjaxGetInfo(function(data) {
  75. if(success && data && data.total_count != undefined) {
  76. success(data.total_count);
  77. }
  78. }, function(xhr, status, error) {
  79. if(fail) { fail(xhr, status, error); }
  80. }, function() {
  81. if(always) { always(); }
  82. });
  83. };
  84. function ShopBasketAjaxUpdateCount() {
  85. ShopBasketAjaxGetCount(function(count) {
  86. ShopBasketSetNavBtnProductsCount(count);
  87. });
  88. };
  89. function ShopBasketAjaxProductsHtml(success, fail, always) {
  90. ShopBasketAjaxGetInfo(function(data) {
  91. if(data) {
  92. if(data.total_count != undefined && data.total_count > 0) {
  93. var table = '';
  94. table += '<table class="table data-table table-striped table-bordered">';
  95. table += '<thead><tr><th class="thc-1">&nbsp;</th><th class="thc-2">' + ShopBasketTableProduct + '</th><th class="thc-3">' + ShopBasketTablePrice + '</th><th class="thc-4">' + ShopBasketTableQuantity + '</th><th class="thc-5">' + ShopBasketTableSum + '</th><th class="thc-6">&nbsp;</th></tr></thead>';
  96. table += '<tbody>';
  97. for(var i in data.products) {
  98. table += '<tr>';
  99. table += '<td class="thc-1 d-none d-md-table-cell"><img src="' + data.products[i].image + '" width="50" height="50" /></td>';
  100. table += '<td class="thc-2"><a href="' + data.products[i].link + '">' + data.products[i].name + '</a></td>';
  101. table += '<td class="thc-3">' + data.products[i].price + ' ' + data.currency.code + '</td>';
  102. table += '<td class="thc-4"><button type="button" class="btn btn-minus" onclick="frontend.ShopBasketProductMinus(this,' + data.products[i].id + ');"><span>-</span></button><input class="form-control" type="text" value="' + data.products[i].quantity + '" readonly><button type="button" class="btn btn-plus" onclick="frontend.ShopBasketProductPlus(this,' + data.products[i].id + ');"><span>+</span></button></td>';
  103. table += '<td class="thc-5">' + data.products[i].sum + ' ' + data.currency.code + '</td>';
  104. table += '<td class="thc-6"><a href="" onclick="frontend.ShopBasketProductRemove(this,' + data.products[i].id + ');return false;">&times;</a></td>';
  105. table += '</tr>';
  106. }
  107. table += '</tbody>';
  108. table += '</table>';
  109. table += '<div class="total"><span class="caption">' + ShopBasketTotal + '</span><span class="value">' + data.total_sum + ' ' + data.currency.code + '</span></div>';
  110. if(success) { success(table, data.total_count); }
  111. } else {
  112. if(success) { success(ShopBasketEmpty, 0); }
  113. }
  114. } else {
  115. window.location.reload(true);
  116. }
  117. }, function(xhr, status, error) {
  118. if(fail) { fail(xhr, status, error); }
  119. }, function() {
  120. if(always) { always(); }
  121. });
  122. };
  123. function ShopBasketEnableDisableOrderBtn(total) {
  124. $('#sys-modal-shop-basket button.btn-order').prop('disabled', total <= 0);
  125. };
  126. function ClearOrderFormErrorMessage() {
  127. $('#sys-modal-shop-basket .modal-body .order-form .sys-messages').html('');
  128. $('#sys-modal-shop-basket .modal-body .order-form .input-error-msg').css('display', 'none');
  129. };
  130. function ShowOrderFormErrorMessage(title, message) {
  131. $('#sys-modal-shop-basket .modal-body .order-form .sys-messages').html('<div class="alert alert-danger alert-dismissible fade show" role="alert"><strong>' + title + '</strong> ' + message + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>');
  132. };
  133. function Initialize() {
  134. // Check if jQuery was loaded
  135. if(typeof $ == 'function') {
  136. ShopProductsInitLightGallery();
  137. } else {
  138. console.log('Error: jQuery is not loaded!');
  139. }
  140. };
  141. // Initialize
  142. if(window.addEventListener) {
  143. // W3C standard
  144. window.addEventListener('load', Initialize, false);
  145. } else if(window.attachEvent) {
  146. // Microsoft
  147. window.attachEvent('onload', Initialize);
  148. };
  149. // Public
  150. return {
  151. ShopBasketBtnCollapse: function() {
  152. if(!$('.navbar-toggler').hasClass('collapsed')) {
  153. $('.navbar-toggler').click();
  154. }
  155. return true;
  156. },
  157. ShopBasketOpen: function(object) {
  158. if(ShopBasketObjectIsNotBlocked(object)) {
  159. ShopBasketBlockObject(object);
  160. var html = '<div class="modal fade" id="sys-modal-shop-basket" tabindex="-1" role="dialog" aria-labelledby="sysModalShopBasketLabel" aria-hidden="true"> \
  161. <div class="modal-dialog modal-dialog-centered" role="document"> \
  162. <div class="modal-content"> \
  163. <input type="hidden" name="action" value="index-user-update-profile"> \
  164. <div class="modal-header"> \
  165. <h5 class="modal-title" id="sysModalShopBasketLabel">' + ShopBasketName + '</h5> \
  166. <button type="button" class="close" data-dismiss="modal" aria-label="Close"> \
  167. <span aria-hidden="true">&times;</span> \
  168. </button> \
  169. </div> \
  170. <div class="modal-body text-left" style="position:relative;"> \
  171. <div class="blocker" style="position:absolute;left:0px;top:0px;width:100%;height:100%;background:#fff;opacity:0.5;display:none;"></div> \
  172. <div class="data"></div> \
  173. <div class="order-form mt-3" style="display:none;"> \
  174. <hr class="mb-4"> \
  175. <form class="data-form" action="/" method="post" autocomplete="off"> \
  176. <div class="hidden"><input type="hidden" name="action" value="shop-order"></div> \
  177. <div class="row"> \
  178. <div class="col-md-6"> \
  179. <div class="form-group"> \
  180. <div class="row"> \
  181. <div class="col-md-4"> \
  182. <label for="lbl_client_last_name">' + ShopOrderLabelLastName + '</label> \
  183. </div> \
  184. <div class="col-md-8"> \
  185. <div> \
  186. <input class="form-control" type="text" id="lbl_client_last_name" name="client_last_name" minlength="1" maxlength="64" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  187. </div> \
  188. <div class="input-error-msg" style="display:none;"> \
  189. <small>' + ShopOrderEmptyLastName + '</small> \
  190. </div> \
  191. </div> \
  192. </div> \
  193. </div> \
  194. <div class="form-group"> \
  195. <div class="row"> \
  196. <div class="col-md-4"> \
  197. <label for="lbl_client_first_name">' + ShopOrderLabelFirstName + '</label> \
  198. </div> \
  199. <div class="col-md-8"> \
  200. <div> \
  201. <input class="form-control" type="text" id="lbl_client_first_name" name="client_first_name" minlength="1" maxlength="64" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  202. </div> \
  203. <div class="input-error-msg" style="display:none;"> \
  204. <small>' + ShopOrderEmptyFirstName + '</small> \
  205. </div> \
  206. </div> \
  207. </div> \
  208. </div> \
  209. <div class="form-group"> \
  210. <div class="row"> \
  211. <div class="col-md-4"> \
  212. <label for="lbl_client_middle_name">' + ShopOrderLabelMiddleName + '</label> \
  213. </div> \
  214. <div class="col-md-8"> \
  215. <div> \
  216. <input class="form-control" type="text" id="lbl_client_middle_name" name="client_middle_name" minlength="1" maxlength="64" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  217. </div> \
  218. <div class="input-error-msg" style="display:none;"> \
  219. <small>' + ShopOrderEmptyMiddleName + '</small> \
  220. </div> \
  221. </div> \
  222. </div> \
  223. </div> \
  224. </div> \
  225. <div class="col-md-6"> \
  226. <div class="form-group"> \
  227. <div class="row"> \
  228. <div class="col-md-4"> \
  229. <label for="lbl_client_phone">' + ShopOrderLabelMobilePhone + '</label> \
  230. </div> \
  231. <div class="col-md-8"> \
  232. <div> \
  233. <input class="form-control" type="text" id="lbl_client_phone" name="client_phone" minlength="1" maxlength="20" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  234. </div> \
  235. <div class="input-error-msg" style="display:none;"> \
  236. <small>' + ShopOrderEmptyMobilePhone + '</small> \
  237. </div> \
  238. </div> \
  239. </div> \
  240. </div> \
  241. <div class="form-group"> \
  242. <div class="row"> \
  243. <div class="col-md-4"> \
  244. <label for="lbl_client_email">' + ShopOrderLabelEmailAddress + '</label> \
  245. </div> \
  246. <div class="col-md-8"> \
  247. <div> \
  248. <input class="form-control" type="text" id="lbl_client_email" name="client_email" minlength="1" maxlength="64" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  249. </div> \
  250. <div class="input-error-msg" style="display:none;"> \
  251. <small>' + ShopOrderEmptyEmailAddress + '</small> \
  252. </div> \
  253. </div> \
  254. </div> \
  255. </div> \
  256. <div class="form-group"> \
  257. <div class="row"> \
  258. <div class="col-md-4"> \
  259. <label for="lbl_client_delivery_comment">' + ShopOrderLabelDelivery + '</label> \
  260. </div> \
  261. <div class="col-md-8"> \
  262. <div> \
  263. <input class="form-control" type="text" id="lbl_client_delivery_comment" name="client_delivery_comment" minlength="1" maxlength="255" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"> \
  264. </div> \
  265. <div class="input-error-msg" style="display:none;"> \
  266. <small>' + ShopOrderEmptyDelivery + '</small> \
  267. </div> \
  268. </div> \
  269. </div> \
  270. </div> \
  271. </div> \
  272. </div> \
  273. <div class="form-group"> \
  274. <div class="row"> \
  275. <div class="col-md-12 d-table-cell d-md-none"> \
  276. <label for="lbl_client_order_comment">' + ShopOrderLabelComment + '</label> \
  277. </div> \
  278. <div class="col-md-12"> \
  279. <div> \
  280. <textarea class="form-control" id="lbl_client_order_comment" name="client_order_comment" autocomplete="off" onkeydown="$(this).parent().parent().find(\'.input-error-msg\').css(\'display\', \'none\');"></textarea> \
  281. </div> \
  282. <div class="input-error-msg" style="display:none;"> \
  283. <small>' + ShopOrderEmptyComment + '</small> \
  284. </div> \
  285. </div> \
  286. </div> \
  287. </div> \
  288. <button type="submit" style="display:none;"></button> \ \
  289. </form> \
  290. <div class="sys-messages"></div>\
  291. </div> \
  292. </div> \
  293. <div class="modal-footer"> \
  294. <button type="button" class="btn btn-close btn-secondary" data-dismiss="modal">' + ShopBasketBtnContinue + '</button> \
  295. <button type="button" class="btn btn-order btn-success" onclick="frontend.ShopBasketMakeOrder(this);return false;" disabled>' + ShopBasketBtnOrder + '</button> \
  296. </div> \
  297. </div> \
  298. </div> \
  299. </div>';
  300. $('#sys-modal-shop-basket-placeholder').html(html);
  301. $('#sys-modal-shop-basket .order-form form').submit(function(e) {
  302. $('#sys-modal-shop-basket .modal-footer button.btn-success').click();
  303. e.preventDefault();
  304. });
  305. $("#sys-modal-shop-basket").modal({
  306. backdrop: 'static',
  307. keyboard: true,
  308. show: false,
  309. });
  310. $('#sys-modal-shop-basket').on('hidden.bs.modal', function(e) {
  311. $('#sys-modal-shop-basket-placeholder').html('');
  312. $('#navbar-top').css('margin-right', $('#body').css('padding-right'));
  313. });
  314. ShopBasketAjaxProductsHtml(function(html, total) {
  315. $('#sys-modal-shop-basket .modal-body .data').html(html);
  316. ShopBasketEnableDisableOrderBtn(total);
  317. $("#sys-modal-shop-basket").modal('show');
  318. $('#navbar-top').css('margin-right', $('#body').css('padding-right'));
  319. }, function(xhr, status, error) {
  320. window.location.reload(true);
  321. });
  322. ShopBasketUnBlockObject(object);
  323. }
  324. return false;
  325. },
  326. ShopBasketProductAdd: function(object, product_id) {
  327. if(ShopBasketObjectIsNotBlocked(object)) {
  328. ShopBasketBlockObject(object);
  329. ShopBasketAjaxCommand('plus', product_id, function(data) {
  330. frontend.ShopBasketOpen();
  331. }, function(xhr, status, error) {
  332. window.location.reload(true);
  333. }, function() {
  334. ShopBasketAjaxUpdateCount();
  335. ShopBasketUnBlockObject(object);
  336. });
  337. }
  338. return false;
  339. },
  340. ShopBasketProductPlus: function(object, product_id) {
  341. if(ShopBasketObjectIsNotBlocked(object)) {
  342. ShopBasketBlockObject(object);
  343. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'block');
  344. ShopBasketAjaxCommand('plus', product_id, function(data) {
  345. ShopBasketAjaxProductsHtml(function(html, total) {
  346. $('#sys-modal-shop-basket .modal-body .data').html(html);
  347. ShopBasketEnableDisableOrderBtn(total);
  348. }, function(xhr, status, error) {
  349. window.location.reload(true);
  350. });
  351. }, function(xhr, status, error) {
  352. window.location.reload(true);
  353. }, function() {
  354. ShopBasketAjaxUpdateCount();
  355. ShopBasketUnBlockObject(object);
  356. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'none');
  357. });
  358. }
  359. return false;
  360. },
  361. ShopBasketProductMinus: function(object, product_id) {
  362. if(ShopBasketObjectIsNotBlocked(object)) {
  363. ShopBasketBlockObject(object);
  364. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'block');
  365. ShopBasketAjaxCommand('minus', product_id, function(data) {
  366. ShopBasketAjaxProductsHtml(function(html, total) {
  367. $('#sys-modal-shop-basket .modal-body .data').html(html);
  368. ShopBasketEnableDisableOrderBtn(total);
  369. }, function(xhr, status, error) {
  370. window.location.reload(true);
  371. });
  372. }, function(xhr, status, error) {
  373. window.location.reload(true);
  374. }, function() {
  375. ShopBasketAjaxUpdateCount();
  376. ShopBasketUnBlockObject(object);
  377. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'none');
  378. });
  379. }
  380. return false;
  381. },
  382. ShopBasketProductRemove: function(object, product_id) {
  383. if(ShopBasketObjectIsNotBlocked(object)) {
  384. ShopBasketBlockObject(object);
  385. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'block');
  386. ShopBasketAjaxCommand('remove', product_id, function(data) {
  387. ShopBasketAjaxProductsHtml(function(html, total) {
  388. $('#sys-modal-shop-basket .modal-body .data').html(html);
  389. ShopBasketEnableDisableOrderBtn(total);
  390. }, function(xhr, status, error) {
  391. window.location.reload(true);
  392. });
  393. }, function(xhr, status, error) {
  394. window.location.reload(true);
  395. }, function() {
  396. ShopBasketAjaxUpdateCount();
  397. ShopBasketUnBlockObject(object);
  398. $('#sys-modal-shop-basket .modal-body .blocker').css('display', 'none');
  399. });
  400. }
  401. return false;
  402. },
  403. ShopBasketMakeOrder: function(object) {
  404. if(ShopBasketObjectIsNotBlocked(object)) {
  405. var OrderFormBlock = $('#sys-modal-shop-basket .modal-body .order-form');
  406. if(OrderFormBlock.css('display') == 'none') {
  407. OrderFormBlock.css('display', 'block');
  408. setTimeout(function() { OrderFormBlock.find('input.form-control').first().focus(); }, 200);
  409. return;
  410. }
  411. ClearOrderFormErrorMessage();
  412. var OrderForm = $('#sys-modal-shop-basket .modal-body .order-form form');
  413. // Validate
  414. var ValidateError = false;
  415. if(ShopOrderRequiredLastName && $.trim(OrderForm.find('input[name=client_last_name]').val()) == '') {
  416. OrderForm.find('input[name=client_last_name]').parent().parent().find('.input-error-msg').css('display', 'inline');
  417. if(!ValidateError) {
  418. setTimeout(function() { OrderForm.find('input[name=client_last_name]').first().focus(); }, 200);
  419. }
  420. ValidateError = true;
  421. }
  422. if(ShopOrderRequiredFirstName && $.trim(OrderForm.find('input[name=client_first_name]').val()) == '') {
  423. OrderForm.find('input[name=client_first_name]').parent().parent().find('.input-error-msg').css('display', 'inline');
  424. if(!ValidateError) {
  425. setTimeout(function() { OrderForm.find('input[name=client_first_name]').first().focus(); }, 200);
  426. }
  427. ValidateError = true;
  428. }
  429. if(ShopOrderRequiredMiddleName && $.trim(OrderForm.find('input[name=client_middle_name]').val()) == '') {
  430. OrderForm.find('input[name=client_middle_name]').parent().parent().find('.input-error-msg').css('display', 'inline');
  431. if(!ValidateError) {
  432. setTimeout(function() { OrderForm.find('input[name=client_middle_name]').first().focus(); }, 200);
  433. }
  434. ValidateError = true;
  435. }
  436. if(ShopOrderRequiredMobilePhone && $.trim(OrderForm.find('input[name=client_phone]').val()) == '') {
  437. OrderForm.find('input[name=client_phone]').parent().parent().find('.input-error-msg').css('display', 'inline');
  438. if(!ValidateError) {
  439. setTimeout(function() { OrderForm.find('input[name=client_phone]').first().focus(); }, 200);
  440. }
  441. ValidateError = true;
  442. }
  443. if(ShopOrderRequiredEmailAddress && $.trim(OrderForm.find('input[name=client_email]').val()) == '') {
  444. OrderForm.find('input[name=client_email]').parent().parent().find('.input-error-msg').css('display', 'inline');
  445. if(!ValidateError) {
  446. setTimeout(function() { OrderForm.find('input[name=client_email]').first().focus(); }, 200);
  447. }
  448. ValidateError = true;
  449. }
  450. if(ShopOrderRequiredDelivery && $.trim(OrderForm.find('input[name=client_delivery_comment]').val()) == '') {
  451. OrderForm.find('input[name=client_delivery_comment]').parent().parent().find('.input-error-msg').css('display', 'inline');
  452. if(!ValidateError) {
  453. setTimeout(function() { OrderForm.find('input[name=client_delivery_comment]').first().focus(); }, 200);
  454. }
  455. ValidateError = true;
  456. }
  457. if(ShopOrderRequiredComment && $.trim(OrderForm.find('textarea[name=client_order_comment]').val()) == '') {
  458. OrderForm.find('textarea[name=client_order_comment]').parent().parent().find('.input-error-msg').css('display', 'inline');
  459. if(!ValidateError) {
  460. setTimeout(function() { OrderForm.find('textarea[name=client_order_comment]').first().focus(); }, 200);
  461. }
  462. ValidateError = true;
  463. }
  464. if(ValidateError) {
  465. return;
  466. }
  467. // Send form
  468. ShopBasketBlockObject(object);
  469. $.ajax({
  470. type: "POST",
  471. url: OrderForm.attr('action'),
  472. data: OrderForm.serialize()
  473. }).done(function(data) {
  474. try {
  475. jdata = JSON.parse(data);
  476. if(jdata.error === true) {
  477. ShowOrderFormErrorMessage(ShopOrderError, window[jdata.variable]);
  478. if(jdata.field) {
  479. setTimeout(function() { OrderForm.find('[name=' + jdata.field + ']').first().focus(); }, 200);
  480. OrderForm.find('[name=' + jdata.field + ']').parent().parent().find('.input-error-msg').css('display', 'inline');
  481. }
  482. } else {
  483. ShopBasketSetNavBtnProductsCount(0);
  484. OrderFormBlock.css('display', 'none');
  485. $('#sys-modal-shop-basket .modal-body .data').html(window[jdata.variable]);
  486. $('#sys-modal-shop-basket button.btn-order').prop('disabled', true);
  487. }
  488. } catch(e) {
  489. ShowOrderFormErrorMessage(ShopOrderError, e.message);
  490. }
  491. }).fail(function(xhr, status, error) {
  492. ShowOrderFormErrorMessage(ShopOrderError, error);
  493. }).always(function() {
  494. ShopBasketUnBlockObject(object);
  495. });
  496. }
  497. },
  498. };
  499. }(window, $);
  500. window.frontend = frontend;
  501. }(window, jQuery));`)