开发者 |
webdados
ptwooplugins |
---|---|
更新时间 | 2024年10月8日 16:37 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv3 |
版权网址: | 版权信息 |
Classic checkout - Add this to your theme’s functions.php file or code snippets plugin:
add_filter( 'woocommerce_nif_field_required', '__return_true' );
Blocks checkout - Activate the "Required" option on the NIF block.
Yes, it is!
Classic checkout - Add this to your theme’s functions.php file or code snippets plugin:
add_filter( 'woocommerce_nif_field_validate', '__return_true' );
Blocks checkout - Activate the "Validate" option on the NIF block.
We only recommend validating the NIF if your shop only sells to Portugal.
Classic checkout - Add this to your theme’s functions.php file or code snippets plugin:
add_filter( 'woocommerce_nif_field_priority', function( $priority) { // Default is 120 - Adjust the number to move the field up (lower number) or down (higher number) return 120; } );
Blocks checkout - For now, the block is fixed after the billing address and before the shipping options. We’re working on making it possible to move the block where you want.
Future instructions for the Block checkout - Move the NIF block up or down as wanted. We do not recommend moving this field above the billing and shipping addresses, as its visibility may depend on the chosen country.
First of all, it’s the website owner’s responsibility to make your whole website compliant because no personal details whatsoever are transmitted to us, the plugin developers. Anyway, we can help you by documenting how this plugin handles the collected data:
This is a free plugin. It’s our way of giving back to the wonderful WordPress community. There’s a support tab on the top of this page, where you can ask the community for help. We’ll try to keep an eye on the forums but we cannot promise to answer support tickets. If you reach us by email or any other direct contact means, we’ll assume you need, premium, and of course, paid-for support.
You can report any security bugs found in the source code of this plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.
woocommerce_nif_invalid_message
filter to change the invalid Portuguese NIF/NIPC message on checkoutRequires Plugins
tag to woocommerce
woocommerce_nif_field_validate
filter to validate the Portuguese NIFwoocommerce_nif_field_validate
filter, the field will be set as invalid om the checkout form when the validation is performed and failsis_checkout
function exists before calling itorders
and customers
endpointswoocommerce_nif_field_validate
was set to true and the customer doesn’t have a country associated yetWC tested up
tagRequires at least
tagWC tested up
tagRequires at least
tagWC()->customer->get_billing_country()
instead of WC()->customer->get_country()
on WooCommerce 3.0 and abovewoocommerce_nif_use_javascript
filterwoocommerce_nif_show_all_countries
to show the field for all countries instead of only to portuguese customers (not recommended)woocommerce_nif_use_javascript
filter) - this will probably be default on a later version, after heavy user testingTested up to
and WC tested up to
tagslang
folder (the translations are now managed on WordPress.org’s GlotPress tool and will be automatically downloaded from there)WC tested up to
tag on the plugin main fileTested up to
tagwoocommerce_nif_field_validate
filter)autocomplete
parameter set to 'on'priority
parameter set to '120'maxlength
parameter set to '9'label
, placeholder
, required
, class
, clear
, autocomplete
and maxlength
parameters (check filters_examples.php)Tested up to
tagTested up to
and Requires at least
tags