This CodeLet will redirect the user to checkout page when user clicks on 'Buy now' button on the product

Use the code and create a custom module

Make sure you keep the weight of the module high in "system" table
 

CodeLet
<?php
/**
 * Implements hook_form_FORM_ID_alter().
 */
function MY_MODULE_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
 
$form['submit']['#attributes']['value'] = t('Buy Now');
 
$form['#submit'][] =  '_custom_redirect_checkout';
}

/**
 * add to card submit form handler
 * @param unknown $form
 * @param unknown $form_state
 */
function _custom_redirect_checkout($form, &$form_state) {
   
drupal_goto('checkout');
}
?>
Compatibility
Submitted by saru1683 on