Skip to content

Instantly share code, notes, and snippets.

@rxnlabs
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rxnlabs/11230379 to your computer and use it in GitHub Desktop.
Save rxnlabs/11230379 to your computer and use it in GitHub Desktop.
WooCommerce/WordPress: redirect to checkout page after successful PayPal purchase
<?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