Skip to content

Instantly share code, notes, and snippets.

@danjjohnson

danjjohnson/amk.php

Created Jul 25, 2014
Embed
What would you like to do?
Sensei custom code for AMK Pro Case Study
/**
* Remove checkout field
*
* @filter woocommerce_checkout_fields
* @since 1.0.0
*
*/
function apk_override_checkout_fields( $fields ) {
unset($fields['order']['order_comments']);
//Billing
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_state']);
unset($fields['billing']['billing_phone']);
unset($fields['billing']['billing_country']);
//Shipping
unset($fields['shipping']['shipping_first_name']);
unset($fields['shipping']['shipping_last_name']);
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_address_1']);
unset($fields['shipping']['shipping_address_2']);
unset($fields['shipping']['shipping_city']);
unset($fields['shipping']['shipping_postcode']);
unset($fields['shipping']['shipping_state']);
unset($fields['shipping']['shipping_phone']);
//Email
$fields['billing']['billing_email']['class'] = array('form-row form-row-wide');
//Usuario
$fields['account']['account_username']['label'] = 'Elige un nombre de usuario';
$fields['account']['account_password']['label'] = 'Crea una contraseña';
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'apk_override_checkout_fields' );
/**
* Remove default WooCommerce stylesheets
*
* @filter woocommerce_enquque_styles
* @since 1.0.0
*
*/
function apk_dequeue_styles( $enqueue_styles ) {
unset( $enqueue_styles['woocommerce-general'] );
return $enqueue_styles;
}
add_filter( 'woocommerce_enqueue_styles', 'apk_dequeue_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.