How to make button Buy Now with add to cart for opencart 2X ?

For opencart 2.0 Add extra button beside Add to cart button i.e., Buy Now Or you can add option in admin which product have to be buy now or add to cart button

for category page \catalog\view\theme\default\template\product\category.tpl And same for modules

<button type="button" onclick="buynow('<?php echo $product['product_id']; ?>');">
     <i class="fa"></i> 
     <span class="hidden-xs hidden-sm hidden-md">Buy Now</span>
     </button> 
     <script>function buynow(pid){cart.add_buynow(pid);}</script>

for product page \catalog\view\theme\default\template\product\product.tpl

<button type="button" id="button_buy" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block">Buy Now</button>


<script>
$("#button_buy").click(function(){
  $.ajax({
    url: 'index.php?route=checkout/cart/add',
    type: 'post',
    data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
    dataType: 'json',
    beforeSend: function() {
      $('#button-buy').button('loading');
    },    
    complete: function() {
      $('#loading-image').html('');
    },
    success: function(json) {

      $('.form-group').removeClass('has-error');

      if (json['error']) {
        if (json['error']['option']) {
          for (i in json['error']['option']) {
            var element = $('#input-option' + i.replace('_', '-'));

            if (element.parent().hasClass('input-group')) {
              element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
            } else {
              element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
            }
          }
        }

        if (json['error']['recurring']) {
          $('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
        }

        // Highlight any found errors
        $('.text-danger').parent().addClass('has-error');
      }

      if (json['success']) {location.href = 'index.php?route=checkout/checkout';  }
    }
  });
});
</script> 

if oc 2.3 X added below code

window.location='index.php?route=checkout/checkout';
to file opencart/upload/catalog/view/javascript/common.js line 168.

and it worked like charm.

ref : https://stackoverflow.com/questions/11280487/opencart-skip-add-to-cart-straight-to-checkout