daily pastebin goal
70%
SHARE
TWEET

WooCommerce AGB Hinweis im Checkout

v-mann Aug 11th, 2012 507 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top