Add a check for the existence of a method in a class
This commit is contained in:
parent
4a68135e33
commit
7f04fe822a
@ -632,7 +632,9 @@ if (!class_exists('WC_Retailcrm_Customers')) :
|
||||
$new_customer = new WC_Customer();
|
||||
|
||||
foreach ($order->get_address('billing') as $prop => $value) {
|
||||
$new_customer->{'set_billing_' . $prop}($value);
|
||||
if (method_exists($new_customer, 'set_billing_' . $prop)) {
|
||||
$new_customer->{'set_billing_' . $prop}($value);
|
||||
}
|
||||
}
|
||||
|
||||
$new_customer->set_first_name($order->get_billing_first_name());
|
||||
|
Loading…
x
Reference in New Issue
Block a user