Skip to content

Commit f88acb1

Browse files
committed
added missing woo sync customer method
1 parent 151bbc5 commit f88acb1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Api/WooCommerce.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,19 @@ public function validateAccount()
105105
$endpoint = 'woocommerce/initial_account_settings';
106106
return $this->restClient->get($endpoint);
107107
}
108+
109+
110+
public function syncCustomer($email, $fields, $shopUrl)
111+
{
112+
$endpoint = 'woocommerce/sync_customer';
113+
$params = array_merge($this->prepareParams(), ['email' => $email, 'subscriber_fields' => $fields, 'shop' => $shopUrl] );
114+
115+
$response = $this->restClient->post( $endpoint, $params );
116+
117+
if (isset($response['body'])) {
118+
return $response['body'];
119+
} else {
120+
return true;
121+
}
122+
}
108123
}

0 commit comments

Comments
 (0)