<footer>
  <div class="container">{#
    <div class="row">
      {% if informations %}
      <div class="col-sm-3">
        <h5>{{ text_information }}</h5>
        <ul class="list-unstyled">
         {% for information in informations %}
          <li><a href="{{ information.href }}">{{ information.title }}</a></li>
          {% endfor %}
        </ul>
      </div>
      {% endif %}
      <div class="col-sm-3">
        <h5>{{ text_service }}</h5>
        <ul class="list-unstyled">
          <li><a href="{{ contact }}">{{ text_contact }}</a></li>
          <li><a href="{{ return }}">{{ text_return }}</a></li>
          <li><a href="{{ sitemap }}">{{ text_sitemap }}</a></li>
        </ul>
      </div>
      <div class="col-sm-3">
        <h5>{{ text_extra }}</h5>
        <ul class="list-unstyled">
          <li><a href="{{ manufacturer }}">{{ text_manufacturer }}</a></li>
          <li><a href="{{ voucher }}">{{ text_voucher }}</a></li>
          <li><a href="{{ affiliate }}">{{ text_affiliate }}</a></li>
          <li><a href="{{ special }}">{{ text_special }}</a></li>
        </ul>
      </div>
      <div class="col-sm-3">
        <h5>{{ text_account }}</h5>
        <ul class="list-unstyled">
          <li><a href="{{ account }}">{{ text_account }}</a></li>
          <li><a href="{{ order }}">{{ text_order }}</a></li>
          <li><a href="{{ wishlist }}">{{ text_wishlist }}</a></li>
          <li><a href="{{ newsletter }}">{{ text_newsletter }}</a></li>
        </ul>
      </div>
    </div>
    <hr>
    <p>{{ powered }}</p>
    #}

    <div class="powered-wrap">
      <div class="poweredby">
      &copy; Copyright {{ date_year }} <span><a href="{{ text_link }}" target="_blank">VIVA LIFE SCIENCE SDN BHD</a> (199301025500/280238-D). AJL93418.</span> All Rights Reserved.    <br/><a href="https://vivalife.com.my/estore/delivery-information">Delivery Information</a>  |   <a href="https://vivalife.com.my/estore/terms-conditions">Terms & Conditions</a> | <a href="https://vivalife.com.my/estore/distributor-privacy-statement">Distributor Privacy Statement</a> | <a href="https://vivalife.com.my/estore/distributor-policies-and-procedures">Distributor Policies and Procedures</a> | <a href="index.php?route=information/contact">Contact Us</a>
      </div>
      {# <div class="poweredlang">
        {{ text_lang }} {{ language }}
      </div> #}
    </div>


  </div>
  {{ default_address_id }}

  <script type="text/javascript">
    (function($){
      $(document).ready(function(){
        // $("#payment_address_address_id_{{ default_address_id }}").ready(function() {
        //   $(this).click();
        // });
        setTimeout(function(){
          $('#payment_address_address_id_{{ default_address_id }}').trigger('click');
        }, 20);
      });
  })(jQuery)
  </script>

</footer>
{% for script in scripts %}
<script src="{{ script }}" type="text/javascript"></script>
{% endfor %}

<script type="text/javascript">
  (function($){
    $(document).ready(function(){

      // Ajax Quick checkout
      $('.qc-payment-method .ve-field').append('<div>FPX</div>');

      // $(document).delegate('.step.qc-confirm', 'click', function(event) {
      //   var isChecked = $('#payment-method__sagepay_us').prop('checked');
      //   if(isChecked) {
      //     var currentTotal = $('.form-horizontal.qc-totals .qc-total:last-of-type .aljstotal qc_raw').text();
      //     alert(currentTotal);
      //     event.preventDefault();
      //   }
      // });


      $('.breadcrumb .fa.fa-home').css('display','none');
      $('#product-product #column-right > .box-heading').text('CATEGORIES');
      $('#account-account .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-edit .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-password .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-address .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-wishlist .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-order .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-login .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-register .list-group a').wrap('<div class="my-wrap"></div>');
      $('#account-forgotten .list-group a').wrap('<div class="my-wrap"></div>');
      $('#common-success .list-group a').wrap('<div class="my-wrap"></div>');


      if ($('html').is(':lang(zh_cn)')) {
        $(':lang(zh_cn) .breadcrumb > li:first-child() > a').append('主页');
        $('.nav.navbar-nav > li:last-child > a').text('促销');
        $('#column-left > .box-heading,#column-right > .box-heading').text('产品分类');
        $('#payment_address_email_confirm_input span').html('确认电邮地址');
        $('#payment_address_email_confirm_input input::placeholder').text('确认电邮地址');
        $('.user-order1 .user-order-text, .user-order-subtotal').html('<b>商品总额</b>');
        // $('.user-order3 .user-order-text, .user-order-salescombo').html('<b>订单总额</b>');
        $('.user-order2 .user-order-text, .user-order-shipping').html('<b>运费 <span style="text-decoration: line-through;">RM 15.00</span></b>');
        $('.btn-print').html('打印');
        if($('.header-cart').hasClass('header-cart-unlogin')){
          $('#cart > button > #cart-total').text('购物车');
        }
        $('#shipping_method_list span.text').prepend('运费');
        // $('qc_raw[content=Shipping Fees]').html('运费');
        // $('label[for=total_based.shipping_total_based_15] .text qc_raw').html('运费');
        $('.ch-shipping-method').addClass('haha');


      } else {
        $('.breadcrumb > li:first-child() > a').append('Home');
        $('.user-order1 .user-order-text, .user-order-subtotal').html('<b>Sub-Total</b>');
        // $('.user-order3 .user-order-text, .user-order-salescombo').html('<b>Total</b>');
        $('.user-order2 .user-order-text, .user-order-shipping').html('<b>Shipping <span style="text-decoration: line-through;">RM 15.00</span></b>');
        if($('.header-cart').hasClass('header-cart-unlogin')){
          $('#cart > button > #cart-total').text('CART');
        }
        // $('#payment_address_email-error').html('<p>vivalife</p>');
        // $('#shipping_address_lastname_input #shipping_address_lastname').attr('placeholder','123');
        // $('#shipping_address_lastname_input #shipping_address_lastname').addClass('asd');
      }

      $('.alert-ch').delay(5000).fadeOut('slow');

      // if($('#confirm_form #confirm_agree').is(':checked')){
      //
  		// } else {
  		// 	$('#confirm_agree_input > div').append('<div>Warning, You must agree to the Terms & Conditions!</div>');
  		// }

    });
  })(jQuery)
</script>

<script type="text/javascript">
  // $(document).on('click', '.number-spinner-custom button', function () {
  //   var btn = $(this),
  //   oldValue = btn.closest('.number-spinner-custom').find('input').val().trim(),
  //   newVal = 1;
  //
  //   if (btn.attr('data-dir') == 'up') {
  //     newVal = parseInt(oldValue) + 1;
  //   } else {
  //     if (oldValue > 1) {
  //       newVal = parseInt(oldValue) - 1;
  //     } else {
  //       newVal = 1;
  //     }
  //   }
  //   btn.closest('.number-spinner-custom').find('input').val(newVal);
  //
  // });

  $(document).on('change', '.number-spinner-cart input', function () {
    console.log('123');
    $('.number-spinner-cart').find('input').val();
    $('.update-cart-ch').trigger('click');
  });

  $(document).on('click', '.number-spinner-cart a[data-dir="dwn"], .number-spinner-cart a[data-dir="up"]', function () {
    var btn = $(this),
    oldValue = btn.closest('.number-spinner-cart').find('input').val().trim(),
    newVal = 1;
    console.log(btn.attr('data-dir'));

    if (btn.attr('data-dir') == 'up') {
      newVal = parseInt(oldValue) + 1;
    } else if (btn.attr('data-dir') == 'dwn') {
      if (oldValue > 1) {
        newVal = parseInt(oldValue) - 1;
      } else {
        newVal = 1;
      }
    }
    console.log(newVal);
    btn.closest('.number-spinner-cart').find('input').val(newVal);
    $('.update-cart-ch').trigger('click');
    // $('.alert.alert-success.alert-dismissible').addClass('alert-ch');
    // $('.alert-ch').delay(5000).fadeOut('slow');
  });

  $(document).on('click', '.number-spinner-custom a[data-dir="dwn"], .number-spinner-custom a[data-dir="up"]', function () {
    $('.testplus').addClass('qwert');
    var btn = $(this),
    oldValue = btn.closest('.number-spinner-custom').find('input').val().trim(),
    newVal = 1;
    console.log(btn.attr('data-dir'));

    if (btn.attr('data-dir') == 'up') {
      newVal = parseInt(oldValue) + 1;
    } else if (btn.attr('data-dir') == 'dwn') {
      if (oldValue > 1) {
        newVal = parseInt(oldValue) - 1;
      } else {
        newVal = 1;
      }
    }
    console.log(newVal);
    btn.closest('.number-spinner-custom').find('input').val(newVal);
    $('.update-cart-ch').trigger('click');
    // $('.alert.alert-success.alert-dismissible').addClass('alert-ch');
    // $('.alert-ch').delay(5000).fadeOut('slow');
  });

  // $(document).on('change', '.number-spinner-cart input', function () {
  //   var btn = $(this),
  //   oldValue = btn.closest('.number-spinner-cart').find('input').val().trim(),
  //   newVal = 1;
  //
  //   if (btn.attr('data-dir') == 'ctr') {
  //     newVal = parseInt(oldValue);
  //   } else {
  //     if (oldValue > 1) {
  //       newVal = parseInt(oldValue) - 1;
  //     } else {
  //       newVal = 1;
  //     }
  //   }
  //   console.log(newVal);
  //   console.log(oldValue);
  //   btn.closest('.number-spinner-cart').find('input').val(newVal);
  // });

  // $(document).on('change', '.number-spinner-cart input', function () {
  //   $(document).keypress(function(event) {
  //       if (event.key === "Enter") {
  //         // $('.update-cart-ch').trigger('click');
  //       }
  //   });
  // });

  // function printDiv(content) {
  //     var dd=document.getElementById(content).innerHTML,
  //     ee=document.body.innerHTML;document.body.innerHTML=dd,
  //     window.print(),
  //     document.body.innerHTML=ee
  // }

  function printDiv(content){
			var printContents = document.getElementById(content).innerHTML;
			var originalContents = document.body.innerHTML;

			document.body.innerHTML = printContents;

			window.print();

			document.body.innerHTML = originalContents;

		}




</script>

<script type="text/javascript">
  (function($){
    $(document).ready(function(){
      $('.nav.navbar-nav > li:last-child').addClass('hidelastmenu');

      if($('body').hasClass('logged-in')){
        $('.nav.navbar-nav > li:last-child').removeClass('hidelastmenu');
      }

      $('.grandchild3 .ch-menuli > a').hover(function(){
        // $('.grandchildmenu').css('display', 'block');
        }, function(){
        // $('.grandchildmenu').css('display', 'none');
      });

    });
  })(jQuery)
</script>

{% if logged %}

<script type="text/javascript">
  (function($){
    $(document).ready(function(){
      $('.nav.navbar-nav > li:last-child').removeClass('hidelastmenu');
    });
  })(jQuery)
</script>

{% endif %}

<!--
OpenCart is open source software and you are free to remove the powered by OpenCart if you want, but its generally accepted practise to make a small donation.
Please donate via PayPal to donate@opencart.com
//-->
</body></html>
