Last active
August 29, 2015 14:00
-
-
Save rxnlabs/11230379 to your computer and use it in GitHub Desktop.
WooCommerce/WordPress: redirect to checkout page after successful PayPal purchase
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
<?php | |
#encode the return URL for PayPal so user's are redirected back to site after completing payment | |
add_filter( 'woocommerce_paypal_args','woocommerce_paypal_args_repair'); | |
function woocommerce_paypal_args_repair( $paypal_args ) { | |
global $woocommerce; | |
if (!array_key_exists(‘cbt’,$paypal_args)) | |
$paypal_args['cbt'] = $woocommerce->cart->get_checkout_url(); | |
return $paypal_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment