From 8fa658c07fe17146e117d7f1d1cd92f84753aaa9 Mon Sep 17 00:00:00 2001 From: Victor Pahuus Petersen <49293748+victorpahuus@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:19:24 +0100 Subject: [PATCH 1/2] Update woocommerce-onpay.php Added some styling to the onboarding page --- woocommerce-onpay.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/woocommerce-onpay.php b/woocommerce-onpay.php index bc4ee6a..08937c2 100644 --- a/woocommerce-onpay.php +++ b/woocommerce-onpay.php @@ -1265,15 +1265,16 @@ private function json_response($message, $error = false, $responseCode = 200) { die(wp_json_encode($response)); } - private function getOnboardingHtml() { - $html = '' . __('Don\'t have an OnPay account yet? Order one through DanDomain from DKK 0,- per month.', 'wc-onpay') . ''; - $html .= ' '; - $html .= '' . __('Get OnPay now', 'wc-onpay') . ''; - $html .= ' '; - $html .= '' . __('OnPay sellers', 'wc-onpay') . ''; - - return $html; - } + private function getOnboardingHtml() { + $html = '
'; + $html .= '

' . __('Don\'t have an OnPay account yet?', 'wc-onpay') . '

'; + $html .= '' . __('Order one through DanDomain from DKK 0,- per month.', 'wc-onpay') . ''; + $html .= '' . __('Get OnPay now', 'wc-onpay') . ''; + $html .= '' . __('OnPay sellers', 'wc-onpay') . ''; + $html .= '
'; + + return $html; + } /** * Return the name of the option in the WP DB. From fa1244356e468038cba231dcf242e6f51de37e03 Mon Sep 17 00:00:00 2001 From: Ebbe Date: Wed, 17 Jan 2024 09:52:40 +0100 Subject: [PATCH 2/2] Included OnPay branding Also promoted the login button as the primary call-to action --- woocommerce-onpay.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/woocommerce-onpay.php b/woocommerce-onpay.php index 08937c2..dc6d256 100644 --- a/woocommerce-onpay.php +++ b/woocommerce-onpay.php @@ -429,9 +429,7 @@ public function admin_options() { echo ent2ncr($html); return; } catch (OnPay\API\Exception\TokenException $exception) { // Something's wrong with the token, print link to reauth - $html .= $this->getOnboardingHtml(); - $html .= '
'; - $html .= '' . __('Log in with OnPay account', 'wc-onpay') . ''; + $html .= $this->getOnboardingHtml($onpayApi->authorize()); $GLOBALS['hide_save_button'] = true; $hideForm = true; } @@ -1265,16 +1263,19 @@ private function json_response($message, $error = false, $responseCode = 200) { die(wp_json_encode($response)); } - private function getOnboardingHtml() { - $html = '
'; - $html .= '

' . __('Don\'t have an OnPay account yet?', 'wc-onpay') . '

'; - $html .= '' . __('Order one through DanDomain from DKK 0,- per month.', 'wc-onpay') . ''; - $html .= '' . __('Get OnPay now', 'wc-onpay') . ''; - $html .= '' . __('OnPay sellers', 'wc-onpay') . ''; - $html .= '
'; + private function getOnboardingHtml($authUrl) { + $html = '
'; + $html .= '' . __('Log in with OnPay account', 'wc-onpay') . ''; + $html .= '
'; + $html .= '

' . __('Don\'t have an OnPay account yet?', 'wc-onpay') . '

'; + $html .= '' . __('Order one through DanDomain from DKK 0,- per month.', 'wc-onpay') . ''; + $html .= '
'; + $html .= '' . __('Get OnPay now', 'wc-onpay') . ''; + $html .= '' . __('OnPay sellers', 'wc-onpay') . ''; + $html .= '
'; return $html; - } + } /** * Return the name of the option in the WP DB.