Created
June 11, 2017 00:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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