Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: WooCommerce - Minimal Required Fields
- Plugin URI: http://www.damiencarbery.com
- Description: Experiment with the minimal number of fields required to complete PayPal payment.
- Author: Damien Carbery
- Version: 0.1
- $Id: $
- */
- // See: http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
- add_filter( 'woocommerce_checkout_fields' , 'wmrf_remove_checkout_fields' );
- // Our hooked in function - $fields is passed via the filter!
- function wmrf_remove_checkout_fields( $fields ) {
- // Remove all billing fields except the email field.
- unset($fields['billing']['billing_first_name']);
- unset($fields['billing']['billing_last_name']);
- unset($fields['billing']['billing_company']);
- unset($fields['billing']['billing_address_1']);
- unset($fields['billing']['billing_address_2']);
- unset($fields['billing']['billing_city']);
- unset($fields['billing']['billing_postcode']);
- unset($fields['billing']['billing_country']);
- unset($fields['billing']['billing_state']);
- unset($fields['billing']['billing_phone']);
- unset($fields['order']['order_comments']);
- return $fields;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement