Last active
January 14, 2021 15:29
-
-
Save vanbo/91a31f398a648b298d712d505d701fc2 to your computer and use it in GitHub Desktop.
WC Paysafe Modify Overlay settings
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
/** | |
* Add the gist to your "theme/functions.php" file or any file loading with after the "theme/functions.php" file | |
*/ | |
add_filter( 'wc_paysafe_checkoutjs_order_iframe_props', 'prefix_modify_overlay_parameters', 10, 3 ); | |
/** | |
* @param array $parameters | |
* @param \WC_Order $order | |
* @param \WcPaysafe\Api\Checkoutjs\Service $service | |
* | |
* @return array | |
*/ | |
function prefix_modify_overlay_parameters( $parameters, $order, $service ) { | |
// Change the overlay language on demand. | |
if ( true ) { | |
// Values: "en_US", "fr_CA" | |
$parameters['options']['locale'] = 'en_US'; | |
} | |
// Always return the parameters!!!! | |
return $parameters; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment