Last active
June 13, 2016 09:51
-
-
Save oterox/1c04d08c8e2b2ad820276d3e1ead6344 to your computer and use it in GitHub Desktop.
woocommerce snippets
This file contains hidden or 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
<?php | |
add_filter('add_to_cart_redirect', 'themeprefix_add_to_cart_redirect'); | |
function themeprefix_add_to_cart_redirect() { | |
global $woocommerce; | |
$checkout_url = $woocommerce->cart->get_checkout_url(); | |
return $checkout_url; | |
} | |
//Add New Pay Button Text | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'themeprefix_cart_button_text' ); | |
function themeprefix_cart_button_text() { | |
return __( 'Pay Now', 'woocommerce' ); | |
} | |
add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout'); | |
function woo_redirect_to_checkout() { | |
$checkout_url = WC()->cart->get_checkout_url(); | |
return $checkout_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment