Created
February 18, 2012 08:14
-
-
Save Mamaduka/1858177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter chockout fields | |
*/ | |
function pf_woocommerce_checkout_fields( $fields ) { | |
global $woocommerce; | |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) : | |
if( ! in_array($values['product_id'], array(137, 139, 141) ) ) : | |
unset( $fields['account'] ); | |
endif; | |
endforeach; | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields', 'pf_woocommerce_checkout_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment