Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-------------- AGB Hinweis beim Checkout --------------*/
- add_action('woocommerce_after_order_notes', 'agb_checkout_field');
- function agb_checkout_field( $checkout ) {
- echo '<div id="agb_checkout">';
- woocommerce_form_field( 'agb_checkout', array(
- 'type' => 'checkbox',
- 'class' => array('notes'),
- 'label' => __('Mit Abgabe einer Bestellung bestätigen Sie, unsere <a href="http://blogadresse.com/agb">AGB</a> gelesen, verstanden und akzeptiert zu haben.'),
- 'placeholder' => __('AGB', 'woothemes'),
- 'required' => true,
- ), $checkout->get_value( 'agb_checkout' ));
- echo '</div>'; }
- /*-------------- AGB Feld validieren --------------*/
- add_action('woocommerce_checkout_process', 'agb_checkout_valid');
- function agb_checkout_valid() {
- global $woocommerce;
- if (!isset($_POST['agb_checkout']))
- $woocommerce->add_error( __('Bitte bestätigen Sie die AGB.') );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement