Skip to content

Instantly share code, notes, and snippets.

@cj-andrew
Created June 11, 2017 00:33
Show Gist options
  • Save cj-andrew/fea2a2272081f998207d87e1dfc9b95f to your computer and use it in GitHub Desktop.
Save cj-andrew/fea2a2272081f998207d87e1dfc9b95f to your computer and use it in GitHub Desktop.
Add A "Proceed To Checkout" Button Under the "Add To Cart" Button on Single Product Page
/**
* Adds a "Proceed To Checkout" button underneath the "Add To Cart" button
* @author: CJ Andrew (cjwebstudio)
*/
add_action('woocommerce_after_add_to_cart_form','proceed_to_checkout');
function proceed_to_checkout(){
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
echo '<a href="'. $checkout_url .'" class="button">Proceed to Checkout</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment