Advertisement
v-mann

WooCommerce AGB Hinweis im Checkout

Aug 11th, 2012
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. /*-------------- AGB Hinweis beim Checkout     --------------*/
  2.  
  3. add_action('woocommerce_after_order_notes', 'agb_checkout_field');
  4. function agb_checkout_field( $checkout ) {
  5.  
  6. echo '<div id="agb_checkout">';
  7.  
  8.  woocommerce_form_field( 'agb_checkout', array(
  9.          'type'          => 'checkbox',
  10.          'class'         => array('notes'),
  11.          'label'         => __('Mit Abgabe einer Bestellung best&auml;tigen Sie, unsere <a href="http://blogadresse.com/agb">AGB</a> gelesen, verstanden und akzeptiert zu haben.'),
  12.          'placeholder'       => __('AGB', 'woothemes'),
  13.          'required'         => true,
  14.          ), $checkout->get_value( 'agb_checkout' ));
  15.          echo '</div>'; }
  16.  
  17.  
  18. /*-------------- AGB Feld validieren   --------------*/
  19.  
  20.  add_action('woocommerce_checkout_process', 'agb_checkout_valid');
  21.  function agb_checkout_valid() {
  22.          global $woocommerce;
  23.          if (!isset($_POST['agb_checkout']))
  24.  
  25.  $woocommerce->add_error( __('Bitte best&auml;tigen Sie die AGB.') );
  26.  
  27.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement