Skip to content

Commit

Permalink
Merge branch 'PFWMA-294' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
drewangell committed Feb 24, 2023
2 parents 0cf10a3 + f7c0d86 commit b3a4420
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions includes/angelleye-multi-account-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,18 @@ function angelleye_get_checkout_custom_field_keys() {
'account' => array('account_username', 'account_password', 'account_password-2'),
'order' => array('order_comments')
);
$checkout_fields = WC()->checkout->get_checkout_fields();

/**
* Adds isset() and is_array() to avoid errors when the data is not a clean array.
* Resolves PFWMA-294
* [email protected]
*/
foreach ($checkout_fields as $type => $checkout_field) {
foreach ($checkout_field as $key => $field) {
if (!in_array($key, $woo_checkout_default_fields[$type])) {
$woo_custome_fields[$key] = $field['type'];
if (isset($woo_checkout_default_fields[$type]) && is_array($woo_checkout_default_fields[$type])) {
foreach ($checkout_field as $key => $field) {
if (!in_array($key, $woo_checkout_default_fields[$type])) {
$woo_custome_fields[$key] = $field;
}
}
}
}
Expand Down

0 comments on commit b3a4420

Please sign in to comment.