Skip to content

Commit f8fd9b5

Browse files
committed
refactor: reorder settings fields to place description after redirect mode
Move description field to appear immediately after redirect mode checkbox for all payment methods (CC, Bizum, PayPal). This improves UX by grouping the description with the redirect mode setting, since descriptions only display in redirect mode.
1 parent 8c893d1 commit f8fd9b5

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

includes/admin/monei-bizum-settings.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
'default' => 'no',
4141
'description' => sprintf( __( 'If disabled the Bizum button will be rendered directly on the checkout page. It is recommended to enable redirection in cases where Bizum payments do not function correctly.', 'monei' ) ),
4242
),
43+
'description' => array(
44+
'title' => __( 'Description', 'monei' ),
45+
'type' => 'textarea',
46+
'description' => __( 'This description is only displayed when using redirect mode. It will be shown to customers before they are redirected to the payment page.', 'monei' ),
47+
'default' => __( 'Pay with Bizum. Powered by MONEI.', 'monei' ),
48+
'class' => 'monei-bizum-description-field',
49+
),
4350
'bizum_style' => array(
4451
'title' => __( 'Bizum Style', 'monei' ),
4552
'type' => 'textarea',
@@ -54,13 +61,6 @@
5461
'default' => __( 'Bizum', 'monei' ),
5562
'desc_tip' => true,
5663
),
57-
'description' => array(
58-
'title' => __( 'Description', 'monei' ),
59-
'type' => 'textarea',
60-
'description' => __( 'This description is only displayed when using redirect mode. It will be shown to customers before they are redirected to the payment page.', 'monei' ),
61-
'default' => __( 'Pay with Bizum. Powered by MONEI.', 'monei' ),
62-
'class' => 'monei-bizum-description-field',
63-
),
6464
'hide_logo' => array(
6565
'title' => __( 'Hide Logo', 'monei' ),
6666
'type' => 'checkbox',

includes/admin/monei-cc-settings.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,30 @@
3737
'title' => __( 'Use Redirect Flow', 'monei' ),
3838
'type' => 'checkbox',
3939
'label' => __( 'This will redirect the customer to the Hosted Payment Page.', 'monei' ),
40-
'default' => 'yes',
40+
'default' => 'no',
4141
'description' => sprintf( __( 'If disabled the credit card input will be rendered directly on the checkout page.', 'monei' ) ),
4242
),
43+
'description' => array(
44+
'title' => __( 'Description', 'monei' ),
45+
'type' => 'textarea',
46+
'description' => __( 'This description is only displayed when using redirect mode. It will be shown to customers before they are redirected to the payment page.', 'monei' ),
47+
'default' => __( 'Pay with credit card.', 'monei' ),
48+
'class' => 'monei-cc-description-field',
49+
),
50+
'card_input_style' => array(
51+
'title' => __( 'Card Input Style', 'monei' ),
52+
'type' => 'textarea',
53+
'description' => __( 'Configure in JSON format the style of the Card Input component. Documentation: ', 'monei' ) . '<a href="https://docs.monei.com/docs/monei-js/reference/#cardinput-style-object" target="_blank">MONEI Card Input Style</a>',
54+
'default' => '{"base": {"height": "50"}, "input": {"background": "none"}}',
55+
'css' => 'min-height: 80px;',
56+
),
4357
'title' => array(
4458
'title' => __( 'Title', 'monei' ),
4559
'type' => 'text',
4660
'description' => __( 'The payment method title a user sees during checkout.', 'monei' ),
4761
'default' => __( 'Credit Card', 'monei' ),
4862
'desc_tip' => true,
4963
),
50-
'description' => array(
51-
'title' => __( 'Description', 'monei' ),
52-
'type' => 'textarea',
53-
'description' => __( 'The payment method description a user sees during checkout.', 'monei' ),
54-
'default' => __( 'Pay with credit card.', 'monei' ),
55-
),
5664
'hide_logo' => array(
5765
'title' => __( 'Hide Logo', 'monei' ),
5866
'type' => 'checkbox',

includes/admin/monei-paypal-settings.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
'default' => 'no',
4141
'description' => sprintf( __( 'If disabled the PayPal button will be rendered directly on the checkout page. It is recommended to enable redirection in cases where PayPal payments do not function correctly.', 'monei' ) ),
4242
),
43+
'description' => array(
44+
'title' => __( 'Description', 'monei' ),
45+
'type' => 'textarea',
46+
'description' => __( 'This description is only displayed when using redirect mode. It will be shown to customers before they are redirected to the payment page.', 'monei' ),
47+
'default' => __( 'Pay with PayPal. Powered by MONEI.', 'monei' ),
48+
'class' => 'monei-paypal-description-field',
49+
),
4350
'paypal_style' => array(
4451
'title' => __( 'PayPal Style', 'monei' ),
4552
'type' => 'textarea',
@@ -54,13 +61,6 @@
5461
'default' => __( 'PayPal', 'monei' ),
5562
'desc_tip' => true,
5663
),
57-
'description' => array(
58-
'title' => __( 'Description', 'monei' ),
59-
'type' => 'textarea',
60-
'description' => __( 'This description is only displayed when using redirect mode. It will be shown to customers before they are redirected to the payment page.', 'monei' ),
61-
'default' => __( 'Pay with PayPal. Powered by MONEI.', 'monei' ),
62-
'class' => 'monei-paypal-description-field',
63-
),
6464
'hide_logo' => array(
6565
'title' => __( 'Hide Logo', 'monei' ),
6666
'type' => 'checkbox',

0 commit comments

Comments
 (0)