protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     if (twig_length_filter($this->env, $this->getAttribute(isset($context["product"]) ? $context["product"] : null, "addons")) > 0) {
         // line 2
         echo "<hr/>\n<section>\n    <header>\n        <h2>";
         // line 5
         echo gettext("Addons & extras");
         echo "</h2>\n    </header>\n</section>\n<div class=\"row-fluid\">\n        <table class=\"table table-condensed\">\n            <tbody>\n            ";
         // line 11
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["product"]) ? $context["product"] : null, "addons"));
         foreach ($context['_seq'] as $context["_key"] => $context["addon"]) {
             // line 12
             echo "            <label for=\"addon_";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n            <tr>\n                <td>\n                    <input type=\"hidden\" name=\"addons[";
             // line 15
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "][selected]\" value=\"0\">\n                    <input type=\"checkbox\" name=\"addons[";
             // line 16
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "][selected]\" value=\"1\" id=\"addon_";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n                </td>\n\n                <td ";
             // line 19
             if (!$this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "icon_url")) {
                 echo "style=\"display: none\"";
             }
             echo ">\n                    <label for=\"addon_";
             // line 20
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\"><img src=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "icon_url"), "html", null, true);
             echo "\" alt=\"\" width=\"36\"/></label>\n                </td>\n\n                <td>\n                    <label for=\"addon_";
             // line 24
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\"><h3>";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "title"), "html", null, true);
             echo "</h3></label>\n                    ";
             // line 25
             echo twig_bbmd_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "description"));
             echo "\n                </td>\n\n                <td class=\"currency\">\n                    <label for=\"addon_";
             // line 29
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n                    ";
             // line 30
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "recurrent") {
                 // line 31
                 echo "                        ";
                 $context["periods"] = $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "system_periods");
                 // line 32
                 echo "                        <select name=\"addons[";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
                 echo "][period]\" rel=\"addon-periods-";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
                 echo "\">\n                        ";
                 // line 33
                 $context['_parent'] = (array) $context;
                 $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "recurrent"));
                 foreach ($context['_seq'] as $context["code"] => $context["prices"]) {
                     // line 34
                     echo "                        ";
                     if ($this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "enabled")) {
                         // line 35
                         echo "                        <option value=\"";
                         echo twig_escape_filter($this->env, isset($context["code"]) ? $context["code"] : null, "html", null, true);
                         echo "\">";
                         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["periods"]) ? $context["periods"] : null, isset($context["code"]) ? $context["code"] : null, array(), "array"), "html", null, true);
                         echo " ";
                         echo twig_money_convert($this->env, $this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "price"));
                         echo " ";
                         if ($this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "setup") != "0.00") {
                             echo gettext("Setup:");
                             echo " ";
                             echo twig_money_convert($this->env, $this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "setup"));
                         }
                         echo "</option>\n                        ";
                     }
                     // line 37
                     echo "                        ";
                 }
                 $_parent = $context['_parent'];
                 unset($context['_seq'], $context['_iterated'], $context['code'], $context['prices'], $context['_parent'], $context['loop']);
                 $context = array_intersect_key($context, $_parent) + $_parent;
                 // line 38
                 echo "                    </select>\n                    ";
             }
             // line 40
             echo "\n                    ";
             // line 41
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "once") {
                 // line 42
                 echo "                    ";
                 echo twig_money_convert($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "once"), "price") + $this->getAttribute($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "once"), "setup"));
                 echo "\n                    ";
             }
             // line 44
             echo "\n                    ";
             // line 45
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "free") {
                 // line 46
                 echo "                    ";
                 echo twig_money_convert($this->env, 0);
                 echo "\n                    ";
             }
             // line 48
             echo "                    </label>\n                </td>\n            </tr>\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['addon'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 52
         echo "            </tbody>\n        </table>\n</div>\n";
     }
 }
 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     if (isset($context["request"])) {
         $_request_ = $context["request"];
     } else {
         $_request_ = null;
     }
     if (isset($context["guest"])) {
         $_guest_ = $context["guest"];
     } else {
         $_guest_ = null;
     }
     $context["product"] = $this->getAttribute($_request_, "order") ? $this->getAttribute($_guest_, "product_get", array(0 => array("id" => $this->getAttribute($_request_, "order"))), "method") : null;
     // line 2
     echo "<div class=\"accordion-group\" id=\"product-configuration\">\n    <div class=\"accordion-heading\">\n        <a class=\"accordion-toggle\" href=\"#order\" data-parent=\"#accordion1\" data-toggle=\"collapse\"><span class=\"awe-cog\"></span> ";
     // line 4
     echo gettext("Product Configuration");
     echo "</a>\n    </div>\n    ";
     // line 6
     if (isset($context["product"])) {
         $_product_ = $context["product"];
     } else {
         $_product_ = null;
     }
     if ($_product_) {
         // line 7
         echo "    <div id=\"order\" class=\"accordion-body collapse ";
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         if ($this->getAttribute($_request_, "order")) {
             echo "in";
         }
         echo "\">\n        <div class=\"accordion-inner\">\n            <form method=\"post\" style=\"background:none;\" class=\"form-";
         // line 9
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if (isset($context["guest"])) {
             $_guest_ = $context["guest"];
         } else {
             $_guest_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "form_id") ? $this->getAttribute($this->getAttribute($this->getAttribute($_guest_, "formbuilder_get", array(0 => array("id" => $this->getAttribute($_product_, "form_id"))), "method"), "style"), "type") : 0, "html", null, true);
         echo "\" action=\"";
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("/order");
         echo "/";
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "slug"), "html", null, true);
         echo "\" id=\"add-to-cart\" onsubmit=\"return false;\">\n\n            ";
         // line 11
         ob_start();
         // line 12
         echo "            <div class=\"well\">\n                <strong>";
         // line 13
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "title"), "html", null, true);
         echo "</strong>\n                ";
         // line 14
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_bbmd_filter($this->env, $this->getAttribute($_product_, "description"));
         echo "\n\n                ";
         // line 16
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if ($this->getAttribute($this->getAttribute($_product_, "pricing"), "type") == "recurrent") {
             // line 17
             echo "                ";
             if (isset($context["guest"])) {
                 $_guest_ = $context["guest"];
             } else {
                 $_guest_ = null;
             }
             $context["periods"] = $this->getAttribute($_guest_, "system_periods");
             // line 18
             echo "                <select name=\"period\" id=\"period-selector\">\n                    ";
             // line 19
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_product_, "pricing"), "recurrent"));
             foreach ($context['_seq'] as $context["code"] => $context["prices"]) {
                 // line 20
                 echo "                    ";
                 if (isset($context["prices"])) {
                     $_prices_ = $context["prices"];
                 } else {
                     $_prices_ = null;
                 }
                 if ($this->getAttribute($_prices_, "enabled")) {
                     // line 21
                     echo "                    <option value=\"";
                     if (isset($context["code"])) {
                         $_code_ = $context["code"];
                     } else {
                         $_code_ = null;
                     }
                     echo twig_escape_filter($this->env, $_code_, "html", null, true);
                     echo "\" data-bb-price=\"";
                     if (isset($context["prices"])) {
                         $_prices_ = $context["prices"];
                     } else {
                         $_prices_ = null;
                     }
                     echo twig_money_convert($this->env, $this->getAttribute($_prices_, "price"));
                     echo "\" name=\"period\">";
                     if (isset($context["periods"])) {
                         $_periods_ = $context["periods"];
                     } else {
                         $_periods_ = null;
                     }
                     if (isset($context["code"])) {
                         $_code_ = $context["code"];
                     } else {
                         $_code_ = null;
                     }
                     echo twig_escape_filter($this->env, $this->getAttribute($_periods_, $_code_, array(), "array"), "html", null, true);
                     echo " - ";
                     if (isset($context["prices"])) {
                         $_prices_ = $context["prices"];
                     } else {
                         $_prices_ = null;
                     }
                     echo twig_money_convert($this->env, $this->getAttribute($_prices_, "price"));
                     echo "</option>\n                    ";
                 }
                 // line 23
                 echo "                    ";
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['code'], $context['prices'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 24
             echo "                </select>\n                ";
         } elseif ($this->getAttribute($this->getAttribute($_product_, "pricing"), "type") == "free") {
             // line 26
             echo "                <span class=\"label label-info\">";
             echo gettext("FREE");
             echo "</span>\n                ";
         } else {
             // line 28
             echo "                <span class=\"label label-info\">";
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             echo twig_money_convert($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($_product_, "pricing"), "once"), "price"));
             echo "</span>\n                ";
         }
         // line 30
         echo "            </div>\n            ";
         $context["product_details"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
         // line 32
         echo "\n            ";
         // line 33
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         $context["tpl"] = "mod_service" . $this->getAttribute($_product_, "type") . "_order_form.phtml";
         // line 34
         echo "            ";
         if (isset($context["guest"])) {
             $_guest_ = $context["guest"];
         } else {
             $_guest_ = null;
         }
         if (isset($context["tpl"])) {
             $_tpl_ = $context["tpl"];
         } else {
             $_tpl_ = null;
         }
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if ($this->getAttribute($_guest_, "system_template_exists", array(0 => array("file" => $_tpl_)), "method")) {
             // line 35
             echo "                ";
             if (isset($context["tpl"])) {
                 $_tpl_ = $context["tpl"];
             } else {
                 $_tpl_ = null;
             }
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $template = $this->env->resolveTemplate($_tpl_);
             $template->display(array_merge($context, $_product_));
             // line 36
             echo "            ";
         } elseif ($this->getAttribute($_product_, "form_id") && $this->getAttribute($_guest_, "extension_is_on", array(0 => array("mod" => "formbuilder")), "method")) {
             // line 37
             echo "                ";
             if (isset($context["product_details"])) {
                 $_product_details_ = $context["product_details"];
             } else {
                 $_product_details_ = null;
             }
             echo twig_escape_filter($this->env, $_product_details_, "html", null, true);
             echo "\n                ";
             // line 38
             if (isset($context["guest"])) {
                 $_guest_ = $context["guest"];
             } else {
                 $_guest_ = null;
             }
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $context["form"] = $this->getAttribute($_guest_, "formbuilder_get", array(0 => array("id" => $this->getAttribute($_product_, "form_id"))), "method");
             // line 39
             echo "                ";
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $this->env->loadTemplate("mod_formbuilder_build.phtml")->display(array_merge($context, $_product_));
             // line 40
             echo "            ";
         } else {
             // line 41
             echo "                ";
             if (isset($context["product_details"])) {
                 $_product_details_ = $context["product_details"];
             } else {
                 $_product_details_ = null;
             }
             echo twig_escape_filter($this->env, $_product_details_, "html", null, true);
             echo "\n            ";
         }
         // line 43
         echo "\n            ";
         // line 44
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         $this->env->loadTemplate("mod_orderbutton_addons.phtml")->display(array_merge($context, $_product_));
         // line 45
         echo "\n            <input type=\"hidden\" name=\"multiple\" value=\"1\" />\n            <input type=\"hidden\" name=\"id\" value=\"";
         // line 47
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "id"), "html", null, true);
         echo "\" />\n               <button type=\"submit\" class=\"btn btn-primary\">";
         // line 48
         echo gettext("Order");
         echo "</button>\n        </div>\n        </form>\n    </div>\n    ";
     }
     // line 53
     echo "</div>";
 }
 public function getcurrency($_price = null, $_currency = null)
 {
     $context = $this->env->mergeGlobals(array("price" => $_price, "currency" => $_currency));
     $blocks = array();
     ob_start();
     try {
         // line 25
         echo "    ";
         echo twig_money_convert($this->env, isset($context["price"]) ? $context["price"] : null, isset($context["currency"]) ? $context["currency"] : null);
         echo "\n";
     } catch (Exception $e) {
         ob_end_clean();
         throw $e;
     }
     return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
 }
 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     $context["cart"] = $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "cart_get");
     // line 2
     echo "<div class=\"accordion-group\">\n    <div class=\"accordion-heading\">\n        <a class=\"accordion-toggle\" href=\"#checkout\" data-parent=\"#accordion1\" data-toggle=\"collapse\"><span class=\"awe-shopping-cart\"></span> ";
     // line 4
     echo gettext("Cart");
     echo " <span class=\"label label-warning pull-right\">";
     echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "items")), "html", null, true);
     echo "</span></a>\n    </div>\n    ";
     // line 6
     if ($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "items")) {
         // line 7
         echo "    <div id=\"checkout\" class=\"accordion-body collapse ";
         if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "checkout") && (isset($context["client"]) ? $context["client"] : null)) {
             echo "in";
         }
         echo "\">\n        <div class=\"accordion-inner\" id=\"checkout-inner\">\n\n            <table class=\"table table-striped table-bordered table-condensed\">\n                <thead>\n                <tr>\n                    <th>";
         // line 13
         echo gettext("Product");
         echo "</th>\n                    <th>";
         // line 14
         echo gettext("Price");
         echo "</th>\n                    <th style=\"width: 3%; text-align: center\"></th>\n                </tr>\n                </thead>\n                <tbody>\n                ";
         // line 19
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "items"));
         foreach ($context['_seq'] as $context["i"] => $context["item"]) {
             // line 20
             echo "                <tr>\n                    <td>\n                        ";
             // line 22
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "title"), "html", null, true);
             echo "\n                        ";
             // line 23
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity") > 1) {
                 // line 24
                 echo "                        x ";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity"), "html", null, true);
                 echo "\n                        ";
             }
             // line 26
             echo "\n                        ";
             // line 27
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "period")) {
                 // line 28
                 echo "                            (";
                 echo twig_period_title($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "period"));
                 echo ")\n                        ";
             }
             // line 30
             echo "                    </td>\n                    <td>\n                        ";
             // line 32
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "discount_price")) {
                 // line 33
                 echo "                            <del>";
                 echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "price") * $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity"));
                 echo "</del>\n                            <strong class=\"text-success\">";
                 // line 34
                 echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "price") * $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity") - $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "discount_price"));
                 echo "</strong>\n                        ";
             } else {
                 // line 36
                 echo "                            ";
                 echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "price") * $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity"));
                 echo "\n                        ";
             }
             // line 38
             echo "                    </td>\n                    <td><button data-cart-item-id=\"";
             // line 39
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "id"), "html", null, true);
             echo "\" class=\"btn btn-inverse btn-mini remove-cart-item\" title=\"";
             echo gettext("Remove item");
             echo "\"><strong><i class=\"awe-remove\"></i></strong></button></td>\n                </tr>\n\n                ";
             // line 42
             if ($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "show_custom_form_values")) {
                 // line 43
                 echo "                <tr>\n                    <td>\n                        ";
                 // line 45
                 if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "form_id") && $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "extension_is_on", array(0 => array("mod" => "formbuilder")), "method")) {
                     // line 46
                     echo "                        ";
                     $context["form"] = $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "formbuilder_get", array(0 => array("id" => $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "form_id"))), "method");
                     // line 47
                     echo "                        ";
                     // line 48
                     echo "                        <div class=\"well\">\n                            <dl class=\"dl-horizontal\">\n                                ";
                     // line 50
                     $context['_parent'] = (array) $context;
                     $context['_seq'] = twig_ensure_traversable(isset($context["item"]) ? $context["item"] : null);
                     foreach ($context['_seq'] as $context["field"] => $context["value"]) {
                         // line 51
                         echo "                                    ";
                         $context['_parent'] = (array) $context;
                         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["form"]) ? $context["form"] : null, "fields"));
                         foreach ($context['_seq'] as $context["_key"] => $context["form_field"]) {
                             // line 52
                             echo "                                        ";
                             if (!twig_test_empty(isset($context["value"]) ? $context["value"] : null)) {
                                 // line 53
                                 echo "                                            ";
                                 if ($this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "name") == (isset($context["field"]) ? $context["field"] : null)) {
                                     // line 54
                                     echo "                                            <dt>\n                                                ";
                                     // line 55
                                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "label"), "html", null, true);
                                     echo "\n                                            </dt>\n                                            <dd>\n                                                ";
                                     // line 58
                                     if ($this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "type") == "checkbox") {
                                         // line 59
                                         echo "                                                    ";
                                         $context['_parent'] = (array) $context;
                                         $context['_seq'] = twig_ensure_traversable(isset($context["value"]) ? $context["value"] : null);
                                         foreach ($context['_seq'] as $context["_key"] => $context["selection"]) {
                                             // line 60
                                             echo "                                                        ";
                                             $context['_parent'] = (array) $context;
                                             $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "options"));
                                             foreach ($context['_seq'] as $context["field_key"] => $context["field_value"]) {
                                                 // line 61
                                                 echo "                                                            ";
                                                 if ((isset($context["field_value"]) ? $context["field_value"] : null) == (isset($context["selection"]) ? $context["selection"] : null)) {
                                                     // line 62
                                                     echo "                                                                ";
                                                     echo twig_escape_filter($this->env, isset($context["field_key"]) ? $context["field_key"] : null, "html", null, true);
                                                     echo "\n                                                            ";
                                                 }
                                                 // line 64
                                                 echo "                                                        ";
                                             }
                                             $_parent = $context['_parent'];
                                             unset($context['_seq'], $context['_iterated'], $context['field_key'], $context['field_value'], $context['_parent'], $context['loop']);
                                             $context = array_intersect_key($context, $_parent) + $_parent;
                                             // line 65
                                             echo "                                                    ";
                                         }
                                         $_parent = $context['_parent'];
                                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['selection'], $context['_parent'], $context['loop']);
                                         $context = array_intersect_key($context, $_parent) + $_parent;
                                         // line 66
                                         echo "                                                ";
                                     } elseif ($this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "type") == "select" || $this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "type") == "radio") {
                                         // line 67
                                         echo "                                                    ";
                                         $context['_parent'] = (array) $context;
                                         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["form_field"]) ? $context["form_field"] : null, "options"));
                                         foreach ($context['_seq'] as $context["field_key"] => $context["field_value"]) {
                                             // line 68
                                             echo "                                                        ";
                                             if ((isset($context["field_value"]) ? $context["field_value"] : null) == (isset($context["value"]) ? $context["value"] : null)) {
                                                 // line 69
                                                 echo "                                                            ";
                                                 echo twig_escape_filter($this->env, isset($context["field_key"]) ? $context["field_key"] : null, "html", null, true);
                                                 echo "\n                                                        ";
                                             }
                                             // line 71
                                             echo "                                                    ";
                                         }
                                         $_parent = $context['_parent'];
                                         unset($context['_seq'], $context['_iterated'], $context['field_key'], $context['field_value'], $context['_parent'], $context['loop']);
                                         $context = array_intersect_key($context, $_parent) + $_parent;
                                         // line 72
                                         echo "                                                ";
                                     } else {
                                         // line 73
                                         echo "                                                    ";
                                         echo twig_escape_filter($this->env, isset($context["value"]) ? $context["value"] : null, "html", null, true);
                                         echo "\n                                                ";
                                     }
                                     // line 75
                                     echo "                                            </dd>\n                                            ";
                                 }
                                 // line 77
                                 echo "                                        ";
                             }
                             // line 78
                             echo "                                    ";
                         }
                         $_parent = $context['_parent'];
                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['form_field'], $context['_parent'], $context['loop']);
                         $context = array_intersect_key($context, $_parent) + $_parent;
                         // line 79
                         echo "                                ";
                     }
                     $_parent = $context['_parent'];
                     unset($context['_seq'], $context['_iterated'], $context['field'], $context['value'], $context['_parent'], $context['loop']);
                     $context = array_intersect_key($context, $_parent) + $_parent;
                     // line 80
                     echo "                            </dl>\n                        </div>\n                        ";
                 }
                 // line 83
                 echo "                    </td>\n                    <td></td>\n                </tr>\n                ";
             }
             // line 87
             echo "\n                ";
             // line 88
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "setup_price") != 0) {
                 // line 89
                 echo "                <tr>\n                    <td>";
                 // line 90
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "title"), "html", null, true);
                 echo " ";
                 echo gettext("setup");
                 echo "</td>\n                    <td>\n                        ";
                 // line 92
                 if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "discount_setup")) {
                     // line 93
                     echo "                        <del>";
                     echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "setup_price"));
                     echo "</del>\n                        ";
                     // line 94
                     echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "setup_price") - $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "discount_setup"));
                     echo "\n                        ";
                 } else {
                     // line 96
                     echo "                        ";
                     echo twig_money_convert($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "setup_price"));
                     echo "</td>\n                    ";
                 }
                 // line 98
                 echo "                </tr>\n                ";
             }
             // line 100
             echo "                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['item'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 101
         echo "                </tbody>\n            </table>\n\n            <div class=\"row-fluid\">\n                <div class=\"span6\">\n                    ";
         // line 106
         if (!$this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "promocode")) {
             // line 107
             echo "                    <a href=\"#\" id=\"show-promo-field\">";
             echo gettext("Have coupon code?");
             echo "</a>\n                    ";
         }
         // line 109
         echo "\n                    <form action=\"guest/cart/apply_promo\" method=\"post\" class=\"well\" id=\"apply-promo\" data-api-reload=\"1\" ";
         // line 110
         if (!$this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "promocode")) {
             echo "style=\"display:none\"";
         }
         echo ">\n                        <div class=\"control-group\">\n                            <div class=\"form-controls\">\n                                <div class=\"input-append\">\n                                    <input class=\"span8\" type=\"text\" name=\"promocode\" id=\"promocode\" value=\"";
         // line 114
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : null, "promocode", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["request"]) ? $context["request"] : null, "promocode"), $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "promocode")) : $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "promocode"), "html", null, true);
         echo "\" ";
         if ($this->getAttribute(isset($context["promo"]) ? $context["promo"] : null, "required")) {
             echo "required=\"required\"";
         }
         echo " placeholder=\"";
         echo gettext("Enter code");
         echo "\">\n                                    ";
         // line 115
         if ($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "promocode")) {
             // line 116
             echo "                                    <button class=\"btn\" id=\"remove-promo\" href=\"";
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/guest/cart/remove_promo");
             echo "\" type=\"button\" data-api-reload=\"1\">";
             echo gettext("Remove");
             echo "</button>\n                                    ";
         } else {
             // line 118
             echo "                                    <button class=\"btn\" type=\"submit\">";
             echo gettext("Apply");
             echo "</button>\n                                    ";
         }
         // line 120
         echo "                                </div>\n                            </div>\n                        </div>\n                        ";
         // line 131
         echo "                    </form>\n                </div>\n\n                <div class=\"span6\">\n                    <table class=\"table table-bordered table-striped\">\n\n                        ";
         // line 137
         if ($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "discount") > 0) {
             // line 138
             echo "                        <tr>\n                            <td><strong>";
             // line 139
             echo gettext("Subtotal:");
             echo "</strong></td>\n                            <td><strong>";
             // line 140
             echo twig_money_convert($this->env, $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "total") + $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "discount"));
             echo "</strong></td>\n                        </tr>\n                        <tr>\n                            <td><strong>";
             // line 143
             echo gettext("Discount:");
             echo "</strong></td>\n                            <td><strong>- ";
             // line 144
             echo twig_money_convert($this->env, $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "discount"));
             echo "</strong></td>\n                        </tr>\n                        ";
         }
         // line 147
         echo "\n                        ";
         // line 148
         $context["tax_amount"] = 0;
         // line 149
         echo "                        ";
         if ($this->getAttribute(isset($context["client"]) ? $context["client"] : null, "client_is_taxable")) {
             // line 150
             echo "                        ";
             $context["tax_rate"] = $this->getAttribute(isset($context["client"]) ? $context["client"] : null, "invoice_get_tax_rate");
             // line 151
             echo "                        ";
             $context["tax_amount"] = $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "total") * (isset($context["tax_rate"]) ? $context["tax_rate"] : null) / 100;
             // line 152
             echo "                        <tr>\n                            <td><strong>";
             // line 153
             echo gettext("VAT");
             echo " (";
             echo twig_escape_filter($this->env, isset($context["tax_rate"]) ? $context["tax_rate"] : null, "html", null, true);
             echo "%) :</strong></td>\n                            <td><strong>";
             // line 154
             echo twig_money_convert($this->env, isset($context["tax_amount"]) ? $context["tax_amount"] : null);
             echo "</strong></td>\n                        </tr>\n                        ";
         }
         // line 157
         echo "                        <tr>\n                            <td><strong>";
         // line 158
         echo gettext("Total:");
         echo "</strong></td>\n                            <td><strong>";
         // line 159
         echo twig_money_convert($this->env, $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "total") + (isset($context["tax_amount"]) ? $context["tax_amount"] : null));
         echo "</strong></td>\n                        </tr>\n\n                    </table>\n\n                    <form method=\"post\" action=\"client/cart/checkout\" class=\"form-horizontal\" id=\"checkout-form\" onsubmit=\"return false;\">\n                        <fieldset>\n                            ";
         // line 166
         $context["enough_in_balance"] = $this->getAttribute(isset($context["client"]) ? $context["client"] : null, "client_balance_get_total") >= $this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "total");
         // line 167
         echo "                            ";
         if ($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "total") && !(isset($context["enough_in_balance"]) ? $context["enough_in_balance"] : null)) {
             // line 168
             echo "                            <div class=\"control-group\">\n                                ";
             // line 169
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "invoice_gateways"));
             $context['loop'] = array('parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true);
             if (is_array($context['_seq']) || is_object($context['_seq']) && $context['_seq'] instanceof Countable) {
                 $length = count($context['_seq']);
                 $context['loop']['revindex0'] = $length - 1;
                 $context['loop']['revindex'] = $length;
                 $context['loop']['length'] = $length;
                 $context['loop']['last'] = 1 === $length;
             }
             foreach ($context['_seq'] as $context["_key"] => $context["gtw"]) {
                 // line 170
                 echo "                                ";
                 if (twig_in_filter($this->getAttribute($this->getAttribute(isset($context["cart"]) ? $context["cart"] : null, "currency"), "code"), $this->getAttribute(isset($context["gtw"]) ? $context["gtw"] : null, "accepted_currencies"))) {
                     // line 171
                     echo "                                <label class=\"radio\" for=\"";
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["gtw"]) ? $context["gtw"] : null, "id"), "html", null, true);
                     echo "\">\n                                    <input type=\"radio\" name=\"gateway_id\" id=";
                     // line 172
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["gtw"]) ? $context["gtw"] : null, "id"), "html", null, true);
                     echo " value=\"";
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["gtw"]) ? $context["gtw"] : null, "id"), "html", null, true);
                     echo "\" ";
                     echo $this->getAttribute(isset($context["loop"]) ? $context["loop"] : null, "first") ? "checked" : "";
                     echo "/>\n                                    ";
                     // line 173
                     echo gettext("Pay by");
                     echo " ";
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["gtw"]) ? $context["gtw"] : null, "title"), "html", null, true);
                     echo "\n                                </label>\n                                ";
                 }
                 // line 176
                 echo "                                ";
                 ++$context['loop']['index0'];
                 ++$context['loop']['index'];
                 $context['loop']['first'] = false;
                 if (isset($context['loop']['length'])) {
                     --$context['loop']['revindex0'];
                     --$context['loop']['revindex'];
                     $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                 }
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['gtw'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 177
             echo "                            </div>\n                            ";
         }
         // line 179
         echo "                            <div class=\"control-group\">\n                                <div class=\"controls\">\n                                    ";
         // line 181
         if (isset($context["enough_in_balance"]) ? $context["enough_in_balance"] : null) {
             // line 182
             echo "                                        <p>";
             echo gettext("Total amount will be deducted from account balance");
             echo "</p>\n                                    ";
         }
         // line 184
         echo "                                    <button class=\"btn btn-primary btn-large\" type=\"submit\">";
         echo gettext("Checkout");
         echo "</button>\n                                </div>\n                            </div>\n                        </fieldset>\n                    </form>\n\n                </div>\n            </div>\n        </div>\n    </div>\n    ";
     }
     // line 195
     echo "</div>\n<script type=\"text/javascript\">\n    \$('#remove-promo').click(function(e){\n        e.preventDefault();\n        bb.post(\"guest/cart/remove_promo\", {}, function(r){\n                bb.msg(\"";
     // line 200
     echo gettext("Promo code was removed");
     echo "\");\n                location.reload(false);\n        });\n\n    });\n\n    \$('.remove-cart-item').click(function(e){\n        e.preventDefault();\n        var btn = \$(this);\n        if (confirm('";
     // line 209
     echo gettext("Are you sure you want to remove this item from cart?");
     echo "')){\n            var item_id = \$(btn).attr('data-cart-item-id');\n            bb.post(\"guest/cart/remove_item\", {id: item_id}, function(r){\n                bb.msg(\"";
     // line 212
     echo gettext("Item was removed from cart");
     echo "\");\n                location.reload(false);\n            });\n        }\n\n\n    });\n</script>";
 }