-
-
Save NiklasHogefjord/8f1acf79999561b9544c7d559b3e6b82 to your computer and use it in GitHub Desktop.
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 | |
// Display an error notice abouve the KCO checkout if the customer is under 18 years. | |
add_action('klarna_before_kco_checkout', 'my_klarna_before_kco_checkout' ); | |
function my_klarna_before_kco_checkout() { | |
if ( isset( $_GET['under_age'] ) ) { | |
echo '<div class="woocommerce-error">'; | |
_e( 'You need to be over 18 years to make a purchase.', 'woocommerce-gateway-klarna' ); | |
echo '</div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment