protected function doDisplay(array $context, array $blocks = array()) { // line 1 $context["background_opacity"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "background_opacity", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "background_opacity"), "50") : "50"; // line 2 $context["popup_top"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "top", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "top"), "200") : "200"; // line 3 $context["popup_left"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "left", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "left"), "200") : "200"; // line 4 $context["width"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "width", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "width"), "600") : "600"; // line 5 $context["height"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "height", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "height"), "700") : "700"; // line 6 $context["background_color"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "background_color", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "background_color"), "black") : "black"; // line 7 $context["theme_color"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color"), "green") : "green"; // line 8 $context["loader_nr"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "loader", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "loader"), "8") : "8"; // line 9 $context["loader_url"] = "img/assets/loaders/loader" . (isset($context["loader_nr"]) ? $context["loader_nr"] : null) . ".gif"; // line 10 $context["border_radius"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "border_radius", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "border_radius"), 0) : 0; // line 11 $context["bind_selector"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "bind_selector", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "bind_selector"), ".order-button") : ".order-button"; // line 12 echo "\n var orderbutton = function (){\n this.data_product_id = null;\n this.backgroundElem = null;\n this.iframeElem = null;\n this.loaderImageElem = null;\n };\n\n orderbutton.prototype.setDataProductId = function (product_id){\n this.data_product_id = product_id;\n };\n\n orderbutton.prototype.getDataProductId = function (){\n return this.data_product_id;\n };\n\n orderbutton.prototype.hideElements = function(){\n this.backgroundElem.hide();\n this.iframeElem.hide();\n };\n\n orderbutton.prototype.attachEvents = function() {\n var _this = this;\n \$(document).keyup(function(e) { // esc\n if (e.keyCode == 27) {\n _this.hideElements();\n }\n });\n var bodyElem = \$('body');\n\n bodyElem.undelegate('"; // line 42 echo twig_escape_filter($this->env, isset($context["bind_selector"]) ? $context["bind_selector"] : null, "html", null, true); echo "', 'click');\n bodyElem.delegate('"; // line 43 echo twig_escape_filter($this->env, isset($context["bind_selector"]) ? $context["bind_selector"] : null, "html", null, true); echo "', 'click', function (event) {\n event.preventDefault();\n _this.setDataProductId(\$(this).data('product'))\n _this.popup();\n });\n // Create the event.\n var event = document.createEvent('Event');\n event.initEvent('OrderButtonEventsReady', true, true);\n\n // target can be any Element or other EventTarget.\n document.dispatchEvent(event);\n };\n\n orderbutton.prototype.srclink = function(){\n var params = [\n { name: \"theme_color\", value: \""; // line 58 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color"), "green") : "green", "html", null, true); echo "\" },\n { name: \"loader\", value: \"1\" }\n ];\n var product_id = this.getDataProductId();\n\n "; // line 63 if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "product_id")) { // line 64 echo " // request has product_id\n product_id = "; // line 65 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "product_id"), "html", null, true); echo ";\n "; } // line 67 echo "\n if (product_id)\n params.push({'name' : 'order', 'value' : product_id});\n "; // line 70 if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "show_custom_form_values")) { // line 71 echo " params['show_custom_form_values'] = 1;\n "; } // line 73 echo "\n return \""; // line 74 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("orderbutton"); echo "&\"+jQuery.param(params);\n };\n\n orderbutton.prototype.createIframe = function (){\n\n this.iframeElem = \$('<iframe frameborder=\"0\" allowtransparency=\"true\" onload=\"\" id=\"popup-iframe\" src=\"'+this.srclink()+'\" />').appendTo('body');\n this.iframeElem .css({\n "; // line 81 if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "popup_center") == "1") { // line 82 echo " 'top': "; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "popup_top"), "html", null, true); echo ",\n 'left': "; // line 83 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "popup_left"), "html", null, true); echo ",\n "; } // line 85 echo " 'background-color': 'transparent',\n 'border-radius': '"; // line 86 echo twig_escape_filter($this->env, isset($context["border_radius"]) ? $context["border_radius"] : null, "html", null, true); echo "px',\n '-webkit-border-radius': '"; // line 87 echo twig_escape_filter($this->env, isset($context["border_radius"]) ? $context["border_radius"] : null, "html", null, true); echo "px',\n '-moz-border-radius': '"; // line 88 echo twig_escape_filter($this->env, isset($context["border_radius"]) ? $context["border_radius"] : null, "html", null, true); echo "px',\n //'box-shadow': '0 0 20px 0 #222',\n //'-webkit-box-shadow': '0 0 20px 0 #222',\n //'-moz-box-shadow': '0 0 20px 0 #222',\n 'display': 'none',\n 'margin': '0 auto',\n 'padding': '0px',\n 'position': 'absolute',\n 'width': \""; // line 96 echo twig_escape_filter($this->env, isset($context["width"]) ? $context["width"] : null, "html", null, true); echo "px\",\n 'z-index': '1000'\n\n });\n\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(navigator.userAgent.substr(0, 4))){\n this.iframeElem .css({ 'width': \"\"});\n }\n\n\n var _this = this;\n this.iframeElem.load(function() {\n _this.loaderImageElem.hide();\n this.style.height = '80%';\n var pWidth = jQuery(window).width();\n var pTop = jQuery(window).scrollTop();\n var eWidth = jQuery(this).width();\n jQuery(this).css('top', pTop + 100 + 'px');\n jQuery(this).css('left', parseInt((pWidth / 2) - (eWidth / 2)) + 'px');\n \$(this).show();\n });\n\n \$(window).resize(function(){\n var pWidth = jQuery(window).width();\n var pTop = jQuery(window).scrollTop();\n var eWidth = _this.iframeElem.width();\n _this.iframeElem.css('top', pTop + 100 + 'px');\n _this.iframeElem.css('left', parseInt((pWidth / 2) - (eWidth / 2)) + 'px');\n });\n };\n\n orderbutton.prototype.createBackground = function (){\n var _this = this;\n this.backgroundElem = \$('<div/>', {\n id: 'popup-background'\n }).appendTo('body');\n this.backgroundElem.css({\n 'display': 'none',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background-color': '"; // line 139 echo twig_escape_filter($this->env, isset($context["background_color"]) ? $context["background_color"] : null, "html", null, true); echo "',\n 'opacity': '"; // line 140 echo twig_escape_filter($this->env, (isset($context["background_opacity"]) ? $context["background_opacity"] : null) / 100, "html", null, true); echo "',\n '-webkit-opacity': '"; // line 141 echo twig_escape_filter($this->env, (isset($context["background_opacity"]) ? $context["background_opacity"] : null) / 100, "html", null, true); echo "',\n '-moz-opacity': '"; // line 142 echo twig_escape_filter($this->env, (isset($context["background_opacity"]) ? $context["background_opacity"] : null) / 100, "html", null, true); echo "',\n 'filter': 'alpha(opacity="; // line 143 echo twig_escape_filter($this->env, isset($context["background_opacity"]) ? $context["background_opacity"] : null, "html", null, true); echo ")',\n 'z-index': '1000'\n }).on('click', function(){\n _this.hideElements();\n });\n\n\n this.backgroundElem.show();\n };\n\n orderbutton.prototype.createLoaderImage = function(){\n this.loaderImageElem = \$('<img />').attr({\n 'src': \""; // line 155 echo twig_escape_filter($this->env, twig_mod_asset_url(isset($context["loader_url"]) ? $context["loader_url"] : null, "orderbutton"), "html", null, true); echo "\",\n 'id' : 'loader-image'\n }).css({\n 'display': 'block',\n 'margin-left': 'auto',\n 'margin-right': 'auto',\n 'position': 'relative',\n 'top': '50%'\n }).appendTo(this.backgroundElem).show();\n };\n\n orderbutton.prototype.popup = function (){\n if (this.backgroundElem && this.iframeElem){\n\n if (this.iframeElem.attr('src') != this.srclink()){\n this.iframeElem.attr('src', this.srclink());\n this.loaderImageElem.show();\n }\n else{\n this.iframeElem.show();\n }\n this.backgroundElem.show();\n\n }else{\n this.createBackground();\n this.createLoaderImage();\n this.createIframe();\n }\n };\n (function(funcName, baseObj) {\n // The public function name defaults to window.docReady\n // but you can pass in your own object and own function name and those will be used\n // if you want to put them in a different namespace\n funcName = funcName || \"docReady\";\n baseObj = baseObj || window;\n var readyList = [];\n var readyFired = false;\n var readyEventHandlersInstalled = false;\n\n // call this when the document is ready\n // this function protects itself against being called more than once\n function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }\n\n function readyStateChange() {\n if ( document.readyState === \"complete\" ) {\n ready();\n }\n }\n\n // This is the one public interface\n // docReady(fn, context);\n // the context argument is optional - if present, it will be passed\n // as an argument to the callback\n baseObj[funcName] = function(callback, context) {\n // if ready has already fired, then just schedule the callback\n // to fire asynchronously, but right away\n if (readyFired) {\n setTimeout(function() {callback(context);}, 1);\n return;\n } else {\n // add the function and context to the list\n readyList.push({fn: callback, ctx: context});\n }\n // if document already ready to go, schedule the ready function to run\n if (document.readyState === \"complete\") {\n setTimeout(ready, 1);\n } else if (!readyEventHandlersInstalled) {\n // otherwise if we don't have event handlers installed, install them\n if (document.addEventListener) {\n // first choice is DOMContentLoaded event\n document.addEventListener(\"DOMContentLoaded\", ready, false);\n // backup is window load event\n window.addEventListener(\"load\", ready, false);\n } else {\n // must be IE\n document.attachEvent(\"onreadystatechange\", readyStateChange);\n window.attachEvent(\"onload\", ready);\n }\n readyEventHandlersInstalled = true;\n }\n }\n })(\"docReady\", window);\n\n docReady(function() {\n if (typeof jQuery === \"undefined\") {\n (function(d, script) {\n script = d.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.onload = function(){\n ob = new orderbutton();\n ob.attachEvents();\n };\n script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js';\n d.getElementsByTagName('head')[0].appendChild(script);\n }(document));\n }else{\n ob = new orderbutton();\n ob.attachEvents();\n }\n });"; }
protected function doDisplay(array $context, array $blocks = array()) { // line 1 if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color")) { $context["theme_color"] = "css/huraga-" . $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "theme_color") . ".css"; } else { $context["theme_color"] = "css/huraga-green.css"; } // line 2 $context["loader_nr"] = $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "loader", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "loader"), "8") : "8"; // line 3 $context["loader_url"] = "img/assets/loaders/loader" . (isset($context["loader_nr"]) ? $context["loader_nr"] : null) . ".gif"; // line 4 echo "<!DOCTYPE html>\n<html>\n<head>\n <meta property=\"bb:url\" content=\""; // line 7 echo twig_escape_filter($this->env, twig_constant("BB_URL"), "html", null, true); echo "\"/>\n <meta property=\"bb:client_area\" content=\""; // line 8 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("/"); echo "\"/>\n\n <meta charset=\"utf-8\">\n <title>Order</title>\n "; // line 12 echo twig_stylesheet_tag(twig_mod_asset_url("css/bootstrap.css", "orderbutton")); echo "\n "; // line 13 echo twig_stylesheet_tag(twig_mod_asset_url(isset($context["theme_color"]) ? $context["theme_color"] : null, "orderbutton")); echo "\n "; // line 14 echo twig_stylesheet_tag(twig_mod_asset_url("css/plugins/jquery.jgrowl.css", "orderbutton")); echo "\n <script src=\""; // line 15 echo twig_escape_filter($this->env, twig_mod_asset_url("js/libs/jquery.js", "orderbutton"), "html", null, true); echo "\"></script>\n <script src=\""; // line 16 echo twig_escape_filter($this->env, twig_mod_asset_url("js/bb-jquery.js", "orderbutton"), "html", null, true); echo "\"></script>\n <script src=\""; // line 17 echo twig_escape_filter($this->env, twig_mod_asset_url("js/bootstrap/bootstrap.min.js", "orderbutton"), "html", null, true); echo "\"></script>\n <script src=\""; // line 18 echo twig_escape_filter($this->env, twig_mod_asset_url("js/bootstrap/plugins/bootstrap-collapse.js", "orderbutton"), "html", null, true); echo "\"></script>\n <script src=\""; // line 19 echo twig_escape_filter($this->env, twig_mod_asset_url("js/bootstrap/plugins/bootstrap-tab.js", "orderbutton"), "html", null, true); echo "\"></script>\n <script src=\""; // line 20 echo twig_escape_filter($this->env, twig_mod_asset_url("js/jGrowl/jquery.jgrowl.js", "orderbutton"), "html", null, true); echo "\"></script>\n <style type=\"text/css\">\n body{\n background:none transparent;\n background-color:transparent;\n padding-left: 0px;\n padding-right: 0px;\n height: auto;\n }\n .accordion-body form {\n border: 0px;\n margin-bottom: 0;\n border-radius: 0;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n }\n </style>\n\n</head>\n\n<body>\n<article class=\"data-block decent\" id=\"orderbutton\" style=\"margin-bottom: 0\">\n <div class=\"data-container\">\n "; // line 49 echo " <section>\n <div id=\"accordion1\" class=\"accordion\">\n\n "; // line 52 $this->env->loadTemplate("mod_orderbutton_choose_product.phtml")->display($context); // line 53 echo "\n "; // line 54 $this->env->loadTemplate("mod_orderbutton_product_configuration.phtml")->display($context); // line 55 echo "\n "; // line 56 if (!(isset($context["client"]) ? $context["client"] : null)) { // line 57 echo " "; $this->env->loadTemplate("mod_orderbutton_client.phtml")->display($context); // line 58 echo " "; } // line 59 echo "\n "; // line 60 $this->env->loadTemplate("mod_orderbutton_checkout.phtml")->display($context); // line 61 echo "\n\n <div class=\"accordion-group\" id=\"payment-html-outer\">\n <div class=\"accordion-heading\">\n <a class=\"accordion-toggle\" href=\"#payment-html\" data-parent=\"#accordion1\"><span class=\"awe-list\"></span> "; // line 65 echo gettext("Payment"); echo "</a>\n </div>\n <div id=\"payment-html\" class=\"accordion-body collapse\" >\n <div class=\"accordion-inner\" id=\"payment-html-inner\"></div>\n </div>\n </div>\n\n </div>\n </section>\n "; // line 74 $this->env->loadTemplate("mod_orderbutton_currency.phtml")->display($context); // line 75 echo " "; if ($this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "extension_is_on", array(0 => array("mod" => "branding")), "method")) { // line 76 echo " <div style=\"text-align: center\">\n <a href=\"http://www.boxbilling.com\" title=\"Billing Software\" target=\"_blank\">"; // line 77 echo gettext("Powered by BoxBilling"); echo "</a>\n </div>\n "; } // line 80 echo "\n </div>\n</article>\n<div class=\"loading\" style=\"display: none; background: rgba(0,0,0,.5) no-repeat; width:100%; height:100%; position:fixed; top:0; left:0; z-index:999;\">\n <img src=\""; // line 84 echo twig_escape_filter($this->env, twig_mod_asset_url(isset($context["loader_url"]) ? $context["loader_url"] : null, "orderbutton"), "html", null, true); echo "\" style=\"display: block; margin-left: auto; margin-right: auto;position: relative; top : 50%\">\n</div>\n<script type=\"text/javascript\">\n \$(function(){\n \$('.accordion-body').on('shown', function(){\n \$('#popup-iframe').height(\$('body').height());\n });\n\n \$('#client-login').bind('submit',function(event){\n bb.post(\n 'guest/client/login',\n \$(this).serialize(),\n function(result) {\n bb.msg(\""; // line 97 echo gettext("You logged in successfully"); echo "\");\n \$('#register-or-login').hide(1000, function(){\n \$('#register-or-login').remove();\n bb.reload();\n });\n\n }\n );\n return false;\n });\n \$('#create-profile').bind('submit',function(event){\n bb.post(\n 'guest/client/create',\n \$(this).serialize(),\n function(result) {\n //login after registration\n var login_details = {\n email: \$('#reg-email').val(),\n password: \$('#reg-password').val()\n };\n bb.post(\n 'guest/client/login',\n login_details,\n function(result) {\n bb.msg(\""; // line 121 echo gettext("You logged in successfully"); echo "\");\n \$('#register-or-login').hide(1000, function(){\n \$('#register-or-login').remove();\n bb.reload();\n });\n }\n );\n }\n );\n return false;\n });\n \$('#add-to-cart').bind('submit',function(event){\n bb.post(\n 'guest/cart/add_item',\n \$(this).serialize(),\n function(result) {\n bb.msg(\""; // line 137 echo gettext("Product was added to shopping cart"); echo "\");\n bb.redirect(\""; // line 138 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("orderbutton", array("checkout" => 1)); echo "\"+\""; if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "show_custom_form_values")) { echo "&show_custom_form_values=1"; } echo "\");\n }\n );\n return false;\n });\n \$('#apply-promo').bind('submit',function(event){\n bb.post(\n 'guest/cart/apply_promo',\n \$(this).serialize(),\n function(result) {\n bb.msg(\""; // line 148 echo gettext("Promo code was applied for your order"); echo "\");\n location.reload(false);\n }\n );\n return false;\n });\n\n \$('#checkout-form').bind('submit',function(event){\n bb.post(\n 'client/cart/checkout',\n \$(this).serialize(),\n function(result) {\n if(result.invoice_hash) {\n bb.post('guest/invoice/payment', {hash:result.invoice_hash, gateway_id:result.gateway_id,auto_redirect:true }, function(r){\n if(r.iframe) {\n \$('#payment-html-inner').html(r.result);\n \$('#checkout').collapse('hide');\n \$('#checkout').on('hidden', function(){\n \$('#checkout').remove();\n \$('#payment-html').collapse('show');\n });\n } else {\n var link = '"; // line 170 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("invoice/banklink"); echo "' + '/' + result.invoice_hash + '/' + result.gateway_id;\n \$('#payment-html-inner').html('<a href=\"'+link+'\" target=\"_parent\" id=\"redirect-to-gateway\">Redirect to payment gateway</a>');\n \$('#checkout').collapse('hide');\n \$('#checkout-inner').remove();\n \$('#payment-html').collapse('show');\n \$('#redirect-to-gateway')[0].click();\n }\n });\n } else {\n window.top.location.href = ('"; // line 179 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("order/service/manage"); echo "' + '/' + result.order_id );\n }\n }\n );\n return false;\n });\n\n \$('#show-promo-field').bind('click', function(event){\n \$('#apply-promo').show();\n \$(this).hide();\n \$('#promocode').focus();\n });\n\n \$('.register-login a').click(function (e) {\n e.preventDefault();\n \$(this).tab('show');\n });\n\n });\n</script>\n</body>\n\n</html>"; }