From 56a14ab2d776a2e3782429abad40bb9ed7326bb3 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 28 Sep 2011 09:35:51 +0100 Subject: [PATCH] Phone # fix --- classes/gateways/gateway-paypal.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/classes/gateways/gateway-paypal.php b/classes/gateways/gateway-paypal.php index 7aec1677f47..eee61392200 100644 --- a/classes/gateways/gateway-paypal.php +++ b/classes/gateways/gateway-paypal.php @@ -130,13 +130,14 @@ class woocommerce_paypal extends woocommerce_payment_gateway { $shipping_name = explode(' ', $order->shipping_method); if (in_array($order->billing_country, array('US','CA'))) : + $order->billing_phone = str_replace(array('(', '-', ' ', ')'), '', $order->billing_phone); $phone_args = array( 'night_phone_a' => substr($order->billing_phone,0,3), - 'night_phone_b' => substr($order->billing_phone,0,3), - 'night_phone_c' => substr($order->billing_phone,0,3), + 'night_phone_b' => substr($order->billing_phone,3,3), + 'night_phone_c' => substr($order->billing_phone,6,4), 'day_phone_a' => substr($order->billing_phone,0,3), - 'day_phone_b' => substr($order->billing_phone,0,3), - 'day_phone_c' => substr($order->billing_phone,0,3) + 'day_phone_b' => substr($order->billing_phone,3,3), + 'day_phone_c' => substr($order->billing_phone,6,4) ); else : $phone_args = array(