From ee7f3aace43688b5887e93e3d09ef7f08b1eef2e Mon Sep 17 00:00:00 2001 From: larasmorningtrain Date: Wed, 17 Jan 2024 09:42:58 +0000 Subject: [PATCH] Fix styling --- src/woocommerce/WC_Gateway_Economic_Invoice.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/woocommerce/WC_Gateway_Economic_Invoice.php b/src/woocommerce/WC_Gateway_Economic_Invoice.php index 008a2b9..a0a2bb8 100644 --- a/src/woocommerce/WC_Gateway_Economic_Invoice.php +++ b/src/woocommerce/WC_Gateway_Economic_Invoice.php @@ -24,7 +24,7 @@ public function __construct() $this->description = $this->get_option('description'); // This action hook saves the settings - add_action('woocommerce_update_options_payment_gateways_' . $this->id, [$this, 'process_admin_options']); + add_action('woocommerce_update_options_payment_gateways_'.$this->id, [$this, 'process_admin_options']); add_action('woocommerce_new_order', [$this, 'onNewOrder'], 10, 1); add_action('woocommerce_order_status_completed', [$this, 'onOrderCompleted'], 10, 1); @@ -194,7 +194,7 @@ public function onOrderCompleted(int $orderId): void private function getLayouts(): array { - if(! $this->isSettingsPage()){ + if (! $this->isSettingsPage()) { return []; } @@ -205,7 +205,7 @@ private function getLayouts(): array private function getPaymentTerms() { - if(! $this->isSettingsPage()){ + if (! $this->isSettingsPage()) { return []; } @@ -216,7 +216,7 @@ private function getPaymentTerms() private function getVatZones() { - if(! $this->isSettingsPage()){ + if (! $this->isSettingsPage()) { return []; } @@ -227,7 +227,7 @@ private function getVatZones() private function getCustomerGroup() { - if(! $this->isSettingsPage()){ + if (! $this->isSettingsPage()) { return []; } @@ -274,16 +274,15 @@ public function eanFieldUpdateOrderMeta($order_id): void public function addEanFieldFisplayAdminOrderMeta($order): void { - echo '

' . __('EAN nummer', 'woocommerce') . ': ' . get_post_meta($order->get_id(), 'economic_billing_ean', true) . '

'; + echo '

'.__('EAN nummer', 'woocommerce').': '.get_post_meta($order->get_id(), 'economic_billing_ean', true).'

'; } - function isSettingsPage() { + public function isSettingsPage() + { $currentScreen = get_current_screen(); return $currentScreen->base === 'woocommerce_page_wc-settings' && isset($_GET['tab']) && $_GET['tab'] === 'checkout' && isset($_GET['section']) && $_GET['section'] === 'economic_invoice'; } - - }