<?php

/* default/template/extension/module/xtensions/checkout/xcheckout.twig */
class __TwigTemplate_9395739a604ed02a05a93167060b6eed4a58eb3606b28f6d99870ef6e9bdc689 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo (isset($context["xheader"]) ? $context["xheader"] : null);
        echo " 
<!--main content starts-->
<div id=\"content\">
";
        // line 4
        if ((isset($context["error_warning"]) ? $context["error_warning"] : null)) {
            // line 5
            echo "<div class=\"container\">
  <div class=\"alert alert-danger margintop20 marginbottom0\"><i class=\"fa fa-exclamation-circle\"></i> ";
            // line 6
            echo (isset($context["error_warning"]) ? $context["error_warning"] : null);
            echo "
    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
  </div>
</div>  
";
        }
        // line 10
        echo "    
<div id=\"myLoader\" class=\"loader\">
<!-- <div class=\"innerloader\"><i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i></div> -->
</div>
<div id=\"cvc\">";
        // line 14
        echo (isset($context["xcvc"]) ? $context["xcvc"] : null);
        echo "</div>
<div id=\"step_login_panel\" class=\"bottom\"></div>
<div id=\"step_address_panel\" class=\"bottom\"></div>
<div id=\"step_payment_panel\" class=\"bottom\"></div>
</div>
<script type=\"text/javascript\">
\$.ajaxSetup({ cache: false });
var address_block = false;
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';  
";
        // line 23
        if ( !(isset($context["logged"]) ? $context["logged"] : null)) {
            echo " 
\t\t\$(document).ready(function() {\t\t\t\t
            \tshowLoader();
                \$.ajax({
                    url: 'index.php?route=";
            // line 27
            echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
            echo "xlogin',
                    dataType: 'html',
                    success: function(html) {                    \t
                        \$('#step_login_panel').html(html);                        
                        \$('#step_login_panel').show();                        
\t\t\t\t\t\t\$('#step1').addClass('active');
\t\t\t\t\t\t\$('#step1').removeClass('disabled');\t\t\t\t\t\t
\t\t\t\t\t\thideLoader();
                    },
                    error: function(xhr, ajaxOptions, thrownError) {
                        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                    }
                });
            });
             ";
        } else {
            // line 41
            echo " 
            \$(document).ready(function() {
            \tshowLoader();
                \$.ajax({
                    url: 'index.php?route=";
            // line 45
            echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
            echo "xpayment_address',
                    dataType: 'html',
                    success: function(html) {                    \t
                    \t\$('#step1').removeClass('disabled');
                    \t\$('#step1').addClass('complete');
                    \t\$('#step2').removeClass('disabled');                        
                        \$('#step2').addClass('active');\t\t\t\t\t\t                        
                        \$('#step_address_panel').html(html);                                                
                        \$('#step_address_panel').show();                        
                        hideLoader();                        
                    },
                    error: function(xhr, ajaxOptions, thrownError) {
                        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                    }
                });
            });
           ";
        }
        // line 61
        echo "       \t
          \$(document).on(\"click\", \"#button-login, #button-register, #button-guest\", function(event) {       \t 
        \t  if(\$('#account').val() == 'login'){
            \t  form_tab = 'form_login';
              } else {
            \t  form_tab = 'form_register';
              }    \t     
             \$.ajax({
                url: 'index.php?route=";
        // line 69
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xlogin/validate',
                type: 'post',
                data: \$(\"#\"+form_tab).serialize(),
                dataType: 'json',
                beforeSend: function() {
            \t\$('#button-login').addClass('progress-bar-striped active');
                \$('#button-register').addClass('progress-bar-striped active');
                    showLoader();
                    \$('.warning, .error, .alert, .alert-warning, .alert-danger,.alert-dismissible').remove();
                },
                complete: function() {
                \t\$('#button-login').removeClass('progress-bar-striped active');
                \t\$('#button-register').removeClass('progress-bar-striped active');        \t
                },
                success: function(json) {
                    \$('.warning, .error, .alert, .alert-warning, .alert-danger,.alert-dismissible, .xerror, .text-danger').remove();
\t\t\t\t\t\$('.has-error').removeClass('has-error');\t\t\t\t\t
\t\t\t\t\tif (json.redirect) {
\t\t                location = json.redirect;
\t\t            }else if (json.next) {
                    \t\$('#step1').removeClass('active');
                    \t\$('#step1').addClass('complete');
                    \t\$('#click1').addClass('clickable');
                    \t\$('#undo1').show();
                    \t\$('#step2').removeClass('disabled');                            \t                        
                        \$('#step2').addClass('active');
                        \$('#step_login_panel').hide();
                        \$('html, body').animate({
                            scrollTop: \$('body').offset().top
                        }, 1);                                \t\t\t\t\t\t                        
                        \$('#step_address_panel').html(json.next);                        
                        \$('#step_address_panel').show();                                               \t
                        \$('#step1 a').attr('href','#login');                        
                    } else if (json.error) {
                    \tfor (i in json.error) {     
                    \t\tif (\$('#step_login_panel #input-'+i).parent().hasClass('input-group')) {
                    \t\t\t\$('#step_login_panel #input-'+i).parent().parent().addClass('has-error');
            \t\t\t\t\t\$('#step_login_panel #input-'+i).parent().after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t} else if (\$('#step_login_panel #input-'+i).parent().hasClass('isradio') || \$('#step_login_panel #input-'+i).parent().hasClass('ischeckbox') || \$('#step_login_panel #input-'+i).parent().hasClass('isfile')){       \t\t\t\t\t\t
                                \$('#step_login_panel #input-'+i).after('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error[i] + '</div>');                                
            \t\t\t\t}else {
        \t\t\t\t\t\t\$('#step_login_panel #input-'+i).parent().addClass('has-error');
            \t\t\t\t\t\$('#step_login_panel #input-'+i).after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t}       \t\t\t\t\t
        \t\t\t\t}    
                        if (json.error.captcha) {
                        \t\$('#captcha input[name=\\'captcha\\']').parent().addClass('has-error');
                        \t\$('#captcha input[name=\\'captcha\\']').parent().after('<span class=\"xerror\">' + json.error.captcha + '</span>');
                        }                        
                        if (json.error.warningagree) {                        \t
                        \t\$('#step_login_panel #xagreep').addClass('has-error');
                        \t\$('#step_login_panel #xagreep').prepend('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error.warningagree + '</div>');                            
                        }                                               
                        if (json.error.warning) {
                            \$('#xlogin-panel .is_first').before('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error.warning + '</div>');
                        }
                        \$('.warning').fadeIn('slow');
                    } 
\t\t\t\t\thideLoader();
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                }
            });
        });  
        \$(document).on(\"click\", \"#button-social-register\", function(event) {
             \$.ajax({
                url: 'index.php?route=";
        // line 136
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xsocial/validate',
                type: 'post',
                data: \$(\"#sociallogin\").serialize(),
                dataType: 'json',
                beforeSend: function() {
            \t\$('#button-social-register').addClass('progress-bar-striped active');
                    showLoader();
                    \$('.warning, .error, .alert-warning, .alert-danger').remove();
                },
                complete: function() {
                \t\$('#button-social-register').removeClass('progress-bar-striped active');      \t
                },
                success: function(json) {
                    \$('.warning, .error, .alert-warning, .alert-danger, .xerror, .text-danger').remove();
\t\t\t\t\t\$('.has-error').removeClass('has-error');\t\t\t\t\t
\t\t\t\t\tif (json.redirect) {
\t\t                location = json.redirect;
\t\t            } else if (json.error) {
                    \tfor (i in json.error) {     
                    \t\tif (\$('#socialloginField #input-'+i).parent().hasClass('input-group')) {
                    \t\t\t\$('#socialloginField #input-'+i).parent().parent().addClass('has-error');
            \t\t\t\t\t\$('#socialloginField #input-'+i).parent().after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t} else if (\$('#socialloginField #input-'+i).parent().hasClass('isradio') || \$('#step_login_panel #input-'+i).parent().hasClass('ischeckbox') || \$('#step_login_panel #input-'+i).parent().hasClass('isfile')){       \t\t\t\t\t\t
                                \$('#socialloginField #input-'+i).after('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error[i] + '</div>');                                
            \t\t\t\t}else {
        \t\t\t\t\t\t\$('#socialloginField #input-'+i).parent().addClass('has-error');
            \t\t\t\t\t\$('#socialloginField #input-'+i).after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t}
        \t\t\t\t}                     
                        if (json.error.warningagree) {                        \t
                        \t\$('#socialloginField #agreesocialouter').addClass('has-error');
                        \t\$('#socialloginField #agreesocialouter').prepend('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error.warningagree + '</div>');                            
                        }
                    } 
\t\t\t\t\thideLoader();
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                }
            });
        });                 
        \$(document).on(\"click\", \"#addAdress\", function(event) {
            \$.ajax({
                url: 'index.php?route=";
        // line 179
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_address/addAddress',
                type: 'post',
                data: \$(\"#form_add_address\").serialize(),
                dataType: 'json',
                beforeSend: function() {                    
                    \$('#addAdress').addClass('progress-bar-striped active');
                    \$('#addLoader').css({
                \t    height: \$('#addLoader').parent().height(), 
                \t    width: \$('#addLoader').parent().width()
                \t});
                \t\$('#addLoader').show();
                \tshowBar();
                    \$('#address_fields .warning,#address_fields .xerror,#address_fields .error,#address_fields .alert,#address_fields .alert-warning,#address_fields .alert-danger,#address_fields .alert-dismissible').remove();
                    \$('#address_fields .has-error').removeClass('has-error');
                },
                complete: function() {                \t
                \t\$('#addAdress').removeClass('progress-bar-striped active');                \t
                },
                success: function(json) {
                    \$('#addressfields .warning,#addressfields .error,#addressfields .alert,#addressfields .alert-warning,#addressfields .text-danger, #addressfields .alert-danger,#addressModal .alert-dismissible,#addressfields .xerror').remove();\t\t\t\t\t
                    if (json.redirect) {
                        location = json.redirect;
                    } else if (json.xpayment_address) {                    \t                            \t\t\t\t\t\t                        
                        \$('#step_address_panel').html(json.xpayment_address);
                        hideBar();                        
                    } else if (json.error) {
                    \tfor (i in json.error) {     
                    \t\tif (\$('#address_fields #input-'+i).parent().hasClass('input-group')) {
                    \t\t\t\$('#address_fields #input-'+i).parent().parent().addClass('has-error animated shake').one(animationEnd, function() {
        \t\t\t\t\t\t\t\$('#address_fields #input-'+i).parent().parent().removeClass('animated shake');  
        \t    \t\t        });   
            \t\t\t\t\t\$('#address_fields #input-'+i).parent().after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t} else if (\$('#address_fields #input-'+i).parent().hasClass('isradio') || \$('#address_fields #input-'+i).parent().hasClass('ischeckbox') || \$('#address_fields #input-'+i).parent().hasClass('isfile')){       \t\t\t\t\t\t
                                \$('#address_fields #input-'+i).after('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error[i] + '</div>');                                
            \t\t\t\t}else {
        \t\t\t\t\t\t\$('#address_fields #input-'+i).parent().addClass('has-error animated shake').one(animationEnd, function() {
        \t\t\t\t\t\t\t\$('#address_fields .has-error').removeClass('animated shake');  \t\t\t\t\t\t\t 
        \t    \t\t        });   
            \t\t\t\t\t\$('#address_fields #input-'+i).after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t}      \t\t\t\t\t
        \t\t\t\t}
        \t\t\t\t\$('#addLoader').hide();
        \t\t\t\thideBar();
        \t\t\t}                   
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                }
            });
        });
        \$(document).on(\"click\", \"#editAdress\", function(event) {
            \$.ajax({
                url: 'index.php?route=";
        // line 231
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_address/editAddress',
                type: 'post',
                data: \$(\"#form_edit_address\").serialize(),
                dataType: 'json',
                beforeSend: function() {                    
                    \$('#editAdress').addClass('progress-bar-striped active');
                    \$('#editLoader').css({
                      height: \$('#editLoader').parent().height(), 
                      width: \$('#editLoader').parent().width()
                  });
                  \$('#editLoader').show();
                  showBar();                    
                    \$('#address_fields_edit .warning,#address_fields_edit .error,#address_fields_edit .alert,#address_fields_edit .alert-warning,#address_fields_edit .alert-danger,#address_fields_edit .alert-dismissible, #address_fields_edit .xerror').remove();
                    \$('#address_fields_edit .has-error').removeClass('has-error');      
                },
                complete: function() {                  
                  \$('#editAdress').removeClass('progress-bar-striped active');                  
                },
                success: function(json) {                    
              \t\t\$('#addressModal_edit .has-error').removeClass('has-error');          
                    if (json.redirect) {
                        location = json.redirect;
                    } else if (json.xpayment_address) {                                        \t                            \t\t\t\t\t\t                        
                        \$('#step_address_panel').html(json.xpayment_address);
                        \$('#addressModal_edit').modal('hide');
                        \$('#editLoader').hide();
        \t\t        hideBar();                        
                    } else if (json.error) {
                    \tfor (i in json.error) {     
                    \t\tif (\$('#address_fields_edit #input-'+i).parent().hasClass('input-group')) {
                    \t\t\t\$('#address_fields_edit #input-'+i).parent().parent().addClass('has-error');
            \t\t\t\t\t\$('#address_fields_edit #input-'+i).parent().after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t} else if (\$('#address_fields_edit #input-'+i).parent().hasClass('isradio') || \$('#address_fields_edit #input-'+i).parent().hasClass('ischeckbox') || \$('#address_fields_edit #input-'+i).parent().hasClass('isfile')){       \t\t\t\t\t\t
                                \$('#address_fields_edit #input-'+i).after('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error[i] + '</div>');                                
            \t\t\t\t}else {
        \t\t\t\t\t\t\$('#address_fields_edit #input-'+i).parent().addClass('has-error');
            \t\t\t\t\t\$('#address_fields_edit #input-'+i).after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t}      \t\t\t\t\t
        \t\t\t\t}
        \t\t        \$('#editLoader').hide();
        \t\t        hideBar();
              \t\t}                
              },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                }
            });
        });
        \$(document).on(\"click\", \"#saveGuestAddress\", function(event) {
        \tvar element = this;
        \tvar section = \$(element).attr('section');
            \$.ajax({
                url: 'index.php?route=";
        // line 283
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xguest/addAddress',
                type: 'post',
                data: \$(\"#form_guest_address_\"+section).serialize(),
                dataType: 'json',
                beforeSend: function() {                    
                    \$(element).addClass('progress-bar-striped active');
                    \$('#guestLoader'+section).css({
                \t    height: \$('#addLoader').parent().height(), 
                \t    width: \$('#addLoader').parent().width()
                \t});
                    \$('#guestLoader'+section).show();
                \tshowBar();
                \t\$('#guestfields'+section+' .warning,#guestfields'+section+' .error,#guestfields'+section+' .alert,#guestfields'+section+' .alert-warning,#guestfields'+section+' .text-danger, #guestfields'+section+' .alert-danger,#addressModal .alert-dismissible,#guestfields'+section+' .xerror').remove();                    
                },
                complete: function() {                \t
                \t\$(element).removeClass('progress-bar-striped active');                \t
                },
                success: function(json) {
\t\t\t\t\t\$('#guestfields'+section+' .has-error').removeClass('has-error');
                    if (json.redirect) {
                        location = json.redirect;
                    } else if (json.xguest) {                    \t                            \t\t\t\t\t\t                        
                        \$('#step_address_panel').html(json.xguest);
                        hideBar();                       
                    } else if (json.error) {
                    \tfor (i in json.error) {     
                    \t\tif (\$('#guestfields'+section+' #input-'+i).parent().hasClass('input-group')) {
                    \t\t\t\$('#guestfields'+section+' #input-'+i).parent().parent().addClass('has-error');
            \t\t\t\t\t\$('#guestfields'+section+' #input-'+i).parent().after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t} else if (\$('#guestfields'+section+' #input-'+i).parent().hasClass('isradio') || \$('#guestfields'+section+' #input-'+i).parent().hasClass('ischeckbox') || \$('#guestfields'+section+' #input-'+i).parent().hasClass('isfile')){       \t\t\t\t\t\t
                                \$('#guestfields'+section+' #input-'+i).after('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json.error[i] + '</div>');                                
            \t\t\t\t}else {
        \t\t\t\t\t\t\$('#guestfields'+section+' #input-'+i).parent().addClass('has-error');
            \t\t\t\t\t\$('#guestfields'+section+' #input-'+i).after('<span class=\"xerror\">' + json.error[i] + '</span>');
        \t\t\t\t\t}      \t\t\t\t\t
        \t\t\t\t}
                    \t\$('#guestLoader'+section).hide();
        \t\t\t\thideBar();
        \t\t\t}                   
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
                }
            });
        });    
        \$(document).on(\"click\", \".removeAddress\", function(event) {
        \t  event.preventDefault();
        \t  var element = this;
        \t  \$.ajax({     
        \t    url: \$(element).attr('link'),
        \t    type: 'get',
        \t    dataType: 'json',
        \t    beforeSend: function() {      
        \t      \$('.fa-spin').remove();
        \t      \$(element).append(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
        \t      showBar();
        \t    },      
        \t    success: function(json) {     
        \t      if(json.redirect){
        \t        location = json.redirect;
        \t      } else if (json.xpayment_address) {
            \t      \$(element).closest('.col-sm-6.col-md-4,label').addClass('animated fadeOut').one(animationEnd, function() {
\t    \t\t        \t\$('#step_address_panel').html(json.xpayment_address);    
\t    \t\t        });                          \t\t\t\t\t\t                        
            \t      \$('#step_address_panel').html(json.xpayment_address);                     
                  }    
        \t      \$('.fa-spin').remove();
        \t      hideBar(); 
        \t    },
        \t    error: function(xhr, ajaxOptions, thrownError) {
        \t      alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
        \t    }
        \t  });
          });
          \$(document).delegate('.agree', 'click', function(e) {
        \t\te.preventDefault();
        \t\t\$('#modal-agree').remove();
        \t\tvar element = this;
        \t\t\$.ajax({
        \t\t\turl: \$(element).attr('href'),
        \t\t\ttype: 'get',
        \t\t\tdataType: 'html',
        \t\t\tbeforeSend: function() {
        \t\t\t\t\$(element).append(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
        \t\t\t},
        \t\t\tsuccess: function(data) {
        \t\t\t\thtml  = '<div id=\"modal-agree\" class=\"modal xmargin\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';
        \t\t\t\thtml += '  <div class=\"modal-dialog\">';
        \t\t\t\thtml += '    <div class=\"modal-content\">';
        \t\t\t\thtml += '      <div class=\"modal-header\">';
        \t\t\t\thtml += '        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>';
        \t\t\t\thtml += '        <h4 class=\"modal-title\">' + \$(element).text() + '</h4>';
        \t\t\t\thtml += '      </div>';
        \t\t\t\thtml += '      <div class=\"modal-body\">' + data + '</div>';
        \t\t\t\thtml += '    </div';
        \t\t\t\thtml += '  </div>';
        \t\t\t\thtml += '</div>';
        \t\t\t\t\$('body').append(html);
        \t\t\t\t\$('#modal-agree').modal('show');
        \t\t\t\t\$('.fa-spin').remove();
        \t\t\t}
        \t\t});
        \t});
          \$(document).delegate('.editAddress', 'click', function(e) {
      \t\te.preventDefault();
      \t\tvar element = this;
      \t\tif(\$(element).attr('inline')=='yes'){
\t      \t\t\$('#editAddressFields').html('');      \t\t
\t      \t\t\$.ajax({
\t      \t\t\turl: \$(element).attr('link'),
\t      \t\t\ttype: 'get',
\t      \t\t\tdataType: 'json',
\t      \t\t\tbeforeSend: function() {
\t      \t\t\t\t\$(element).append(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
\t      \t\t\t\tshowBar();
\t      \t\t\t},
\t      \t\t\tsuccess: function(json) {
\t          \t\t\tif(json.redirect){
\t              \t\t\tlocation = json.redirect;
\t              \t\t}else{              
\t              \t\t\t\$('.col-md-3.lborder').addClass('xblur');\t\t\t
\t      \t\t\t\t\t\$('#editAddressFields').html(json.editAddress);
\t      \t\t\t\t\ttoggleElement('#existingAddressPanel, #editAddressFields');
\t      \t\t\t\t\t\$('.fa-spin').remove();
\t      \t\t\t\t\thideBar();
\t              \t\t}
\t      \t\t\t}
\t      \t\t});
      \t\t}else{
      \t\t\t\$('#addressModal_edit').remove();
          \t\tvar element = this;
          \t\t\$.ajax({
          \t\t\turl: \$(element).attr('link'),
          \t\t\ttype: 'get',
          \t\t\tdataType: 'json',
          \t\t\tbeforeSend: function() {
          \t\t\t\t\$(element).append(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
          \t\t\t\tshowBar();
          \t\t\t},
          \t\t\tsuccess: function(json) {
              \t\t\tif(json.redirect){
                  \t\t\tlocation = json.redirect;
                  \t\t}else{      \t\t\t\t
    \t      \t\t\t\t\$('body').append(json.editAddress);
    \t      \t\t\t\t\$('#addressModal_edit').modal('show');
    \t      \t\t\t\t\$('.fa-spin').remove();
    \t      \t\t\t\thideBar();
                  \t\t}
          \t\t\t}
          \t\t});
          \t}
      \t}); 
function toggleElement(element){
\tvar elements = element.split(\",\");
\t\t\$.each(elements,function(i){\t
\t\tif(\$(elements[i]).is(\":visible\")){
\t\t\t\$(elements[i]).hide();
\t\t}else{
\t\t\t\$(elements[i]).fadeIn(1000);
\t\t}
\t});
}
\$(function () {
    \$('[data-toggle=\"tooltip\"]').tooltip()
  });
function showLoader(){
\t\$('#myLoader').css({
    \theight: \$('#myLoader').parent().height(), 
    \twidth: \$('#myLoader').parent().width()
\t});
\t\$('#myLoader').show();
\tshowBar();\t
};
function hideLoader(){
\t\$('#myLoader').hide();
\thideBar();\t
};
function showBar(){
\tNProgress.start();
\tNProgress.set(0.6); 
};
function hideBar(){
\tNProgress.inc();
\tNProgress.done();\t
};
\$(document).on(\"change\", \"input[name='shipping_method']\", function(event) {
  \tloadShippingMethods();\t
});
function loadShippingMethods(){
    \$.ajax({
        url: 'index.php?route=";
        // line 473
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xshipping_method/validate', 
        type: 'post',
        data: \$('#shipping_method input[type=\\'radio\\']:checked, textarea'),
        dataType: 'json',
        beforeSend: function() {},  
        complete: function() {},            
        success: function(json) {
            if(json.redirect){
                location = json.redirect;
                }else{
                    \$('#step_address_panel #shipping_method .shipping-table').html(json.shipping_method);
                    \$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json.xtotals);
                    if(json.shipping_methods== true){
                        \$('#agree-panel').show();
                        \$('.noshipping').remove();
                    }else{
                        \$('.noshipping').remove();
                        \$('#agree-panel').hide();
                        \$('#existingAddressPanel').prepend('<div class=\"alert alert-danger noshipping margintop20 marginbottom0\">'+ json.warning +'</div>');
                        \$('#step_address_panel #shipping_method .shipping-table').html('<span class=\"xerror noshipping marginbottom0\">'+ json.warning +'</span>');   
                    }
                }
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
        }
    });
};
\$(document).on(\"click\", \"#couponbtn1\", function(event) {
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 503
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateCoupon',
\t\ttype: 'post',
\t\tdata: \$('#coupon-panel input[type=\\'text\\']'),
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t \$('#coupon-panel .xerror, #coupon-panel .coupon').remove();
\t\t\t \$('#couponbtn1').attr('disabled', true);
\t\t\t \$('#couponbtn1').html('<i class=\"cvcapply fa fa-circle-o-notch fa-spin\"></i>');
\t\t\t showBar();
\t\t},
\t\tsuccess: function(json) {
\t\t\t if (json.error) {
\t\t\t\t \$('input[name=\\'coupon\\']').parent().after('<div class=\"couponapplied cvcapplied coupon alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['error']['error'] + '</div>');
\t\t\t } else if (json.applied){
\t\t\t\t \$('#coupon-panel input[name=\\'coupon\\']').parent().after('<div class=\"couponapplied cvcapplied coupon alert alert-success alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['applied'] + '</div>');
\t\t\t\t \$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json.xtotals);
\t\t\t }
\t\t\t hideBar();
\t\t\t \$('#couponbtn1').attr('disabled', false);
\t\t\t setTimeout(function(){
\t\t\t\t \$('.cvcapplied').fadeOut();
\t\t\t }, 10000);
\t\t\t \$('#couponbtn1').html('<i class=\"cvcapply fa fa-check\"></i>');
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
});
\$(document).on(\"click\", \"#voucherbtn1\", function(event) {
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 534
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateVoucher',
\t\ttype: 'post',
\t\tdata: \$('#voucher-panel input[type=\\'text\\']'),
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t \$('#voucher-panel .xerror, #voucher-panel .voucher').remove();
\t\t\t \$('#voucherbtn1').attr('disabled', true);
\t\t\t \$('#voucherbtn1').html('<i class=\"cvcapply fa fa-circle-o-notch fa-spin\"></i>');
\t\t\tshowBar();
\t\t},
\t\tsuccess: function(json) {
\t\t\tif (json['error']) {
         \t\t\$('input[name=\\'voucher\\']').parent().after('<div class=\"voucherapplied cvcapplied voucher alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['error']['error'] + '</div>');
\t\t\t } else if (json['applied']){
\t\t\t\t\$('#voucher-panel input[name=\\'voucher\\']').parent().after('<div class=\"voucherapplied cvcapplied voucher alert alert-success alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['applied'] + '</div>');
\t\t\t\t\$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json['xtotals']);
\t\t\t }
\t\t\t hideBar();
\t\t\t \$('#voucherbtn1').attr('disabled', false);
\t\t\t setTimeout(function(){
\t\t\t\t \$('.cvcapplied').fadeOut();
\t\t\t }, 10000);
\t\t\t \$('#voucherbtn1').html('<i class=\"cvcapply fa fa-check\"></i>');
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
});
\$(document).on(\"click\", \"#rewardbtn1\", function(event) {
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 565
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateReward',
\t\ttype: 'post',
\t\tdata: \$('#reward-panel input[type=\\'text\\']'),
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t\$('#reward-panel .xerror, #reward-panel .reward').remove();
\t\t\t\$('#rewardbtn1').attr('disabled', true);
\t\t\t\$('#rewardbtn1').html('<i class=\"cvcapply fa fa-circle-o-notch fa-spin\"></i>');
\t\t\tshowBar();
\t\t},
\t\tsuccess: function(json) {
\t\t\tif (json['error']) {
         \t\t\$('input[name=\\'reward\\']').parent().after('<div class=\"rewardapplied cvcapplied reward alert alert-warning alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['error']['error'] + '</div>');
\t\t\t } else if (json['applied']){
\t\t\t\t\$('#reward-panel input[name=\\'reward\\']').parent().after('<div class=\"rewardapplied cvcapplied reward alert alert-success alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' + json['applied'] + '</div>');
\t\t\t\t\$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json['xtotals']);
\t\t\t }
\t\t\t hideBar();
\t\t\t \$('#rewardbtn1').attr('disabled', false);
\t\t\t setTimeout(function(){
\t\t\t\t \$('#reward-panel .xerror, #reward-panel .reward').fadeOut();
\t\t\t }, 10000);
\t\t\t \$('#rewardbtn1').html('<i class=\"cvcapply fa fa-check\"></i>');
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
});
\$(document).on(\"click\", \"#couponbtn\", function(event) {\t 
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 596
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateCoupon',
\t\ttype: 'post',
\t\tdata: \$('#couponModal input[type=\\'text\\']'),
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t \$('#couponModal .xerror, #couponModal .coupon').remove();
\t\t\t \$('#couponModal .has-error').removeClass('has-error');
\t\t\t\$('#couponbtn').attr('disabled', true);
\t\t\tshowBar();\t\t\t\t
\t\t},\t\t\t
\t\tsuccess: function(json) {\t\t\t\t\t\t\t
\t\t\tif (json['error']) {
\t\t\t\t \$('#couponModal input[name=\\'coupon\\']').parent().addClass('has-error');
                \$('#couponModal input[name=\\'coupon\\']').after('<span class=\"xerror\">' + json['error']['error'] + '</span>');
\t\t\t} else if (json['applied']){\t\t\t\t 
\t\t\t\t \$('#couponModal input[name=\\'coupon\\']').after('<span class=\"coupon\" style=\"color:green\">' + json['applied'] + '</span>');
\t\t\t\t \$('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);\t\t\t\t\t
\t\t\t}            \t
\t\t\t hideBar();
\t\t\t \$('#couponbtn').attr('disabled', false);\t 
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});\t
\t
});
\$(document).on(\"click\", \"#voucherbtn\", function(event) {\t 
\$.ajax({
\turl: 'index.php?route=";
        // line 625
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateVoucher',
\ttype: 'post',
\tdata: \$('#voucherModal input[type=\\'text\\']'),
\tdataType: 'json',
\tbeforeSend: function() {
\t\t\$('.xerror, .voucher').remove();
\t\t\$('.has-error').removeClass('has-error');
\t\t\$('#voucherbtn').attr('disabled', true);
\t\tshowBar();\t\t\t\t
\t},\t\t\t\t\t
\tsuccess: function(json) {\t\t\t\t\t\t\t
\t\tif (json['error']) {
\t\t\t \$('#voucherModal input[name=\\'voucher\\']').parent().addClass('has-error');
            \$('#voucherModal input[name=\\'voucher\\']').after('<span class=\"xerror\">' + json['error']['error'] + '</span>');
\t\t} else if (json['applied']){\t\t\t\t 
\t\t\t \$('#voucherModal input[name=\\'voucher\\']').after('<span class=\"voucher\" style=\"color:green\">' + json['applied'] + '</span>');
\t\t\t \$('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);\t\t\t\t\t
\t\t}
\t\t hideBar();
\t\t \$('#voucherbtn').attr('disabled', false);\t 
\t},
\terror: function(xhr, ajaxOptions, thrownError) {
\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t}
});
});
\$(document).on(\"click\", \"#rewardbtn\", function(event) {\t 
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 653
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/validateReward',
\t\ttype: 'post',
\t\tdata: \$('#rewardModal input[type=\\'text\\']'),
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t \$('#rewardModal .xerror, #rewardModal .reward').remove();
\t\t\t \$('#rewardModal .has-error').removeClass('has-error');
\t\t\t\$('#rewardbtn').attr('disabled', true);
\t\t\tshowBar();\t\t\t\t
\t\t},\t\t\t
\t\tsuccess: function(json) {\t\t\t\t\t\t\t
\t\t\tif (json['error']) {
\t\t\t\t \$('#rewardModal input[name=\\'reward\\']').parent().addClass('has-error');
                 \$('#rewardModal input[name=\\'reward\\']').after('<span class=\"xerror\">' + json['error']['error'] + '</span>');
\t\t\t} else if (json['applied']){\t\t\t\t 
\t\t\t\t \$('#rewardModal input[name=\\'reward\\']').after('<span class=\"reward\" style=\"color:green\">' + json['applied'] + '</span>');
\t\t\t\t \$('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);\t\t\t\t\t
\t\t\t}          \t
\t\t\t hideBar();
\t\t\t \$('#rewardbtn').attr('disabled', false);\t 
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});\t
\t
});
\$(document).on(\"click\", \"#commentbtn\", function(event) {\t 
\$.ajax({
\turl: 'index.php?route=";
        // line 682
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcvc/addComment',
\ttype: 'post',
\tdata: \$('#commentModal textarea'),
\tdataType: 'json',
\tbeforeSend: function() {
\t\t\$('.comment').remove();\t\t\t 
\t\t\$('#commentbtn').attr('disabled', true);
\t\tshowBar();\t\t\t\t
\t},\t\t\t\t\t
\tsuccess: function(json) {\t\t\t\t\t\t\t
\t\tif (json.applied){\t\t\t\t 
\t\t\t \$('#commentModal textarea[name=\\'comment\\']').after('<span class=\"comment\" style=\"color:green\">' + json['applied'] + '</span>');\t\t\t\t\t
\t\t}\t\t\t 
\t\t \$('#commentbtn').attr('disabled', false);
\t\t hideBar();\t 
\t},
\terror: function(xhr, ajaxOptions, thrownError) {
\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t}
});\t

});
// Currency
\$(document).on(\"click\", \"#currency .currency-select\", function(event) {
\tevent.preventDefault();
\t\$('#currency input[name=\\'currency_code\\']').attr('value', \$(this).attr('name'));
\t\$('#currency').submit();
});
// Language
\$('#language a').on('click', function(e) {
\te.preventDefault();
\t\$('#language input[name=\\'language_code\\']').attr('value', \$(this).attr('href'));
\t\$('#language').submit();
});
\$(document).on(\"submit\", \"#sociallogin, #form_login, #form_guest_address_payment, #form_guest_address_shipping, #form_guest, #form_edit_address, #form_add_address, #form_register, #form_add_reward, #form_add_coupon, #form_add_voucher, #form_add_comment, #form_add_address, #form_edit_address,#form_add_guest_payment_address, #form_add_guest_shipping_address\", function(event) {\t
\tevent.preventDefault();
});
function same_guest_shipping(element,psaddress,paddress,payment_address){\t
    if(\$(element).prop(\"checked\") == true) {
      \$('.xshipping').css('display','none');
      \$('.padd').html(psaddress);
      \$('.payment-address-panel').addClass('col-md-12');
      \$('.payment-address-panel').removeClass('col-md-6');
      if(payment_address){
      showLoader();  
      \$.ajax({
            url: 'index.php?route=";
        // line 728
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xguest/sameAddress',
            type: 'post',
            data: \$('#guestPage input[type=\\'checkbox\\']:checked, textarea'),
            dataType: 'json',
            success: function(json) {              
                if (json.redirect) {
                    location = json.redirect;
                }else{
            \t\t\$('#step_address_panel').html(json.xguest);
                    \$('#step_address_panel').show();
                    hideLoader();
            \t}                    
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
            }
        });
      }
    }else{
    \t\$('.payment-address-panel').addClass('col-md-6');
        \$('.payment-address-panel').removeClass('col-md-12');
    \t\$('.xshipping').css('display','block');
        \$('.padd').html(paddress);
        showLoader(); 
    \t\$.ajax({
            url: 'index.php?route=";
        // line 753
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xguest/notSameAddress',
            type: 'get',
            dataType: 'json',
            success: function(json) {              
                if (json.redirect) {
                    location = json.redirect;
                } else{
                \t\$('#step_address_panel').html(json.xguest);
                    \$('#step_address_panel').show();
                \thideLoader();
                }                  
            },
        });
    }
}
function loadZone(element,country_id, zone_id,text_select,text_none){\t\t
\t\t  if (country_id == '') return;
\t\t  \$.ajax({
\t\t    url: 'index.php?route=";
        // line 771
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "checkout/country&country_id=' + country_id,
\t\t    dataType: 'json',
\t\t    beforeSend: function() {
\t\t    \t\$('#'+element+' select[name=\\'country_id\\']').after(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
\t\t    },
\t\t    complete: function() {
\t\t      \$('.fa-spin').remove();
\t\t    },      
\t\t    success: function(json) {
\t\t      if (json.postcode_required == '1') {
\t\t        \$('#payment-postcode-required').show();
\t\t      } else {
\t\t        \$('#payment-postcode-required').hide();
\t\t      }\t\t      
\t\t      html = '<option value=\"\">'+text_select+'</option>';\t\t      
\t\t      if (json.zone != '') {
\t\t        for (i = 0; i < json.zone.length; i++) {
\t\t          html += '<option value=\"' + json.zone[i].zone_id + '\"';\t\t            
\t\t          if (json.zone[i].zone_id == zone_id) {
\t\t               html += ' selected=\"selected\"';
\t\t          }\t\t  
\t\t          html += '>' + json.zone[i].name + '</option>';
\t\t        }
\t\t      } else {
\t\t        html += '<option value=\"0\" selected=\"selected\">'+text_none+'</option>';
\t\t      }
\t\t      
\t\t      \$('#'+element+' select[name=\\'zone_id\\']').html(html);    
\t\t      \$('#'+element+' select[name=\\'zone_id\\']').trigger('change');   
\t\t    },
\t\t    error: function(xhr, ajaxOptions, thrownError) {
\t\t      alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t    }
\t\t  });\t
}
\$(document).on(\"change\", \"input[name='address_id'], input[name='saddress_id'], #addressPage input[type='checkbox'][name='xshipping_address_check']\", function(event) {
\t  \$.ajax({
\t    url: 'index.php?route=";
        // line 808
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_address/validate', 
\t    type: 'post',
\t    data: \$('#existingAddress input[type=\\'radio\\']:checked, #existingAddress input[type=\\'hidden\\'], #agreeText input[type=\\'checkbox\\']:checked, #existingAddress input[type=\\'checkbox\\']:checked, #existingAddress textarea'),
\t    dataType: 'json',
\t    beforeSend: function() {      
\t      \$('#sLoader').css({
\t              height: \$('#sLoader').parent().height(), 
\t              width: \$('#sLoader').parent().width()
\t          });         
\t          \$('#sLoader').show();
\t          showBar();
\t    },  
\t    complete: function() {
\t      
\t    },      
\t    success: function(json) {   
\t      ";
        // line 824
        if ((isset($context["shipping_required"]) ? $context["shipping_required"] : null)) {
            // line 825
            echo "\t      \$('#step_address_panel #shipping_method').html(json.xshipping_method);
\t      loadShippingMethods();
\t     ";
        }
        // line 828
        echo "\t     \$('#sLoader').hide();
\t     hideBar();         
\t    },
\t    error: function(xhr, ajaxOptions, thrownError) {
\t      alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t    }
\t  }); 
\t});
\$(document).on(\"click\", \"#payment-accordion a.heading-panel\", function(event) {\t
\tif(\$(this).parents('.panel').children('.panel-collapse').hasClass('in')){
        event.stopPropagation();
        event.preventDefault();
    }
\tif(payment_method_code!=\$(this).attr('payment_method')){
\t\tpayment_method_code=\$(this).attr('payment_method');     
\t\tloadPaymentMethodAccordion(payment_method_code);   
\t}\t        
});
\$(document).on(\"click\", \"#step_payment_panel #paymentMethodTab [data-toggle='tab']\", function(event) {
\tif(payment_method_code != \$(this).attr('payment_method')){
\t\tpayment_method_code = \$(this).attr('payment_method');   
\t\tloadPaymentMethodTab(payment_method_code);
\t}\t        
});
function loadPaymentMethodAccordion(payment_method){
\t\$('#payment-accordion .panel-body').html('');
\t\$('#step_payment_panel #panel-body'+payment_method).html('<div class=\"text-center\"><i style=\"margin:60px auto;font-size:24px;\" class=\"fa fa-spinner fa-spin fa-lg fa-fw\"></i></div>');\t\t
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 856
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_method/validate', 
\t\ttype: 'post',
\t\tdata: ({payment_method:payment_method}),
\t\tdataType: 'json',
\t\tbeforeSend: function() {\t\t\t
\t\t\tshowBar();
\t\t\t\$('#pLoader').css({
        \t    height: \$('#pLoader').parent().height(), 
        \t    width: \$('#pLoader').parent().width()
        \t});
\t\t\t\$('#pLoader').show();\t\t\t\t\t
\t\t},\t\t
\t\tsuccess: function(json) {
\t\t\tif (json.redirect) {
\t\t\t\tlocation = json.redirect;
\t\t\t} else if (json.error) {
\t\t\t\tif (json.error.warning_shipping) {
\t\t\t\t\t\$('#payment-method .checkout-content').prepend('<div class=\"warning\" style=\"display: none;\">' + json.error.warning_shipping + '<img src=\"catalog/view/theme/default/image/close.png\" alt=\"\" class=\"close\" /></div>');\t\t\t\t\t\t
\t\t\t\t\t\$('.warning').fadeIn('slow');
\t\t\t\t}
\t\t\t\tif (json.error.warning_payment) {
\t\t\t\t\t\$('#payment-method .checkout-content').prepend('<div class=\"warning\" style=\"display: none;\">' + json.error.warning_payment + '<img src=\"catalog/view/theme/default/image/close.png\" alt=\"\" class=\"close\" /></div>');\t\t\t\t\t\t
\t\t\t\t\t\$('.warning').fadeIn('slow');
\t\t\t\t}\t
\t\t\t\thideBar();
\t\t\t\t\$('#pLoader').hide();\t\t\t
\t\t\t} else {
\t\t\t\t\$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #step_payment_panel #totals').html(json['xtotals']);
\t\t\t\t\$('.youpay').html(json['totals']);
\t\t\t\t\$.ajax({
\t\t\t\t\turl: 'index.php?route=checkout/confirm',
\t\t\t\t\tdataType: 'html',
\t\t\t\t\tsuccess: function(html) {\t\t\t\t\t\t
\t\t\t\t\t\t\$('#step_payment_panel #panel-body'+payment_method).html(html);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t},
\t\t\t\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\t\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t\t\t\t}
\t\t\t\t});\t
\t\t\t\t/*\$('#step_payment_panel #payment-accordion').on('shown.bs.collapse', function (e) {    \t
\t\t\t        var offset = \$('.panel > .panel-collapse.in').offset();
\t\t\t        if(offset) {
\t\t\t            \$('html,body').animate({
\t\t\t                scrollTop: \$('.panel > .panel-collapse.in').offset().top-50
\t\t\t            }, 500); 
\t\t\t        }
\t\t\t    });
\t\t\t    */\t\t\t\t\t
\t\t\t\thideBar();
\t\t\t\t\$('#pLoader').hide();\t
\t\t\t}
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
}
function loadPaymentMethodTab(payment_method){
\t\$.ajax({
\t\turl: 'index.php?route=";
        // line 915
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_method/validate', 
\t\ttype: 'post',
\t\tdata: ({payment_method:payment_method_code}),
\t\tdataType: 'json',
\t\tbeforeSend: function() {\t
\t\t\t\$('li.payment_method_list').addClass('disabled');\t
\t\t\tshowBar();
\t\t\t\$('#pLoader').show();\t\t\t\t
\t\t},\t
\t\tcomplete: function() {\t\t\t\t
\t\t},\t\t\t
\t\tsuccess: function(json) {\t\t\t\t
\t\t\tif (json.redirect) {
\t\t\t\tlocation = json.redirect;
\t\t\t} else if (json.error) {
\t\t\t\tif (json.error.warning_shipping) {
\t\t\t\t\t\$('#payment-method .checkout-content').prepend('<div class=\"warning\" style=\"display: none;\">' + json.error.warning_shipping + '<img src=\"catalog/view/theme/default/image/close.png\" alt=\"\" class=\"close\" /></div>');\t\t\t\t\t\t
\t\t\t\t\t\$('.warning').fadeIn('slow');
\t\t\t\t}
\t\t\t\tif (json.error.warning_payment) {
\t\t\t\t\t\$('#payment-method .checkout-content').prepend('<div class=\"warning\" style=\"display: none;\">' + json.error.warning_payment + '<img src=\"catalog/view/theme/default/image/close.png\" alt=\"\" class=\"close\" /></div>');\t\t\t\t\t\t
\t\t\t\t\t\$('.warning').fadeIn('slow');
\t\t\t\t}\t
\t\t\t\t\$('li.payment_method_list').removeClass('disabled');
\t\t\t\thideBar();
\t\t\t\t\$('#pLoader').hide();\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t} else {
\t\t\t\t\$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #step_payment_panel #totals').html(json['xtotals']);
\t\t\t\t\$('.youpay').html(json['totals']);
\t\t\t\t\$.ajax({
\t\t\t\t\turl: 'index.php?route=checkout/confirm',
\t\t\t\t\tdataType: 'html',
\t\t\t\t\tasync:false,
\t\t\t\t\tsuccess: function(html) {\t\t\t\t\t\t
\t\t\t\t\t\t\$('#step_payment_panel #spayment-method-content').html(html);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t},
\t\t\t\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\t\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t\t\t\t}
\t\t\t\t});
\t\t\t\t\$('li.payment_method_list').removeClass('disabled');
\t\t\t\thideBar();
\t\t\t\t\$('#pLoader').hide();
\t\t\t}
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
}
function callPaymentFromAddress(){
  \$.ajax({
        url: 'index.php?route=";
        // line 967
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_address/validate&showpayment=1',
        type: 'post',
        data: \$('#existingAddress input[type=\\'radio\\']:checked, #existingAddress input[type=\\'hidden\\'], #agreeText input[type=\\'checkbox\\']:checked, #existingAddress input[type=\\'checkbox\\']:checked, #existingAddress textarea'),
\t    dataType: 'json',           
        beforeSend: function() {
          \tshowLoader();                       
            \$('#button-payment, #head-progress').addClass('progress-bar-striped active');            
        },
        success: function(json) {
            if(json.redirect){
              location = json.redirect;
            }else if(json.xpayment_method){
            \t\$('#step_payment_panel').html(json.xpayment_method);
            \tshowStepPayment();            \t
            }                       
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
        }
    });
}
function callPaymentFromGuest(){\t
  \$.ajax({
        url: 'index.php?route=";
        // line 990
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xpayment_method&direct=1',
        type: 'post',
\t\tdata: \$('textarea'),
\t\tdataType: 'json',
        beforeSend: function() {                    
          \$('#button-payment').addClass('progress-bar-striped active'); 
          showLoader();       
        },        
        success: function(json) {
        \t \$('#step_payment_panel').html(json.xpayment_method);
        \t showStepPayment();             
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
        }
    });
}
function showStepPayment(){
\t\$('#step_login_panel').hide();
    \$('#step_address_panel').hide();
    \$('html, body').animate({
          scrollTop: \$('body').offset().top
      }, 1);
      
      \$('#step_payment_panel').show();            
      \$('#step2').removeClass('active');
\t\t\$('#step2').addClass('complete');
\t\t\$('#step2 a').attr('href','#step_address_panel');
\t\t\$('#click2').addClass('clickable');
\t\t\$('#undo2').show(); 
\t\t\$('#step3').removeClass('disabled');
\t\t\$('#step3').addClass('active');
\t\t\$('#button-payment').removeClass('progress-bar-striped active');
\t\thideLoader();
}
\$(document).on(\"change\", '#addressPage input[type=\"radio\"][name=\"address_id\"]', function(event) {
    var \$this = \$(this);
    if(address_block){
\t    \$this.closest('.row').find('div.panel-heading.selected').removeClass('selected');
\t    \$this.closest('.panel-heading').addClass('selected');
\t} else {
    \t\$this.closest('.payment-address').find('.address-label.selected').removeClass('selected');
    \t\$this.closest('.address-label').addClass('selected');
\t}
});
\$(document).on(\"change\", '#addressPage input[type=\"radio\"][name=\"saddress_id\"]', function(event) {
    var \$this = \$(this);
\tif(address_block){
    \t\$this.closest('.row').find('div.panel-footer.selected').removeClass('selected');
    \t\$this.closest('.panel-footer').addClass('selected');
\t} else {
    \t\$this.closest('.shipping-address').find('.address-label.selected').removeClass('selected');
    \t\$this.closest('.address-label').addClass('selected');
\t}
});
\$(document).on(\"change\", '#addressPage input[type=\"checkbox\"][name=\"xshipping_address_check\"]', function(event) {
\tif(address_block){
\t  \tif(this.checked) {
\t      \t\$('.panel-footer').hide();
\t      \t\$('.padd').html('";
        // line 1049
        echo (isset($context["text_psaddress"]) ? $context["text_psaddress"] : null);
        echo "');
      \t}else{
\t      \t\$('.panel-footer').show();
\t      \t\$('.padd').html('";
        // line 1052
        echo (isset($context["text_paddress"]) ? $context["text_paddress"] : null);
        echo "');
      \t}
\t} else {
    \tif(this.checked) {
        \t\$('.payment-address-panel').removeClass('col-md-6');
        \t\$('.payment-address-panel').addClass('col-md-12');
        \t\$('.shipping-address-panel').hide();
        \t\$('.address-type span.padd').html('";
        // line 1059
        echo (isset($context["text_psaddress"]) ? $context["text_psaddress"] : null);
        echo "');
    \t}else{
    \t\t\$('.payment-address-panel').removeClass('col-md-12');
        \t\$('.payment-address-panel').addClass('col-md-6');
        \t\$('.shipping-address-panel').show();
        \t\$('.address-type span.padd').html('";
        // line 1064
        echo (isset($context["text_paddress"]) ? $context["text_paddress"] : null);
        echo "');
    \t}
\t}
});
\$(document).on(\"change\", '#addressPage input[type=\"checkbox\"][name=\"agree\"]', function(event) {
  if(this.checked) {
      \$('#progress-continue').css('display','block');
      \$('#progress-continue-disabled').css('display','none');
  }else{
      \$('#progress-continue').css('display','none');
      \$('#progress-continue-disabled').css('display','block');        
   }
});
\$(document).on(\"click\", 'button[id^=\\'button-custom-field\\']', function(event) {\t
\t  var node = this;
\t  \$('#form-upload').remove();
\t  \$('body').prepend('<form enctype=\"multipart/form-data\" id=\"form-upload\" style=\"display: none;\"><input type=\"file\" name=\"file\" /></form>');
\t  \$('#form-upload input[name=\\'file\\']').trigger('click');

\t  if (typeof timer != 'undefined') {
\t      clearInterval(timer);
\t  }
\t  timer = setInterval(function() {
\t\t  if (\$('#form-upload input[name=\\'file\\']').val() != '') {
\t      clearInterval(timer);
\t      \$.ajax({
\t        url: 'index.php?route=tool/upload',
\t        type: 'post',
\t        dataType: 'json',
\t        data: new FormData(\$('#form-upload')[0]),
\t        cache: false,
\t        contentType: false,
\t        processData: false,
\t        beforeSend: function() {
\t          \$(node).button('loading');
\t        },
\t        complete: function() {
\t          \$(node).button('reset');
\t        },
\t        success: function(json) {
\t          \$(node).parent().find('.text-danger').remove();
\t          if (json.error) {
\t        \t  \$(node).parent().find('input[name^=\\'custom_field\\']').after('<div class=\"text-danger\">' + json['error'] + '</div>');
\t          }
\t          if (json.success) {
\t            alert(json.success);
\t            \$(node).parent().find('input[name^=\\'custom_field\\']').val(json['code']);
\t          }
\t        },
\t        error: function(xhr, ajaxOptions, thrownError) {
\t          alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t        }
\t      });
\t    }
\t  }, 500);
\t});
var xcart = {\t\t
\t\t'xupdate': function(key, quantity,section) {
\t\t\tif(quantity < 1){
\t\t\t\txcart.xremove(key,section);
\t\t\t}else{\t\t\t
\t\t\t\t\$.ajax({
\t\t\t\t\turl: 'index.php?route=";
        // line 1126
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcart/edit',
\t\t\t\t\ttype: 'post',
\t\t\t\t\tdata: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1) + '&section=' + section,
\t\t\t\t\tdataType: 'json',
\t\t\t\t\tbeforeSend: function() {
\t\t\t\t\t\tshowBar();
\t\t\t\t\t},
\t\t\t\t\tsuccess: function(json) {
\t\t\t\t\t\tif(section == 'address'){
\t\t\t\t\t\t\t\$('#step_address_panel').html(json.xpayment_address);
\t\t\t\t\t\t}
\t\t\t\t\t\t\$('#step_login_panel #xcart').html(json.xcart);
\t\t\t\t\t\t\$('#step_login_panel #totals').html(json.xtotals);
\t\t\t\t\t\thideBar();
\t\t\t\t\t}
\t\t\t\t});
\t\t\t}
\t\t},
\t\t'xremove': function(key,section) {
\t\t\t\$.ajax({
\t\t\t\turl: 'index.php?route=";
        // line 1146
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcart/remove',
\t\t\t\ttype: 'post',
\t\t\t\tdata: 'key=' + key + '&section=' + section,
\t\t\t\tdataType: 'json',
\t\t\t\tbeforeSend: function() {
\t\t\t\t\tshowBar();
\t\t\t\t},
\t\t\t\tsuccess: function(json) {
\t\t\t\t\tif(section == 'address'){
\t\t\t\t\t\t\$('#step_address_panel').html(json.xpayment_address);
\t\t\t\t\t}
\t\t\t\t\t\$('#step_login_panel #xcart').html(json.xcart);
\t\t\t\t\t\$('#step_login_panel #totals').html(json.xtotals);
\t\t\t\t\thideBar();
\t\t\t\t}
\t\t\t});
\t\t},
\t\t'wishlist': function(product_id,key,section) {
\t\t\t\$.ajax({
\t\t\t\turl: 'index.php?route=";
        // line 1165
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcart/wishlist',
\t\t\t\ttype: 'post',
\t\t\t\tdata: 'product_id=' + product_id + '&key=' + key + '&section=' + section,
\t\t\t\tdataType: 'json',
\t\t\t\tbeforeSend: function() {
\t\t\t\t\tshowBar();
\t\t\t\t},
\t\t\t\tsuccess: function(json) {
\t\t\t\t\tif(section == 'address'){
\t\t\t\t\t\t\$('#step_address_panel').html(json.xpayment_address);
\t\t\t\t\t}
\t\t\t\t\t\$('#step_login_panel #xcart').html(json.xcart);
\t\t\t\t\t\$('#step_login_panel #totals').html(json.xtotals);
\t\t\t\t\thideBar();
\t\t\t\t}
\t\t\t});
\t\t}
}
var xvoucher = {
\t\t'xremove': function(key,section) {
\t\t\t\$.ajax({
\t\t\t\turl: 'index.php?route=";
        // line 1186
        echo (isset($context["xtensions_controller_path"]) ? $context["xtensions_controller_path"] : null);
        echo "xcart/removeVoucher',
\t\t\t\ttype: 'post',
\t\t\t\tdata: 'key=' + key + '&section=' + section,
\t\t\t\tdataType: 'json',
\t\t\t\tbeforeSend: function() {
\t\t\t\t\tshowBar();
\t\t\t\t},
\t\t\t\tsuccess: function(json) {
\t\t\t\t\tif(section == 'address'){
\t\t\t\t\t\t\$('#step_address_panel').html(json.xpayment_address);
\t\t\t\t\t}
\t\t\t\t\t\$('#step_login_panel #xcart').html(json.xcart);
\t\t\t\t\t\$('#step_login_panel #totals').html(json.xtotals);
\t\t\t\t\thideBar();
\t\t\t\t}
\t\t\t});
\t\t}
}
function toggleOptions(id){
\t\$('#'+id).toggle();\t
}
\$(document).on(\"cut copy paste\",\".dependent\",function(e) {
    e.preventDefault();
    alert('";
        // line 1209
        echo (isset($context["text_paste_not_allowed"]) ? $context["text_paste_not_allowed"] : null);
        echo "');
});
</script>
";
        // line 1212
        if ((isset($context["custom_js"]) ? $context["custom_js"] : null)) {
            echo " 
<script type=\"text/javascript\">
";
            // line 1214
            echo (isset($context["custom_js"]) ? $context["custom_js"] : null);
            echo " 
</script>
";
        }
        // line 1216
        echo " 
";
        // line 1217
        echo (isset($context["xfooter"]) ? $context["xfooter"] : null);
        echo " 
";
    }

    public function getTemplateName()
    {
        return "default/template/extension/module/xtensions/checkout/xcheckout.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  1369 => 1217,  1366 => 1216,  1360 => 1214,  1355 => 1212,  1349 => 1209,  1323 => 1186,  1299 => 1165,  1277 => 1146,  1254 => 1126,  1189 => 1064,  1181 => 1059,  1171 => 1052,  1165 => 1049,  1103 => 990,  1077 => 967,  1022 => 915,  960 => 856,  930 => 828,  925 => 825,  923 => 824,  904 => 808,  864 => 771,  843 => 753,  815 => 728,  766 => 682,  734 => 653,  703 => 625,  671 => 596,  637 => 565,  603 => 534,  569 => 503,  536 => 473,  343 => 283,  288 => 231,  233 => 179,  187 => 136,  117 => 69,  107 => 61,  87 => 45,  81 => 41,  63 => 27,  56 => 23,  44 => 14,  38 => 10,  30 => 6,  27 => 5,  25 => 4,  19 => 1,);
    }
}
/* {{ xheader }} */
/* <!--main content starts-->*/
/* <div id="content">*/
/* {% if error_warning %}*/
/* <div class="container">*/
/*   <div class="alert alert-danger margintop20 marginbottom0"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}*/
/*     <button type="button" class="close" data-dismiss="alert">&times;</button>*/
/*   </div>*/
/* </div>  */
/* {% endif %}    */
/* <div id="myLoader" class="loader">*/
/* <!-- <div class="innerloader"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i></div> -->*/
/* </div>*/
/* <div id="cvc">{{ xcvc }}</div>*/
/* <div id="step_login_panel" class="bottom"></div>*/
/* <div id="step_address_panel" class="bottom"></div>*/
/* <div id="step_payment_panel" class="bottom"></div>*/
/* </div>*/
/* <script type="text/javascript">*/
/* $.ajaxSetup({ cache: false });*/
/* var address_block = false;*/
/* var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';  */
/* {% if not logged  %} */
/* 		$(document).ready(function() {				*/
/*             	showLoader();*/
/*                 $.ajax({*/
/*                     url: 'index.php?route={{ xtensions_controller_path }}xlogin',*/
/*                     dataType: 'html',*/
/*                     success: function(html) {                    	*/
/*                         $('#step_login_panel').html(html);                        */
/*                         $('#step_login_panel').show();                        */
/* 						$('#step1').addClass('active');*/
/* 						$('#step1').removeClass('disabled');						*/
/* 						hideLoader();*/
/*                     },*/
/*                     error: function(xhr, ajaxOptions, thrownError) {*/
/*                         alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                     }*/
/*                 });*/
/*             });*/
/*              {% else %} */
/*             $(document).ready(function() {*/
/*             	showLoader();*/
/*                 $.ajax({*/
/*                     url: 'index.php?route={{ xtensions_controller_path }}xpayment_address',*/
/*                     dataType: 'html',*/
/*                     success: function(html) {                    	*/
/*                     	$('#step1').removeClass('disabled');*/
/*                     	$('#step1').addClass('complete');*/
/*                     	$('#step2').removeClass('disabled');                        */
/*                         $('#step2').addClass('active');						                        */
/*                         $('#step_address_panel').html(html);                                                */
/*                         $('#step_address_panel').show();                        */
/*                         hideLoader();                        */
/*                     },*/
/*                     error: function(xhr, ajaxOptions, thrownError) {*/
/*                         alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                     }*/
/*                 });*/
/*             });*/
/*            {% endif %}       	*/
/*           $(document).on("click", "#button-login, #button-register, #button-guest", function(event) {       	 */
/*         	  if($('#account').val() == 'login'){*/
/*             	  form_tab = 'form_login';*/
/*               } else {*/
/*             	  form_tab = 'form_register';*/
/*               }    	     */
/*              $.ajax({*/
/*                 url: 'index.php?route={{ xtensions_controller_path }}xlogin/validate',*/
/*                 type: 'post',*/
/*                 data: $("#"+form_tab).serialize(),*/
/*                 dataType: 'json',*/
/*                 beforeSend: function() {*/
/*             	$('#button-login').addClass('progress-bar-striped active');*/
/*                 $('#button-register').addClass('progress-bar-striped active');*/
/*                     showLoader();*/
/*                     $('.warning, .error, .alert, .alert-warning, .alert-danger,.alert-dismissible').remove();*/
/*                 },*/
/*                 complete: function() {*/
/*                 	$('#button-login').removeClass('progress-bar-striped active');*/
/*                 	$('#button-register').removeClass('progress-bar-striped active');        	*/
/*                 },*/
/*                 success: function(json) {*/
/*                     $('.warning, .error, .alert, .alert-warning, .alert-danger,.alert-dismissible, .xerror, .text-danger').remove();*/
/* 					$('.has-error').removeClass('has-error');					*/
/* 					if (json.redirect) {*/
/* 		                location = json.redirect;*/
/* 		            }else if (json.next) {*/
/*                     	$('#step1').removeClass('active');*/
/*                     	$('#step1').addClass('complete');*/
/*                     	$('#click1').addClass('clickable');*/
/*                     	$('#undo1').show();*/
/*                     	$('#step2').removeClass('disabled');                            	                        */
/*                         $('#step2').addClass('active');*/
/*                         $('#step_login_panel').hide();*/
/*                         $('html, body').animate({*/
/*                             scrollTop: $('body').offset().top*/
/*                         }, 1);                                						                        */
/*                         $('#step_address_panel').html(json.next);                        */
/*                         $('#step_address_panel').show();                                               	*/
/*                         $('#step1 a').attr('href','#login');                        */
/*                     } else if (json.error) {*/
/*                     	for (i in json.error) {     */
/*                     		if ($('#step_login_panel #input-'+i).parent().hasClass('input-group')) {*/
/*                     			$('#step_login_panel #input-'+i).parent().parent().addClass('has-error');*/
/*             					$('#step_login_panel #input-'+i).parent().after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					} else if ($('#step_login_panel #input-'+i).parent().hasClass('isradio') || $('#step_login_panel #input-'+i).parent().hasClass('ischeckbox') || $('#step_login_panel #input-'+i).parent().hasClass('isfile')){       						*/
/*                                 $('#step_login_panel #input-'+i).after('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error[i] + '</div>');                                */
/*             				}else {*/
/*         						$('#step_login_panel #input-'+i).parent().addClass('has-error');*/
/*             					$('#step_login_panel #input-'+i).after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					}       					*/
/*         				}    */
/*                         if (json.error.captcha) {*/
/*                         	$('#captcha input[name=\'captcha\']').parent().addClass('has-error');*/
/*                         	$('#captcha input[name=\'captcha\']').parent().after('<span class="xerror">' + json.error.captcha + '</span>');*/
/*                         }                        */
/*                         if (json.error.warningagree) {                        	*/
/*                         	$('#step_login_panel #xagreep').addClass('has-error');*/
/*                         	$('#step_login_panel #xagreep').prepend('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error.warningagree + '</div>');                            */
/*                         }                                               */
/*                         if (json.error.warning) {*/
/*                             $('#xlogin-panel .is_first').before('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error.warning + '</div>');*/
/*                         }*/
/*                         $('.warning').fadeIn('slow');*/
/*                     } */
/* 					hideLoader();*/
/*                 },*/
/*                 error: function(xhr, ajaxOptions, thrownError) {*/
/*                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                 }*/
/*             });*/
/*         });  */
/*         $(document).on("click", "#button-social-register", function(event) {*/
/*              $.ajax({*/
/*                 url: 'index.php?route={{ xtensions_controller_path }}xsocial/validate',*/
/*                 type: 'post',*/
/*                 data: $("#sociallogin").serialize(),*/
/*                 dataType: 'json',*/
/*                 beforeSend: function() {*/
/*             	$('#button-social-register').addClass('progress-bar-striped active');*/
/*                     showLoader();*/
/*                     $('.warning, .error, .alert-warning, .alert-danger').remove();*/
/*                 },*/
/*                 complete: function() {*/
/*                 	$('#button-social-register').removeClass('progress-bar-striped active');      	*/
/*                 },*/
/*                 success: function(json) {*/
/*                     $('.warning, .error, .alert-warning, .alert-danger, .xerror, .text-danger').remove();*/
/* 					$('.has-error').removeClass('has-error');					*/
/* 					if (json.redirect) {*/
/* 		                location = json.redirect;*/
/* 		            } else if (json.error) {*/
/*                     	for (i in json.error) {     */
/*                     		if ($('#socialloginField #input-'+i).parent().hasClass('input-group')) {*/
/*                     			$('#socialloginField #input-'+i).parent().parent().addClass('has-error');*/
/*             					$('#socialloginField #input-'+i).parent().after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					} else if ($('#socialloginField #input-'+i).parent().hasClass('isradio') || $('#step_login_panel #input-'+i).parent().hasClass('ischeckbox') || $('#step_login_panel #input-'+i).parent().hasClass('isfile')){       						*/
/*                                 $('#socialloginField #input-'+i).after('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error[i] + '</div>');                                */
/*             				}else {*/
/*         						$('#socialloginField #input-'+i).parent().addClass('has-error');*/
/*             					$('#socialloginField #input-'+i).after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					}*/
/*         				}                     */
/*                         if (json.error.warningagree) {                        	*/
/*                         	$('#socialloginField #agreesocialouter').addClass('has-error');*/
/*                         	$('#socialloginField #agreesocialouter').prepend('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error.warningagree + '</div>');                            */
/*                         }*/
/*                     } */
/* 					hideLoader();*/
/*                 },*/
/*                 error: function(xhr, ajaxOptions, thrownError) {*/
/*                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                 }*/
/*             });*/
/*         });                 */
/*         $(document).on("click", "#addAdress", function(event) {*/
/*             $.ajax({*/
/*                 url: 'index.php?route={{ xtensions_controller_path }}xpayment_address/addAddress',*/
/*                 type: 'post',*/
/*                 data: $("#form_add_address").serialize(),*/
/*                 dataType: 'json',*/
/*                 beforeSend: function() {                    */
/*                     $('#addAdress').addClass('progress-bar-striped active');*/
/*                     $('#addLoader').css({*/
/*                 	    height: $('#addLoader').parent().height(), */
/*                 	    width: $('#addLoader').parent().width()*/
/*                 	});*/
/*                 	$('#addLoader').show();*/
/*                 	showBar();*/
/*                     $('#address_fields .warning,#address_fields .xerror,#address_fields .error,#address_fields .alert,#address_fields .alert-warning,#address_fields .alert-danger,#address_fields .alert-dismissible').remove();*/
/*                     $('#address_fields .has-error').removeClass('has-error');*/
/*                 },*/
/*                 complete: function() {                	*/
/*                 	$('#addAdress').removeClass('progress-bar-striped active');                	*/
/*                 },*/
/*                 success: function(json) {*/
/*                     $('#addressfields .warning,#addressfields .error,#addressfields .alert,#addressfields .alert-warning,#addressfields .text-danger, #addressfields .alert-danger,#addressModal .alert-dismissible,#addressfields .xerror').remove();					*/
/*                     if (json.redirect) {*/
/*                         location = json.redirect;*/
/*                     } else if (json.xpayment_address) {                    	                            						                        */
/*                         $('#step_address_panel').html(json.xpayment_address);*/
/*                         hideBar();                        */
/*                     } else if (json.error) {*/
/*                     	for (i in json.error) {     */
/*                     		if ($('#address_fields #input-'+i).parent().hasClass('input-group')) {*/
/*                     			$('#address_fields #input-'+i).parent().parent().addClass('has-error animated shake').one(animationEnd, function() {*/
/*         							$('#address_fields #input-'+i).parent().parent().removeClass('animated shake');  */
/*         	    		        });   */
/*             					$('#address_fields #input-'+i).parent().after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					} else if ($('#address_fields #input-'+i).parent().hasClass('isradio') || $('#address_fields #input-'+i).parent().hasClass('ischeckbox') || $('#address_fields #input-'+i).parent().hasClass('isfile')){       						*/
/*                                 $('#address_fields #input-'+i).after('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error[i] + '</div>');                                */
/*             				}else {*/
/*         						$('#address_fields #input-'+i).parent().addClass('has-error animated shake').one(animationEnd, function() {*/
/*         							$('#address_fields .has-error').removeClass('animated shake');  							 */
/*         	    		        });   */
/*             					$('#address_fields #input-'+i).after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					}      					*/
/*         				}*/
/*         				$('#addLoader').hide();*/
/*         				hideBar();*/
/*         			}                   */
/*                 },*/
/*                 error: function(xhr, ajaxOptions, thrownError) {*/
/*                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                 }*/
/*             });*/
/*         });*/
/*         $(document).on("click", "#editAdress", function(event) {*/
/*             $.ajax({*/
/*                 url: 'index.php?route={{ xtensions_controller_path }}xpayment_address/editAddress',*/
/*                 type: 'post',*/
/*                 data: $("#form_edit_address").serialize(),*/
/*                 dataType: 'json',*/
/*                 beforeSend: function() {                    */
/*                     $('#editAdress').addClass('progress-bar-striped active');*/
/*                     $('#editLoader').css({*/
/*                       height: $('#editLoader').parent().height(), */
/*                       width: $('#editLoader').parent().width()*/
/*                   });*/
/*                   $('#editLoader').show();*/
/*                   showBar();                    */
/*                     $('#address_fields_edit .warning,#address_fields_edit .error,#address_fields_edit .alert,#address_fields_edit .alert-warning,#address_fields_edit .alert-danger,#address_fields_edit .alert-dismissible, #address_fields_edit .xerror').remove();*/
/*                     $('#address_fields_edit .has-error').removeClass('has-error');      */
/*                 },*/
/*                 complete: function() {                  */
/*                   $('#editAdress').removeClass('progress-bar-striped active');                  */
/*                 },*/
/*                 success: function(json) {                    */
/*               		$('#addressModal_edit .has-error').removeClass('has-error');          */
/*                     if (json.redirect) {*/
/*                         location = json.redirect;*/
/*                     } else if (json.xpayment_address) {                                        	                            						                        */
/*                         $('#step_address_panel').html(json.xpayment_address);*/
/*                         $('#addressModal_edit').modal('hide');*/
/*                         $('#editLoader').hide();*/
/*         		        hideBar();                        */
/*                     } else if (json.error) {*/
/*                     	for (i in json.error) {     */
/*                     		if ($('#address_fields_edit #input-'+i).parent().hasClass('input-group')) {*/
/*                     			$('#address_fields_edit #input-'+i).parent().parent().addClass('has-error');*/
/*             					$('#address_fields_edit #input-'+i).parent().after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					} else if ($('#address_fields_edit #input-'+i).parent().hasClass('isradio') || $('#address_fields_edit #input-'+i).parent().hasClass('ischeckbox') || $('#address_fields_edit #input-'+i).parent().hasClass('isfile')){       						*/
/*                                 $('#address_fields_edit #input-'+i).after('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error[i] + '</div>');                                */
/*             				}else {*/
/*         						$('#address_fields_edit #input-'+i).parent().addClass('has-error');*/
/*             					$('#address_fields_edit #input-'+i).after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					}      					*/
/*         				}*/
/*         		        $('#editLoader').hide();*/
/*         		        hideBar();*/
/*               		}                */
/*               },*/
/*                 error: function(xhr, ajaxOptions, thrownError) {*/
/*                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                 }*/
/*             });*/
/*         });*/
/*         $(document).on("click", "#saveGuestAddress", function(event) {*/
/*         	var element = this;*/
/*         	var section = $(element).attr('section');*/
/*             $.ajax({*/
/*                 url: 'index.php?route={{ xtensions_controller_path }}xguest/addAddress',*/
/*                 type: 'post',*/
/*                 data: $("#form_guest_address_"+section).serialize(),*/
/*                 dataType: 'json',*/
/*                 beforeSend: function() {                    */
/*                     $(element).addClass('progress-bar-striped active');*/
/*                     $('#guestLoader'+section).css({*/
/*                 	    height: $('#addLoader').parent().height(), */
/*                 	    width: $('#addLoader').parent().width()*/
/*                 	});*/
/*                     $('#guestLoader'+section).show();*/
/*                 	showBar();*/
/*                 	$('#guestfields'+section+' .warning,#guestfields'+section+' .error,#guestfields'+section+' .alert,#guestfields'+section+' .alert-warning,#guestfields'+section+' .text-danger, #guestfields'+section+' .alert-danger,#addressModal .alert-dismissible,#guestfields'+section+' .xerror').remove();                    */
/*                 },*/
/*                 complete: function() {                	*/
/*                 	$(element).removeClass('progress-bar-striped active');                	*/
/*                 },*/
/*                 success: function(json) {*/
/* 					$('#guestfields'+section+' .has-error').removeClass('has-error');*/
/*                     if (json.redirect) {*/
/*                         location = json.redirect;*/
/*                     } else if (json.xguest) {                    	                            						                        */
/*                         $('#step_address_panel').html(json.xguest);*/
/*                         hideBar();                       */
/*                     } else if (json.error) {*/
/*                     	for (i in json.error) {     */
/*                     		if ($('#guestfields'+section+' #input-'+i).parent().hasClass('input-group')) {*/
/*                     			$('#guestfields'+section+' #input-'+i).parent().parent().addClass('has-error');*/
/*             					$('#guestfields'+section+' #input-'+i).parent().after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					} else if ($('#guestfields'+section+' #input-'+i).parent().hasClass('isradio') || $('#guestfields'+section+' #input-'+i).parent().hasClass('ischeckbox') || $('#guestfields'+section+' #input-'+i).parent().hasClass('isfile')){       						*/
/*                                 $('#guestfields'+section+' #input-'+i).after('<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json.error[i] + '</div>');                                */
/*             				}else {*/
/*         						$('#guestfields'+section+' #input-'+i).parent().addClass('has-error');*/
/*             					$('#guestfields'+section+' #input-'+i).after('<span class="xerror">' + json.error[i] + '</span>');*/
/*         					}      					*/
/*         				}*/
/*                     	$('#guestLoader'+section).hide();*/
/*         				hideBar();*/
/*         			}                   */
/*                 },*/
/*                 error: function(xhr, ajaxOptions, thrownError) {*/
/*                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*                 }*/
/*             });*/
/*         });    */
/*         $(document).on("click", ".removeAddress", function(event) {*/
/*         	  event.preventDefault();*/
/*         	  var element = this;*/
/*         	  $.ajax({     */
/*         	    url: $(element).attr('link'),*/
/*         	    type: 'get',*/
/*         	    dataType: 'json',*/
/*         	    beforeSend: function() {      */
/*         	      $('.fa-spin').remove();*/
/*         	      $(element).append(' <i class="fa fa-circle-o-notch fa-spin"></i>');*/
/*         	      showBar();*/
/*         	    },      */
/*         	    success: function(json) {     */
/*         	      if(json.redirect){*/
/*         	        location = json.redirect;*/
/*         	      } else if (json.xpayment_address) {*/
/*             	      $(element).closest('.col-sm-6.col-md-4,label').addClass('animated fadeOut').one(animationEnd, function() {*/
/* 	    		        	$('#step_address_panel').html(json.xpayment_address);    */
/* 	    		        });                          						                        */
/*             	      $('#step_address_panel').html(json.xpayment_address);                     */
/*                   }    */
/*         	      $('.fa-spin').remove();*/
/*         	      hideBar(); */
/*         	    },*/
/*         	    error: function(xhr, ajaxOptions, thrownError) {*/
/*         	      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*         	    }*/
/*         	  });*/
/*           });*/
/*           $(document).delegate('.agree', 'click', function(e) {*/
/*         		e.preventDefault();*/
/*         		$('#modal-agree').remove();*/
/*         		var element = this;*/
/*         		$.ajax({*/
/*         			url: $(element).attr('href'),*/
/*         			type: 'get',*/
/*         			dataType: 'html',*/
/*         			beforeSend: function() {*/
/*         				$(element).append(' <i class="fa fa-circle-o-notch fa-spin"></i>');*/
/*         			},*/
/*         			success: function(data) {*/
/*         				html  = '<div id="modal-agree" class="modal xmargin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">';*/
/*         				html += '  <div class="modal-dialog">';*/
/*         				html += '    <div class="modal-content">';*/
/*         				html += '      <div class="modal-header">';*/
/*         				html += '        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>';*/
/*         				html += '        <h4 class="modal-title">' + $(element).text() + '</h4>';*/
/*         				html += '      </div>';*/
/*         				html += '      <div class="modal-body">' + data + '</div>';*/
/*         				html += '    </div';*/
/*         				html += '  </div>';*/
/*         				html += '</div>';*/
/*         				$('body').append(html);*/
/*         				$('#modal-agree').modal('show');*/
/*         				$('.fa-spin').remove();*/
/*         			}*/
/*         		});*/
/*         	});*/
/*           $(document).delegate('.editAddress', 'click', function(e) {*/
/*       		e.preventDefault();*/
/*       		var element = this;*/
/*       		if($(element).attr('inline')=='yes'){*/
/* 	      		$('#editAddressFields').html('');      		*/
/* 	      		$.ajax({*/
/* 	      			url: $(element).attr('link'),*/
/* 	      			type: 'get',*/
/* 	      			dataType: 'json',*/
/* 	      			beforeSend: function() {*/
/* 	      				$(element).append(' <i class="fa fa-circle-o-notch fa-spin"></i>');*/
/* 	      				showBar();*/
/* 	      			},*/
/* 	      			success: function(json) {*/
/* 	          			if(json.redirect){*/
/* 	              			location = json.redirect;*/
/* 	              		}else{              */
/* 	              			$('.col-md-3.lborder').addClass('xblur');			*/
/* 	      					$('#editAddressFields').html(json.editAddress);*/
/* 	      					toggleElement('#existingAddressPanel, #editAddressFields');*/
/* 	      					$('.fa-spin').remove();*/
/* 	      					hideBar();*/
/* 	              		}*/
/* 	      			}*/
/* 	      		});*/
/*       		}else{*/
/*       			$('#addressModal_edit').remove();*/
/*           		var element = this;*/
/*           		$.ajax({*/
/*           			url: $(element).attr('link'),*/
/*           			type: 'get',*/
/*           			dataType: 'json',*/
/*           			beforeSend: function() {*/
/*           				$(element).append(' <i class="fa fa-circle-o-notch fa-spin"></i>');*/
/*           				showBar();*/
/*           			},*/
/*           			success: function(json) {*/
/*               			if(json.redirect){*/
/*                   			location = json.redirect;*/
/*                   		}else{      				*/
/*     	      				$('body').append(json.editAddress);*/
/*     	      				$('#addressModal_edit').modal('show');*/
/*     	      				$('.fa-spin').remove();*/
/*     	      				hideBar();*/
/*                   		}*/
/*           			}*/
/*           		});*/
/*           	}*/
/*       	}); */
/* function toggleElement(element){*/
/* 	var elements = element.split(",");*/
/* 		$.each(elements,function(i){	*/
/* 		if($(elements[i]).is(":visible")){*/
/* 			$(elements[i]).hide();*/
/* 		}else{*/
/* 			$(elements[i]).fadeIn(1000);*/
/* 		}*/
/* 	});*/
/* }*/
/* $(function () {*/
/*     $('[data-toggle="tooltip"]').tooltip()*/
/*   });*/
/* function showLoader(){*/
/* 	$('#myLoader').css({*/
/*     	height: $('#myLoader').parent().height(), */
/*     	width: $('#myLoader').parent().width()*/
/* 	});*/
/* 	$('#myLoader').show();*/
/* 	showBar();	*/
/* };*/
/* function hideLoader(){*/
/* 	$('#myLoader').hide();*/
/* 	hideBar();	*/
/* };*/
/* function showBar(){*/
/* 	NProgress.start();*/
/* 	NProgress.set(0.6); */
/* };*/
/* function hideBar(){*/
/* 	NProgress.inc();*/
/* 	NProgress.done();	*/
/* };*/
/* $(document).on("change", "input[name='shipping_method']", function(event) {*/
/*   	loadShippingMethods();	*/
/* });*/
/* function loadShippingMethods(){*/
/*     $.ajax({*/
/*         url: 'index.php?route={{ xtensions_controller_path }}xshipping_method/validate', */
/*         type: 'post',*/
/*         data: $('#shipping_method input[type=\'radio\']:checked, textarea'),*/
/*         dataType: 'json',*/
/*         beforeSend: function() {},  */
/*         complete: function() {},            */
/*         success: function(json) {*/
/*             if(json.redirect){*/
/*                 location = json.redirect;*/
/*                 }else{*/
/*                     $('#step_address_panel #shipping_method .shipping-table').html(json.shipping_method);*/
/*                     $('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json.xtotals);*/
/*                     if(json.shipping_methods== true){*/
/*                         $('#agree-panel').show();*/
/*                         $('.noshipping').remove();*/
/*                     }else{*/
/*                         $('.noshipping').remove();*/
/*                         $('#agree-panel').hide();*/
/*                         $('#existingAddressPanel').prepend('<div class="alert alert-danger noshipping margintop20 marginbottom0">'+ json.warning +'</div>');*/
/*                         $('#step_address_panel #shipping_method .shipping-table').html('<span class="xerror noshipping marginbottom0">'+ json.warning +'</span>');   */
/*                     }*/
/*                 }*/
/*         },*/
/*         error: function(xhr, ajaxOptions, thrownError) {*/
/*             alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*         }*/
/*     });*/
/* };*/
/* $(document).on("click", "#couponbtn1", function(event) {*/
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateCoupon',*/
/* 		type: 'post',*/
/* 		data: $('#coupon-panel input[type=\'text\']'),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {*/
/* 			 $('#coupon-panel .xerror, #coupon-panel .coupon').remove();*/
/* 			 $('#couponbtn1').attr('disabled', true);*/
/* 			 $('#couponbtn1').html('<i class="cvcapply fa fa-circle-o-notch fa-spin"></i>');*/
/* 			 showBar();*/
/* 		},*/
/* 		success: function(json) {*/
/* 			 if (json.error) {*/
/* 				 $('input[name=\'coupon\']').parent().after('<div class="couponapplied cvcapplied coupon alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['error']['error'] + '</div>');*/
/* 			 } else if (json.applied){*/
/* 				 $('#coupon-panel input[name=\'coupon\']').parent().after('<div class="couponapplied cvcapplied coupon alert alert-success alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['applied'] + '</div>');*/
/* 				 $('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json.xtotals);*/
/* 			 }*/
/* 			 hideBar();*/
/* 			 $('#couponbtn1').attr('disabled', false);*/
/* 			 setTimeout(function(){*/
/* 				 $('.cvcapplied').fadeOut();*/
/* 			 }, 10000);*/
/* 			 $('#couponbtn1').html('<i class="cvcapply fa fa-check"></i>');*/
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});*/
/* });*/
/* $(document).on("click", "#voucherbtn1", function(event) {*/
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateVoucher',*/
/* 		type: 'post',*/
/* 		data: $('#voucher-panel input[type=\'text\']'),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {*/
/* 			 $('#voucher-panel .xerror, #voucher-panel .voucher').remove();*/
/* 			 $('#voucherbtn1').attr('disabled', true);*/
/* 			 $('#voucherbtn1').html('<i class="cvcapply fa fa-circle-o-notch fa-spin"></i>');*/
/* 			showBar();*/
/* 		},*/
/* 		success: function(json) {*/
/* 			if (json['error']) {*/
/*          		$('input[name=\'voucher\']').parent().after('<div class="voucherapplied cvcapplied voucher alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['error']['error'] + '</div>');*/
/* 			 } else if (json['applied']){*/
/* 				$('#voucher-panel input[name=\'voucher\']').parent().after('<div class="voucherapplied cvcapplied voucher alert alert-success alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['applied'] + '</div>');*/
/* 				$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json['xtotals']);*/
/* 			 }*/
/* 			 hideBar();*/
/* 			 $('#voucherbtn1').attr('disabled', false);*/
/* 			 setTimeout(function(){*/
/* 				 $('.cvcapplied').fadeOut();*/
/* 			 }, 10000);*/
/* 			 $('#voucherbtn1').html('<i class="cvcapply fa fa-check"></i>');*/
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});*/
/* });*/
/* $(document).on("click", "#rewardbtn1", function(event) {*/
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateReward',*/
/* 		type: 'post',*/
/* 		data: $('#reward-panel input[type=\'text\']'),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {*/
/* 			$('#reward-panel .xerror, #reward-panel .reward').remove();*/
/* 			$('#rewardbtn1').attr('disabled', true);*/
/* 			$('#rewardbtn1').html('<i class="cvcapply fa fa-circle-o-notch fa-spin"></i>');*/
/* 			showBar();*/
/* 		},*/
/* 		success: function(json) {*/
/* 			if (json['error']) {*/
/*          		$('input[name=\'reward\']').parent().after('<div class="rewardapplied cvcapplied reward alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['error']['error'] + '</div>');*/
/* 			 } else if (json['applied']){*/
/* 				$('#reward-panel input[name=\'reward\']').parent().after('<div class="rewardapplied cvcapplied reward alert alert-success alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + json['applied'] + '</div>');*/
/* 				$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #paymentPage #totals').html(json['xtotals']);*/
/* 			 }*/
/* 			 hideBar();*/
/* 			 $('#rewardbtn1').attr('disabled', false);*/
/* 			 setTimeout(function(){*/
/* 				 $('#reward-panel .xerror, #reward-panel .reward').fadeOut();*/
/* 			 }, 10000);*/
/* 			 $('#rewardbtn1').html('<i class="cvcapply fa fa-check"></i>');*/
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});*/
/* });*/
/* $(document).on("click", "#couponbtn", function(event) {	 */
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateCoupon',*/
/* 		type: 'post',*/
/* 		data: $('#couponModal input[type=\'text\']'),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {*/
/* 			 $('#couponModal .xerror, #couponModal .coupon').remove();*/
/* 			 $('#couponModal .has-error').removeClass('has-error');*/
/* 			$('#couponbtn').attr('disabled', true);*/
/* 			showBar();				*/
/* 		},			*/
/* 		success: function(json) {							*/
/* 			if (json['error']) {*/
/* 				 $('#couponModal input[name=\'coupon\']').parent().addClass('has-error');*/
/*                 $('#couponModal input[name=\'coupon\']').after('<span class="xerror">' + json['error']['error'] + '</span>');*/
/* 			} else if (json['applied']){				 */
/* 				 $('#couponModal input[name=\'coupon\']').after('<span class="coupon" style="color:green">' + json['applied'] + '</span>');*/
/* 				 $('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);					*/
/* 			}            	*/
/* 			 hideBar();*/
/* 			 $('#couponbtn').attr('disabled', false);	 */
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});	*/
/* 	*/
/* });*/
/* $(document).on("click", "#voucherbtn", function(event) {	 */
/* $.ajax({*/
/* 	url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateVoucher',*/
/* 	type: 'post',*/
/* 	data: $('#voucherModal input[type=\'text\']'),*/
/* 	dataType: 'json',*/
/* 	beforeSend: function() {*/
/* 		$('.xerror, .voucher').remove();*/
/* 		$('.has-error').removeClass('has-error');*/
/* 		$('#voucherbtn').attr('disabled', true);*/
/* 		showBar();				*/
/* 	},					*/
/* 	success: function(json) {							*/
/* 		if (json['error']) {*/
/* 			 $('#voucherModal input[name=\'voucher\']').parent().addClass('has-error');*/
/*             $('#voucherModal input[name=\'voucher\']').after('<span class="xerror">' + json['error']['error'] + '</span>');*/
/* 		} else if (json['applied']){				 */
/* 			 $('#voucherModal input[name=\'voucher\']').after('<span class="voucher" style="color:green">' + json['applied'] + '</span>');*/
/* 			 $('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);					*/
/* 		}*/
/* 		 hideBar();*/
/* 		 $('#voucherbtn').attr('disabled', false);	 */
/* 	},*/
/* 	error: function(xhr, ajaxOptions, thrownError) {*/
/* 		alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 	}*/
/* });*/
/* });*/
/* $(document).on("click", "#rewardbtn", function(event) {	 */
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xcvc/validateReward',*/
/* 		type: 'post',*/
/* 		data: $('#rewardModal input[type=\'text\']'),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {*/
/* 			 $('#rewardModal .xerror, #rewardModal .reward').remove();*/
/* 			 $('#rewardModal .has-error').removeClass('has-error');*/
/* 			$('#rewardbtn').attr('disabled', true);*/
/* 			showBar();				*/
/* 		},			*/
/* 		success: function(json) {							*/
/* 			if (json['error']) {*/
/* 				 $('#rewardModal input[name=\'reward\']').parent().addClass('has-error');*/
/*                  $('#rewardModal input[name=\'reward\']').after('<span class="xerror">' + json['error']['error'] + '</span>');*/
/* 			} else if (json['applied']){				 */
/* 				 $('#rewardModal input[name=\'reward\']').after('<span class="reward" style="color:green">' + json['applied'] + '</span>');*/
/* 				 $('#loginPage #totals , #addressPage #totals , #guestPage #totals').html(json['xtotals']);					*/
/* 			}          	*/
/* 			 hideBar();*/
/* 			 $('#rewardbtn').attr('disabled', false);	 */
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});	*/
/* 	*/
/* });*/
/* $(document).on("click", "#commentbtn", function(event) {	 */
/* $.ajax({*/
/* 	url: 'index.php?route={{ xtensions_controller_path }}xcvc/addComment',*/
/* 	type: 'post',*/
/* 	data: $('#commentModal textarea'),*/
/* 	dataType: 'json',*/
/* 	beforeSend: function() {*/
/* 		$('.comment').remove();			 */
/* 		$('#commentbtn').attr('disabled', true);*/
/* 		showBar();				*/
/* 	},					*/
/* 	success: function(json) {							*/
/* 		if (json.applied){				 */
/* 			 $('#commentModal textarea[name=\'comment\']').after('<span class="comment" style="color:green">' + json['applied'] + '</span>');					*/
/* 		}			 */
/* 		 $('#commentbtn').attr('disabled', false);*/
/* 		 hideBar();	 */
/* 	},*/
/* 	error: function(xhr, ajaxOptions, thrownError) {*/
/* 		alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 	}*/
/* });	*/
/* */
/* });*/
/* // Currency*/
/* $(document).on("click", "#currency .currency-select", function(event) {*/
/* 	event.preventDefault();*/
/* 	$('#currency input[name=\'currency_code\']').attr('value', $(this).attr('name'));*/
/* 	$('#currency').submit();*/
/* });*/
/* // Language*/
/* $('#language a').on('click', function(e) {*/
/* 	e.preventDefault();*/
/* 	$('#language input[name=\'language_code\']').attr('value', $(this).attr('href'));*/
/* 	$('#language').submit();*/
/* });*/
/* $(document).on("submit", "#sociallogin, #form_login, #form_guest_address_payment, #form_guest_address_shipping, #form_guest, #form_edit_address, #form_add_address, #form_register, #form_add_reward, #form_add_coupon, #form_add_voucher, #form_add_comment, #form_add_address, #form_edit_address,#form_add_guest_payment_address, #form_add_guest_shipping_address", function(event) {	*/
/* 	event.preventDefault();*/
/* });*/
/* function same_guest_shipping(element,psaddress,paddress,payment_address){	*/
/*     if($(element).prop("checked") == true) {*/
/*       $('.xshipping').css('display','none');*/
/*       $('.padd').html(psaddress);*/
/*       $('.payment-address-panel').addClass('col-md-12');*/
/*       $('.payment-address-panel').removeClass('col-md-6');*/
/*       if(payment_address){*/
/*       showLoader();  */
/*       $.ajax({*/
/*             url: 'index.php?route={{ xtensions_controller_path }}xguest/sameAddress',*/
/*             type: 'post',*/
/*             data: $('#guestPage input[type=\'checkbox\']:checked, textarea'),*/
/*             dataType: 'json',*/
/*             success: function(json) {              */
/*                 if (json.redirect) {*/
/*                     location = json.redirect;*/
/*                 }else{*/
/*             		$('#step_address_panel').html(json.xguest);*/
/*                     $('#step_address_panel').show();*/
/*                     hideLoader();*/
/*             	}                    */
/*             },*/
/*             error: function(xhr, ajaxOptions, thrownError) {*/
/*                 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*             }*/
/*         });*/
/*       }*/
/*     }else{*/
/*     	$('.payment-address-panel').addClass('col-md-6');*/
/*         $('.payment-address-panel').removeClass('col-md-12');*/
/*     	$('.xshipping').css('display','block');*/
/*         $('.padd').html(paddress);*/
/*         showLoader(); */
/*     	$.ajax({*/
/*             url: 'index.php?route={{ xtensions_controller_path }}xguest/notSameAddress',*/
/*             type: 'get',*/
/*             dataType: 'json',*/
/*             success: function(json) {              */
/*                 if (json.redirect) {*/
/*                     location = json.redirect;*/
/*                 } else{*/
/*                 	$('#step_address_panel').html(json.xguest);*/
/*                     $('#step_address_panel').show();*/
/*                 	hideLoader();*/
/*                 }                  */
/*             },*/
/*         });*/
/*     }*/
/* }*/
/* function loadZone(element,country_id, zone_id,text_select,text_none){		*/
/* 		  if (country_id == '') return;*/
/* 		  $.ajax({*/
/* 		    url: 'index.php?route={{ xtensions_controller_path }}checkout/country&country_id=' + country_id,*/
/* 		    dataType: 'json',*/
/* 		    beforeSend: function() {*/
/* 		    	$('#'+element+' select[name=\'country_id\']').after(' <i class="fa fa-circle-o-notch fa-spin"></i>');*/
/* 		    },*/
/* 		    complete: function() {*/
/* 		      $('.fa-spin').remove();*/
/* 		    },      */
/* 		    success: function(json) {*/
/* 		      if (json.postcode_required == '1') {*/
/* 		        $('#payment-postcode-required').show();*/
/* 		      } else {*/
/* 		        $('#payment-postcode-required').hide();*/
/* 		      }		      */
/* 		      html = '<option value="">'+text_select+'</option>';		      */
/* 		      if (json.zone != '') {*/
/* 		        for (i = 0; i < json.zone.length; i++) {*/
/* 		          html += '<option value="' + json.zone[i].zone_id + '"';		            */
/* 		          if (json.zone[i].zone_id == zone_id) {*/
/* 		               html += ' selected="selected"';*/
/* 		          }		  */
/* 		          html += '>' + json.zone[i].name + '</option>';*/
/* 		        }*/
/* 		      } else {*/
/* 		        html += '<option value="0" selected="selected">'+text_none+'</option>';*/
/* 		      }*/
/* 		      */
/* 		      $('#'+element+' select[name=\'zone_id\']').html(html);    */
/* 		      $('#'+element+' select[name=\'zone_id\']').trigger('change');   */
/* 		    },*/
/* 		    error: function(xhr, ajaxOptions, thrownError) {*/
/* 		      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		    }*/
/* 		  });	*/
/* }*/
/* $(document).on("change", "input[name='address_id'], input[name='saddress_id'], #addressPage input[type='checkbox'][name='xshipping_address_check']", function(event) {*/
/* 	  $.ajax({*/
/* 	    url: 'index.php?route={{ xtensions_controller_path }}xpayment_address/validate', */
/* 	    type: 'post',*/
/* 	    data: $('#existingAddress input[type=\'radio\']:checked, #existingAddress input[type=\'hidden\'], #agreeText input[type=\'checkbox\']:checked, #existingAddress input[type=\'checkbox\']:checked, #existingAddress textarea'),*/
/* 	    dataType: 'json',*/
/* 	    beforeSend: function() {      */
/* 	      $('#sLoader').css({*/
/* 	              height: $('#sLoader').parent().height(), */
/* 	              width: $('#sLoader').parent().width()*/
/* 	          });         */
/* 	          $('#sLoader').show();*/
/* 	          showBar();*/
/* 	    },  */
/* 	    complete: function() {*/
/* 	      */
/* 	    },      */
/* 	    success: function(json) {   */
/* 	      {% if    shipping_required  %}*/
/* 	      $('#step_address_panel #shipping_method').html(json.xshipping_method);*/
/* 	      loadShippingMethods();*/
/* 	     {% endif %}*/
/* 	     $('#sLoader').hide();*/
/* 	     hideBar();         */
/* 	    },*/
/* 	    error: function(xhr, ajaxOptions, thrownError) {*/
/* 	      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 	    }*/
/* 	  }); */
/* 	});*/
/* $(document).on("click", "#payment-accordion a.heading-panel", function(event) {	*/
/* 	if($(this).parents('.panel').children('.panel-collapse').hasClass('in')){*/
/*         event.stopPropagation();*/
/*         event.preventDefault();*/
/*     }*/
/* 	if(payment_method_code!=$(this).attr('payment_method')){*/
/* 		payment_method_code=$(this).attr('payment_method');     */
/* 		loadPaymentMethodAccordion(payment_method_code);   */
/* 	}	        */
/* });*/
/* $(document).on("click", "#step_payment_panel #paymentMethodTab [data-toggle='tab']", function(event) {*/
/* 	if(payment_method_code != $(this).attr('payment_method')){*/
/* 		payment_method_code = $(this).attr('payment_method');   */
/* 		loadPaymentMethodTab(payment_method_code);*/
/* 	}	        */
/* });*/
/* function loadPaymentMethodAccordion(payment_method){*/
/* 	$('#payment-accordion .panel-body').html('');*/
/* 	$('#step_payment_panel #panel-body'+payment_method).html('<div class="text-center"><i style="margin:60px auto;font-size:24px;" class="fa fa-spinner fa-spin fa-lg fa-fw"></i></div>');		*/
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xpayment_method/validate', */
/* 		type: 'post',*/
/* 		data: ({payment_method:payment_method}),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {			*/
/* 			showBar();*/
/* 			$('#pLoader').css({*/
/*         	    height: $('#pLoader').parent().height(), */
/*         	    width: $('#pLoader').parent().width()*/
/*         	});*/
/* 			$('#pLoader').show();					*/
/* 		},		*/
/* 		success: function(json) {*/
/* 			if (json.redirect) {*/
/* 				location = json.redirect;*/
/* 			} else if (json.error) {*/
/* 				if (json.error.warning_shipping) {*/
/* 					$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json.error.warning_shipping + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');						*/
/* 					$('.warning').fadeIn('slow');*/
/* 				}*/
/* 				if (json.error.warning_payment) {*/
/* 					$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json.error.warning_payment + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');						*/
/* 					$('.warning').fadeIn('slow');*/
/* 				}	*/
/* 				hideBar();*/
/* 				$('#pLoader').hide();			*/
/* 			} else {*/
/* 				$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #step_payment_panel #totals').html(json['xtotals']);*/
/* 				$('.youpay').html(json['totals']);*/
/* 				$.ajax({*/
/* 					url: 'index.php?route=checkout/confirm',*/
/* 					dataType: 'html',*/
/* 					success: function(html) {						*/
/* 						$('#step_payment_panel #panel-body'+payment_method).html(html);																		*/
/* 					},*/
/* 					error: function(xhr, ajaxOptions, thrownError) {*/
/* 						alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 					}*/
/* 				});	*/
/* 				/*$('#step_payment_panel #payment-accordion').on('shown.bs.collapse', function (e) {    	*/
/* 			        var offset = $('.panel > .panel-collapse.in').offset();*/
/* 			        if(offset) {*/
/* 			            $('html,body').animate({*/
/* 			                scrollTop: $('.panel > .panel-collapse.in').offset().top-50*/
/* 			            }, 500); */
/* 			        }*/
/* 			    });*/
/* 			    *//* 					*/
/* 				hideBar();*/
/* 				$('#pLoader').hide();	*/
/* 			}*/
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});*/
/* }*/
/* function loadPaymentMethodTab(payment_method){*/
/* 	$.ajax({*/
/* 		url: 'index.php?route={{ xtensions_controller_path }}xpayment_method/validate', */
/* 		type: 'post',*/
/* 		data: ({payment_method:payment_method_code}),*/
/* 		dataType: 'json',*/
/* 		beforeSend: function() {	*/
/* 			$('li.payment_method_list').addClass('disabled');	*/
/* 			showBar();*/
/* 			$('#pLoader').show();				*/
/* 		},	*/
/* 		complete: function() {				*/
/* 		},			*/
/* 		success: function(json) {				*/
/* 			if (json.redirect) {*/
/* 				location = json.redirect;*/
/* 			} else if (json.error) {*/
/* 				if (json.error.warning_shipping) {*/
/* 					$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json.error.warning_shipping + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');						*/
/* 					$('.warning').fadeIn('slow');*/
/* 				}*/
/* 				if (json.error.warning_payment) {*/
/* 					$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json.error.warning_payment + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');						*/
/* 					$('.warning').fadeIn('slow');*/
/* 				}	*/
/* 				$('li.payment_method_list').removeClass('disabled');*/
/* 				hideBar();*/
/* 				$('#pLoader').hide();												*/
/* 			} else {*/
/* 				$('#loginPage #totals , #addressPage #totals , .footer_totals .totals , #guestPage #totals, #step_payment_panel #totals').html(json['xtotals']);*/
/* 				$('.youpay').html(json['totals']);*/
/* 				$.ajax({*/
/* 					url: 'index.php?route=checkout/confirm',*/
/* 					dataType: 'html',*/
/* 					async:false,*/
/* 					success: function(html) {						*/
/* 						$('#step_payment_panel #spayment-method-content').html(html);																		*/
/* 					},*/
/* 					error: function(xhr, ajaxOptions, thrownError) {*/
/* 						alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 					}*/
/* 				});*/
/* 				$('li.payment_method_list').removeClass('disabled');*/
/* 				hideBar();*/
/* 				$('#pLoader').hide();*/
/* 			}*/
/* 		},*/
/* 		error: function(xhr, ajaxOptions, thrownError) {*/
/* 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 		}*/
/* 	});*/
/* }*/
/* function callPaymentFromAddress(){*/
/*   $.ajax({*/
/*         url: 'index.php?route={{ xtensions_controller_path }}xpayment_address/validate&showpayment=1',*/
/*         type: 'post',*/
/*         data: $('#existingAddress input[type=\'radio\']:checked, #existingAddress input[type=\'hidden\'], #agreeText input[type=\'checkbox\']:checked, #existingAddress input[type=\'checkbox\']:checked, #existingAddress textarea'),*/
/* 	    dataType: 'json',           */
/*         beforeSend: function() {*/
/*           	showLoader();                       */
/*             $('#button-payment, #head-progress').addClass('progress-bar-striped active');            */
/*         },*/
/*         success: function(json) {*/
/*             if(json.redirect){*/
/*               location = json.redirect;*/
/*             }else if(json.xpayment_method){*/
/*             	$('#step_payment_panel').html(json.xpayment_method);*/
/*             	showStepPayment();            	*/
/*             }                       */
/*         },*/
/*         error: function(xhr, ajaxOptions, thrownError) {*/
/*             alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*         }*/
/*     });*/
/* }*/
/* function callPaymentFromGuest(){	*/
/*   $.ajax({*/
/*         url: 'index.php?route={{ xtensions_controller_path }}xpayment_method&direct=1',*/
/*         type: 'post',*/
/* 		data: $('textarea'),*/
/* 		dataType: 'json',*/
/*         beforeSend: function() {                    */
/*           $('#button-payment').addClass('progress-bar-striped active'); */
/*           showLoader();       */
/*         },        */
/*         success: function(json) {*/
/*         	 $('#step_payment_panel').html(json.xpayment_method);*/
/*         	 showStepPayment();             */
/*         },*/
/*         error: function(xhr, ajaxOptions, thrownError) {*/
/*             alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/*         }*/
/*     });*/
/* }*/
/* function showStepPayment(){*/
/* 	$('#step_login_panel').hide();*/
/*     $('#step_address_panel').hide();*/
/*     $('html, body').animate({*/
/*           scrollTop: $('body').offset().top*/
/*       }, 1);*/
/*       */
/*       $('#step_payment_panel').show();            */
/*       $('#step2').removeClass('active');*/
/* 		$('#step2').addClass('complete');*/
/* 		$('#step2 a').attr('href','#step_address_panel');*/
/* 		$('#click2').addClass('clickable');*/
/* 		$('#undo2').show(); */
/* 		$('#step3').removeClass('disabled');*/
/* 		$('#step3').addClass('active');*/
/* 		$('#button-payment').removeClass('progress-bar-striped active');*/
/* 		hideLoader();*/
/* }*/
/* $(document).on("change", '#addressPage input[type="radio"][name="address_id"]', function(event) {*/
/*     var $this = $(this);*/
/*     if(address_block){*/
/* 	    $this.closest('.row').find('div.panel-heading.selected').removeClass('selected');*/
/* 	    $this.closest('.panel-heading').addClass('selected');*/
/* 	} else {*/
/*     	$this.closest('.payment-address').find('.address-label.selected').removeClass('selected');*/
/*     	$this.closest('.address-label').addClass('selected');*/
/* 	}*/
/* });*/
/* $(document).on("change", '#addressPage input[type="radio"][name="saddress_id"]', function(event) {*/
/*     var $this = $(this);*/
/* 	if(address_block){*/
/*     	$this.closest('.row').find('div.panel-footer.selected').removeClass('selected');*/
/*     	$this.closest('.panel-footer').addClass('selected');*/
/* 	} else {*/
/*     	$this.closest('.shipping-address').find('.address-label.selected').removeClass('selected');*/
/*     	$this.closest('.address-label').addClass('selected');*/
/* 	}*/
/* });*/
/* $(document).on("change", '#addressPage input[type="checkbox"][name="xshipping_address_check"]', function(event) {*/
/* 	if(address_block){*/
/* 	  	if(this.checked) {*/
/* 	      	$('.panel-footer').hide();*/
/* 	      	$('.padd').html('{{ text_psaddress }}');*/
/*       	}else{*/
/* 	      	$('.panel-footer').show();*/
/* 	      	$('.padd').html('{{ text_paddress }}');*/
/*       	}*/
/* 	} else {*/
/*     	if(this.checked) {*/
/*         	$('.payment-address-panel').removeClass('col-md-6');*/
/*         	$('.payment-address-panel').addClass('col-md-12');*/
/*         	$('.shipping-address-panel').hide();*/
/*         	$('.address-type span.padd').html('{{ text_psaddress }}');*/
/*     	}else{*/
/*     		$('.payment-address-panel').removeClass('col-md-12');*/
/*         	$('.payment-address-panel').addClass('col-md-6');*/
/*         	$('.shipping-address-panel').show();*/
/*         	$('.address-type span.padd').html('{{ text_paddress }}');*/
/*     	}*/
/* 	}*/
/* });*/
/* $(document).on("change", '#addressPage input[type="checkbox"][name="agree"]', function(event) {*/
/*   if(this.checked) {*/
/*       $('#progress-continue').css('display','block');*/
/*       $('#progress-continue-disabled').css('display','none');*/
/*   }else{*/
/*       $('#progress-continue').css('display','none');*/
/*       $('#progress-continue-disabled').css('display','block');        */
/*    }*/
/* });*/
/* $(document).on("click", 'button[id^=\'button-custom-field\']', function(event) {	*/
/* 	  var node = this;*/
/* 	  $('#form-upload').remove();*/
/* 	  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');*/
/* 	  $('#form-upload input[name=\'file\']').trigger('click');*/
/* */
/* 	  if (typeof timer != 'undefined') {*/
/* 	      clearInterval(timer);*/
/* 	  }*/
/* 	  timer = setInterval(function() {*/
/* 		  if ($('#form-upload input[name=\'file\']').val() != '') {*/
/* 	      clearInterval(timer);*/
/* 	      $.ajax({*/
/* 	        url: 'index.php?route=tool/upload',*/
/* 	        type: 'post',*/
/* 	        dataType: 'json',*/
/* 	        data: new FormData($('#form-upload')[0]),*/
/* 	        cache: false,*/
/* 	        contentType: false,*/
/* 	        processData: false,*/
/* 	        beforeSend: function() {*/
/* 	          $(node).button('loading');*/
/* 	        },*/
/* 	        complete: function() {*/
/* 	          $(node).button('reset');*/
/* 	        },*/
/* 	        success: function(json) {*/
/* 	          $(node).parent().find('.text-danger').remove();*/
/* 	          if (json.error) {*/
/* 	        	  $(node).parent().find('input[name^=\'custom_field\']').after('<div class="text-danger">' + json['error'] + '</div>');*/
/* 	          }*/
/* 	          if (json.success) {*/
/* 	            alert(json.success);*/
/* 	            $(node).parent().find('input[name^=\'custom_field\']').val(json['code']);*/
/* 	          }*/
/* 	        },*/
/* 	        error: function(xhr, ajaxOptions, thrownError) {*/
/* 	          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);*/
/* 	        }*/
/* 	      });*/
/* 	    }*/
/* 	  }, 500);*/
/* 	});*/
/* var xcart = {		*/
/* 		'xupdate': function(key, quantity,section) {*/
/* 			if(quantity < 1){*/
/* 				xcart.xremove(key,section);*/
/* 			}else{			*/
/* 				$.ajax({*/
/* 					url: 'index.php?route={{ xtensions_controller_path }}xcart/edit',*/
/* 					type: 'post',*/
/* 					data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1) + '&section=' + section,*/
/* 					dataType: 'json',*/
/* 					beforeSend: function() {*/
/* 						showBar();*/
/* 					},*/
/* 					success: function(json) {*/
/* 						if(section == 'address'){*/
/* 							$('#step_address_panel').html(json.xpayment_address);*/
/* 						}*/
/* 						$('#step_login_panel #xcart').html(json.xcart);*/
/* 						$('#step_login_panel #totals').html(json.xtotals);*/
/* 						hideBar();*/
/* 					}*/
/* 				});*/
/* 			}*/
/* 		},*/
/* 		'xremove': function(key,section) {*/
/* 			$.ajax({*/
/* 				url: 'index.php?route={{ xtensions_controller_path }}xcart/remove',*/
/* 				type: 'post',*/
/* 				data: 'key=' + key + '&section=' + section,*/
/* 				dataType: 'json',*/
/* 				beforeSend: function() {*/
/* 					showBar();*/
/* 				},*/
/* 				success: function(json) {*/
/* 					if(section == 'address'){*/
/* 						$('#step_address_panel').html(json.xpayment_address);*/
/* 					}*/
/* 					$('#step_login_panel #xcart').html(json.xcart);*/
/* 					$('#step_login_panel #totals').html(json.xtotals);*/
/* 					hideBar();*/
/* 				}*/
/* 			});*/
/* 		},*/
/* 		'wishlist': function(product_id,key,section) {*/
/* 			$.ajax({*/
/* 				url: 'index.php?route={{ xtensions_controller_path }}xcart/wishlist',*/
/* 				type: 'post',*/
/* 				data: 'product_id=' + product_id + '&key=' + key + '&section=' + section,*/
/* 				dataType: 'json',*/
/* 				beforeSend: function() {*/
/* 					showBar();*/
/* 				},*/
/* 				success: function(json) {*/
/* 					if(section == 'address'){*/
/* 						$('#step_address_panel').html(json.xpayment_address);*/
/* 					}*/
/* 					$('#step_login_panel #xcart').html(json.xcart);*/
/* 					$('#step_login_panel #totals').html(json.xtotals);*/
/* 					hideBar();*/
/* 				}*/
/* 			});*/
/* 		}*/
/* }*/
/* var xvoucher = {*/
/* 		'xremove': function(key,section) {*/
/* 			$.ajax({*/
/* 				url: 'index.php?route={{ xtensions_controller_path }}xcart/removeVoucher',*/
/* 				type: 'post',*/
/* 				data: 'key=' + key + '&section=' + section,*/
/* 				dataType: 'json',*/
/* 				beforeSend: function() {*/
/* 					showBar();*/
/* 				},*/
/* 				success: function(json) {*/
/* 					if(section == 'address'){*/
/* 						$('#step_address_panel').html(json.xpayment_address);*/
/* 					}*/
/* 					$('#step_login_panel #xcart').html(json.xcart);*/
/* 					$('#step_login_panel #totals').html(json.xtotals);*/
/* 					hideBar();*/
/* 				}*/
/* 			});*/
/* 		}*/
/* }*/
/* function toggleOptions(id){*/
/* 	$('#'+id).toggle();	*/
/* }*/
/* $(document).on("cut copy paste",".dependent",function(e) {*/
/*     e.preventDefault();*/
/*     alert('{{ text_paste_not_allowed }}');*/
/* });*/
/* </script>*/
/* {% if    custom_js  %} */
/* <script type="text/javascript">*/
/* {{ custom_js }} */
/* </script>*/
/* {% endif %} */
/* {{ xfooter }} */
/* */
