Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ PostNL’s official extension for WooCommerce on WordPress. Manage your national
* Fix: Hide delivery-day, morning and evening surcharges when free shipping applies, including PostNL's minimum-order-amount threshold.
* Fix: Prevent duplicate PostNL delivery options container from appearing during blocks checkout fragment updates.
* Tweak: Improve tax handling so tab prices accurately reflect tax-inclusive and tax-exclusive display settings.
* Add: Independent button width controls (slider) for cart, checkout, and minicart locations in the Checkoutboosters settings.
* Add: Global button corner radius control (slider) in the Checkoutboosters settings.
* Add: Live button preview in the Checkoutboosters settings section that updates in real time as styling options are changed.
* Tweak: Renamed "Fill in with PostNL" settings section to "Checkoutboosters" with updated feature description and activation link.
* Tweak: Updated Fill in With PostNL button label to "Autofill with PostNL" and refreshed the description text shown below the button.
* Tweak: Description text below the Fill in With PostNL button is now displayed at 80% font size and centred on the cart page.
* Tweak: Button border now defaults to none on fresh installations; background colour defaults to PostNL orange.

### 5.9.5
* Add: Ability to set the default checkout tab (Delivery or Pickup) from the PostNL checkout settings.
Expand Down
7 changes: 6 additions & 1 deletion assets/css/postnl-fill-in-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
min-height: 35px;
max-height: 60px;
width: 100%;
border: 1px solid #F56900;
border: none;
background-color: #F56900;
cursor: pointer;
outline: none;
Expand Down Expand Up @@ -37,6 +37,11 @@
width: 94%;
}

.postnl-button-in-cart .postnl-login-button__description {
font-size: 80%;
text-align: center;
}

.postnl-hidden{
visibility: hidden !important;
}
74 changes: 74 additions & 0 deletions assets/js/admin-fill-in-with-postnl-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,78 @@
// Mark as initialized
$( this ).data( 'codeEditorInitialized', true );
} );

function postnlUpdatePreview() {
var $preview = $( '#postnl-button-preview' );
if ( ! $preview.length ) {
return;
}

var bgColor = $( '#postnl_button_background_color' ).val() || '#ff6200';
var border = $( '#postnl_button_border' ).val() || 'none';
var borderRadius = $( '#postnl_button_border_radius' ).val() || '4';

$preview.css( {
'background-color': bgColor,
'border': border,
'border-radius': borderRadius + 'px',
} );
}

$( '#postnl_button_border, #postnl_button_border_radius' ).on( 'input change', postnlUpdatePreview );
$( '#postnl_button_background_color' ).on( 'change', postnlUpdatePreview );

( function () {
var $preview = $( '#postnl-button-preview' );
var savedHoverColor = $( '#postnl_button_hover_background_color' ).val() || '#e55500';
$preview.on( 'mouseenter', function () {
var hoverColor = $( '#postnl_button_hover_background_color' ).val() || savedHoverColor;
$( this ).css( 'background-color', hoverColor );
} ).on( 'mouseleave', function () {
var bgColor = $( '#postnl_button_background_color' ).val() || '#ff6200';
$( this ).css( 'background-color', bgColor );
} );
} )();

$( '.postnl-range-slider' ).each( function () {
var $number = $( this );
var min = $number.attr( 'min' ) || '0';
var max = $number.attr( 'max' ) || '100';
var step = $number.attr( 'step' ) || '1';
var unit = $number.data( 'unit' ) || '';
var value = $number.val() || min;

var $label = $( '<span class="postnl-slider-value"></span>' ).css( {
display: 'inline-block',
minWidth: '3em',
marginLeft: '8px',
fontWeight: 'bold',
} ).text( value + unit );

var $range = $( '<input type="range">' ).attr( {
min: min,
max: max,
step: step,
value: value,
} ).css( {
verticalAlign: 'middle',
width: '160px',
marginLeft: '10px',
cursor: 'pointer',
} );

$range.on( 'input', function () {
var v = $( this ).val();
$number.val( v ).trigger( 'change' );
$label.text( v + unit );
} );

$number.on( 'input change', function () {
var v = $( this ).val();
$range.val( v );
$label.text( v + unit );
} );

$number.after( $label ).after( $range );
} );
} )( jQuery );
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
* Fix: Hide delivery-day, morning and evening surcharges when free shipping applies, including PostNL's minimum-order-amount threshold.
* Fix: Prevent duplicate PostNL delivery options container from appearing during blocks checkout fragment updates.
* Tweak: Improve tax handling so tab prices accurately reflect tax-inclusive and tax-exclusive display settings.
* Add: Independent button width controls (slider) for cart, checkout, and minicart locations in the Checkoutboosters settings.
* Add: Global button corner radius control (slider) in the Checkoutboosters settings.
* Add: Live button preview in the Checkoutboosters settings section that updates in real time as styling options are changed.
* Tweak: Renamed "Fill in with PostNL" settings section to "Checkoutboosters" with updated feature description and activation link.
* Tweak: Updated Fill in With PostNL button label to "Autofill with PostNL" and refreshed the description text shown below the button.
* Tweak: Description text below the Fill in With PostNL button is now displayed at 80% font size and centred on the cart page.
* Tweak: Button border now defaults to none on fresh installations; background colour defaults to PostNL orange.

= 5.9.5 (2026-04-21) =
* Add: Ability to set the default checkout tab (Delivery or Pickup) from the PostNL checkout settings.
Expand Down
4 changes: 2 additions & 2 deletions client/checkout/postnl-fill-in-with/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ export const FillBlock = ( { checkoutExtensionData } ) => {
return null;
}

const title = __( 'Fill in with PostNL', 'postnl-for-woocommerce' );
const title = __( 'Autofill with PostNL', 'postnl-for-woocommerce' );
const description = __(
'Your name and address are automatically filled in via your PostNL account. That saves you from having to fill in the form!',
'Your shipping details are filled in automatically via your PostNL account. That saves time and hassle.',
'postnl-for-woocommerce'
);
const postnl_logo =
Expand Down
26 changes: 16 additions & 10 deletions languages/postnl-for-woocommerce-nl_NL.po
Original file line number Diff line number Diff line change
Expand Up @@ -665,18 +665,24 @@ msgstr "Hoeveelheid moet meer dan 1 zijn"
msgid "Max weight for Mailbox Packet is 2kg!"
msgstr "Het maximale gewicht van een brievenbuspakje is 2kg!"

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:38
#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:61
#: templates/checkout/postnl-fill-in-with-button.php:22
#: templates/checkout/postnl-fill-in-with-button.php:25
#: build/postnl-fill-in-with-frontend.js:1
#: client/checkout/postnl-fill-in-with/block.js:161
msgid "Fill in with PostNL"
msgstr "Invullen Met PostNL"
msgid "Autofill with PostNL"
msgstr "Invullen met PostNL"

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:55
msgid "With this functionality your customers can easily and automatically fill in their shipping address via their PostNL account. This functionality is only available for consumers with a Dutch shipping address. Click the following link to activate the functionality:"
msgstr "Met deze functie kunnen klanten eenvoudig en automatisch hun adresgegevens invullen via hun PostNL account. Deze functie is alleen beschikbaar voor ontvangers met een bezorgadres in Nederland. Klik op de volgende link om de functie te activeren:"
#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:57
msgid "Let customers autofill their shipping address in just a few clicks with their PostNL account. So customers don't have to manually enter their details anymore. Address details are securely prefilled with PostNL, reducing address errors, returns, and checkout drop-off."
msgstr "Laat klanten met een paar klikken al hun bezorgadres automatisch invullen via hun PostNL-account. Zo hoeven klanten niets meer zelf in te voeren. De adresgegevens worden veilig en automatisch ingevuld vanuit PostNL. Dit zorgt voor minder adresfouten, minder retouren en minder afhakers in de checkout."

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:58
msgid "Available for all consumers with a PostNL account and a Dutch or Belgian shipping address."
msgstr "Beschikbaar voor alle consumenten met een PostNL-account en een Nederlands of Belgisch bezorgadres."

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:59
msgid "Activate PostNL autofill via this link:"
msgstr "Activeer Invullen met PostNL via deze link:"

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:67
#: src/Shipping_Method/Settings.php:115
Expand All @@ -692,7 +698,7 @@ msgstr "Activeer"

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:68
msgid "Enable Fill in with PostNL functionality."
msgstr "Activeer Invullen Met PostNL."
msgstr "Activeer Invullen met PostNL."

#: src/Shipping_Method/Fill_In_With_PostNL_Settings.php:75
msgid "Enter your PostNL Client ID from the Digital Business Portal."
Expand Down Expand Up @@ -1490,8 +1496,8 @@ msgstr ""
#: templates/checkout/postnl-fill-in-with-button.php:29
#: build/postnl-fill-in-with-frontend.js:1
#: client/checkout/postnl-fill-in-with/block.js:162
msgid "Your name and address are automatically filled in via your PostNL account. That saves you from having to fill in the form!"
msgstr "Je naam en adres worden automatisch ingevuld via je PostNL-account. Zo hoef je het formulier niet zelf in te vullen!"
msgid "Your shipping details are filled in automatically via your PostNL account. That saves time and hassle."
msgstr "Je bezorggegevens worden automatisch ingevuld via je PostNL-account. Dat scheelt tijd en gedoe."

#. Description of the plugin
#: postnl-for-woocommerce.php
Expand Down
7 changes: 7 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ Follow these instructions (https://www.postnl.nl/Images/aanvragen-api-key-stappe
* Fix: Hide delivery-day, morning and evening surcharges when free shipping applies, including PostNL's minimum-order-amount threshold.
* Fix: Prevent duplicate PostNL delivery options container from appearing during blocks checkout fragment updates.
* Tweak: Improve tax handling so tab prices accurately reflect tax-inclusive and tax-exclusive display settings.
* Add: Independent button width controls (slider) for cart, checkout, and minicart locations in the Checkoutboosters settings.
* Add: Global button corner radius control (slider) in the Checkoutboosters settings.
* Add: Live button preview in the Checkoutboosters settings section that updates in real time as styling options are changed.
* Tweak: Renamed "Fill in with PostNL" settings section to "Checkoutboosters" with updated feature description and activation link.
* Tweak: Updated Fill in With PostNL button label to "Autofill with PostNL" and refreshed the description text shown below the button.
* Tweak: Description text below the Fill in With PostNL button is now displayed at 80% font size and centred on the cart page.
* Tweak: Button border now defaults to none on fresh installations; background colour defaults to PostNL orange.

= 5.9.5 (2026-04-21) =
* Add: Ability to set the default checkout tab (Delivery or Pickup) from the PostNL checkout settings.
Expand Down
12 changes: 11 additions & 1 deletion src/Frontend/Fill_In_With_Postnl.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,23 @@ public function add_custom_css(): void {
return;
}

$border = sanitize_text_field( get_option( 'postnl_button_border', '1px solid #000000' ) );
$border = sanitize_text_field( get_option( 'postnl_button_border', 'none' ) );
$alignment = sanitize_text_field( get_option( 'postnl_button_alignment', 'left' ) );
$custom_css = wp_strip_all_tags( get_option( 'postnl_custom_css', '' ) );
$background_color = sanitize_hex_color( get_option( 'postnl_button_background_color', '#ff6200' ) );
$hover_background_color = sanitize_hex_color( get_option( 'postnl_button_hover_background_color', '#e55500' ) );
$border_radius = absint( get_option( 'postnl_button_border_radius', '4' ) );
$cart_width = absint( get_option( 'postnl_cart_button_width', '100' ) );
$checkout_width = absint( get_option( 'postnl_checkout_button_width', '100' ) );
$minicart_width = absint( get_option( 'postnl_minicart_button_width', '100' ) );

$css = '';

// Dynamic CSS for the PostNL button.
$css .= '#postnl-login-button {';
$css .= 'background-color: ' . $background_color . ';';
$css .= 'border: ' . $border . ';';
$css .= 'border-radius: ' . $border_radius . 'px;';
if ( 'center' === $alignment ) {
$css .= 'display: block; margin-left: auto; margin-right: auto;';
} elseif ( 'right' === $alignment ) {
Expand All @@ -126,6 +131,11 @@ public function add_custom_css(): void {
$css .= 'background-color: ' . $hover_background_color . ';';
$css .= '}';

// Per-context button widths.
$css .= '.postnl-button-in-cart #postnl-login-button { width: ' . $cart_width . '%; }';
$css .= '.postnl-button-in-checkout #postnl-login-button { width: ' . $checkout_width . '%; }';
$css .= '.postnl-button-in-minicart #postnl-login-button { width: ' . $minicart_width . '%; }';

// Append custom CSS from the textarea field.
if ( ! empty( $custom_css ) ) {
$css .= wp_strip_all_tags( $custom_css );
Expand Down
Loading