Skip to content

Commit

Permalink
Added additional harden to prevent possible non-frontend errors withi…
Browse files Browse the repository at this point in the history
…n invoice gateway.
  • Loading branch information
dennisnissle committed Oct 1, 2024
1 parent 01de5a4 commit 29255db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/gateways/invoice/class-wc-gzd-gateway-invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function is_available() {
}

if ( 'yes' === $this->get_option( 'customers_completed' ) ) {
if ( is_user_logged_in() ) {
if ( is_user_logged_in() && WC()->customer ) {
return WC()->customer->get_is_paying_customer() === true;
} else {
return false;
Expand Down
2 changes: 2 additions & 0 deletions wpml-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<custom-field action="copy">_differential_taxation</custom-field>
<custom-field action="translate">_warranty_attachment_id</custom-field>
<custom-field action="translate">_safety_attachment_ids</custom-field>
<custom-field action="copy-once">formatted_address</custom-field>
<custom-field action="copy-once">formatted_eu_address</custom-field>
<custom-field action="copy-once">_ts_mpn</custom-field>
<custom-field action="copy-once">_ts_gtin</custom-field>
<custom-field action="translate">_legal_text</custom-field>
Expand Down

0 comments on commit 29255db

Please sign in to comment.