I've been trying to add a filter to my woocommerce code to prevent the form from sending the customer email address to paypal. (Im using paypal standard). Supposedly this will cause the credit card form to be the default display instead of the 'sign in to paypal' option.
I've found this code here: Paypal Payment Standard default enter card details that should do this, but i'm unsure where to place that code. Here is my /templates/checkout/form-checkout.php which is not working:
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( $get_checkout_url ); ?>" enctype="multipart/form-data">
<?php if ( sizeof( $checkout->checkout_fields ) > 0 ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div class="col2-set" id="customer_details">
<div class="col-1">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<div class="col-2">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
</div>
<?php function smw_woo_paypal_args($args) {
$args['email'] = '';
return $args;
}
add_filter( 'woocommerce_paypal_args', 'smw_woo_paypal_args', 99);
?>
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<h3 id="order_review_heading"><?php _e( 'Your order', 'woocommerce' ); ?></h3>
<?php endif; ?>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
</form>
Any ideas on where to place this filter?