| 开发者 | rafacarvalhido |
|---|---|
| 更新时间 | 2026年9月9日 04:21 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/wp-content/plugins/racar-checkout-manager-for-brazilian-stores directory, or install the plugin through the WordPress plugins screen directly.Yes, the plugin is fully compatible with WooCommerce's High-Performance Order Storage (HPOS).
The plugin uses Brazilian CEPs (postal codes) to fetch address data: it calls BrasilAPI first, and uses ViaCEP as a fallback if BrasilAPI does not return a valid address. This data is then used to automatically populate the address fields during checkout.
Yes, you can enable or disable individual fields like CPF, CNPJ, RG, and more from the plugin's settings page.
Yes, the plugin is fully localized and ready for translation into other languages.
Yes, you can enable input masks for fields like CPF, CNPJ, and cellphone to improve the user experience.
Yes, you can disable the autofill feature entirely from the plugin settings (Tab 2: Autofill Addresses). When disabled, no external API calls are made.
No. Uninstall removes plugin options and logs an audit entry when WooCommerce logging is enabled, but user meta (for example billing_cpf) and order meta are preserved so fiscal history and ERP integrations remain intact.
Yes. From 0.6.1 onward, person type is stored on orders and customers as 1 (individual) / 2 (company), matching Brazilian Market on WooCommerce. When checkout ships to the billing address (no separate shipping address), number and neighborhood are mirrored into shipping meta (_shipping_number, _shipping_neighborhood) when those shipping fields would otherwise be empty—matching what many Brazilian carriers expect.
Third-party plugins that read the same meta keys (for example Loggi, Correios Automático Infix, Melhor Envio buyer payloads, Link Nacional improved shipping calculator conventions) continue to work without Brazilian Market installed. Melhor Envio may still show its own admin notice until their plugin explicitly recognizes RaCar—configure shipping fields here regardless.
In Checkout Fields (Tab 1), open a field’s settings (cog) and choose Row layout: Full row (one line), Left column, or Right column. Priority controls vertical order only. On classic checkout this maps to WooCommerce form-row-* classes; on Checkout Block it maps to flex width rules generated by the plugin.
Classic checkout rows often use form-row-first / form-row-last together with theme CSS floats. The plugin keeps those WooCommerce classes but changes which rows are visible (PF/PJ toggles) and interacts with WooCommerce scripts that can reassign row classes when country or locale rules change (the plugin also restores your configured postcode row classes after country_to_state_changing). That can misalign float pairs even though class names match WooCommerce defaults.
In Checkout Fields (Tab 1), enable Classic Checkout Layout (Float Compatibility) → Recover floated checkout columns. It is off by default so normal themes are unaffected; when enabled, it outputs a checkout-only rule (clear: both on form-row-first) with exclusions for wide rows and the plugin’s three-column helpers. Test checkout with your theme after enabling; disable again if anything looks worse.
Use the classic checkout page (shortcode checkout). With the option off, confirm billing/shipping look as before. Turn it on only on stores that showed overlap; recheck billing, shipping, switching PF/PJ (when applicable), and changing country if customers can. Storefront is a good baseline; themes that rely heavily on floats benefit most.
Classic checkout: In Checkout Fields (Tab 1) → Classic Checkout Layout (Float Compatibility), enable Preserve two-column row layout on small screens (default off). It applies classic shortcode checkout only (not block checkout): under max-width: 768px it restores two-column widths for fields set to Left column / Right column when themes stack everything full width.
Block checkout: Below ~700px container width, WooCommerce and this plugin stack address fields full width by design (better mobile UX). Adjust Row layout on desktop; mobile stacking is expected.
Use this go/no-go checklist after enabling Block checkout support on Tab 1 (test on your store’s block checkout URL):
_wc_billing/rbsmhao/*, _wc_shipping/rbsmhao/*, billing_*, and _billing_* meta on the order.add_filter( 'rbsmhao_disable_blocks_checkout_support', '__return_true' ); — classic checkout and existing orders must remain intact._shipping_phone ) on order emails / My Account / admin (wc_doing_it_wrong); harden LegacyMetaBridge to use WC getters for core address props.account_username / account_password when WooCommerce (or a theme override such as Woodmart) already shows username / password for manual account creation; skip ROAPC required checks for those keys outside checkout so validation still uses WC’s native POST fields.array|false, array|bool) from Blocks registrar/schema helpers that caused a fatal parse error on hosts whose request/CLI PHP is older than 8.0; refuse to boot below PHP 8.0 with an admin notice instead of a white-screen parse error.all_fields_wide to registration_fields_wide (existing installs migrate automatically and keep their saved value); new installs default to on.cpf_login) automatically enables and locks One Account Per CPF/CNPJ (oapc_enabled); sanitization forces oapc_enabled when cpf_login is on.row_layout / priority) on load and save; hide duplicate native address cards under Billing Address (configure them under Shipping Address).get_settings() per request; scope rbsmhao-input-masks to checkout/account screens; add defer strategy to frontend scripts; scope Store API checkout merge hook.plugin_action_links_{basename}; simplify admin tab navigation (no nonce on tab switch).DocumentValidator.WooCommerceBlocksAdapter for WC Blocks internals; PSR-4 autoloader for includes/Checkout/.CheckoutCountryGate (should_apply_brazilian_rules) and propagated to classic checkout, block checkout, locale, persistence, and frontend JS.plugins_loaded (removed the immediate start_all_engines() call that ran before WooCommerce was loaded).plugins_loaded (avoids a nested plugins_loaded hook that never fired).is_*_block_default() fallback); order-pay / thank-you and classic shortcode pages no longer inherit the store block-checkout page.Requires at least raised to 6.5 (.l10n.php translations); WC tested up to raised to 11.0.prompt-bling.txt from the plugin distribution folder (kept in project docs).CheckoutCountryGate to the flagged $_POST line.localhost rule).account_password / account_username in usermeta on registration; remove legacy plaintext password meta when present.wp_kses_post) and escape dynamic labels in checkout notices.prompt-bling.txt out of the plugin folder; shortened long upgrade notices; sanitized $_SERVER reads in block validator; PHPCS ignores aligned.priority values (copied to index on Block checkout). Shipping Address order also updates matching native billing address fields (the Checkout Block shares one address form). Documents, contact, and order notes keep their own order.account_password → password, account_username → username).input-text dimension CSS is not loaded on block checkout.row-gap (same as sibling rows); person type (full) does not insert an extra break before the next Documents row. Person-type/gender select height follows the sibling text-input height.order_comments) display as a full-width textarea. WooCommerce additional checkout fields only support text/select/checkbox, so the native order-note block stays hidden when RaCar manages notes and the Tab 1 field is presented as a textarea while still saving through the additional field.priority values (copied to index on the storefront). Classic Checkout still uses the numeric Priority field.company_as_name is enabled. WooCommerce rejects defaultFields if core first/last name use JSON Schema objects, so those stay booleans; PJ still hides billing names in the browser and server validation still skips them.company_as_name enabled, billing first and last name stop being required when the customer selects PJ (fields are hidden) and become required again on PF. Shipping names are unchanged.billing_number / shipping_number) no longer triggers update_checkout / shipping recalculation (same skip as complement).address_2) no longer triggers update_checkout / shipping recalculation. Number, postcode, city, and state still refresh rates.address_2. Complement (address_2) and number stay independent; number remains in billing_number / shipping_number (and underscore meta).address-form__ selectors.fields map only.address-i18n.js (BR locale inject + restore script after country/locale updates).fields; Checkout Block countryData/defaultFields use block_fields; Store API (/wc/store/) uses block_fields for address validation.block_fields is unchanged.fields vs block_fields); existing stores migrate classic settings into block settings on first load.toastDismissMs in checkout script config, default 5s).form-row-wide / form-row-first / form-row-last on classic checkout.index for correct vertical order; placeholders and required/optional labels follow Tab 1 settings.class values are converted to row_layout automatically (legacy three-column classes map to left column).rbsmhao_disable_blocks_checkout_support), and Brazilian Checkout Toolkit conflict detection; filter rbsmhao_block_checkout_preflight_status for tooling.persontype); CPF/CNPJ already indicate PF/PJ. Field remains on checkout and edit-address forms; REST API unchanged.order_comments) at order location; core order note block hidden when RaCar manages notes._wc_billing/rbsmhao/* meta in admin order display and WooCommerce REST enrichment.woocommerce_register_additional_checkout_field() (WC 8.6+), with billing-only validation, PF/PJ visibility (JS), input masks, and dual-write to legacy billing_* / _billing_* meta for REST and integrations.billing_* / shipping_* data used to build the order), so new customers and account-creation checkouts save CPF, number, neighborhood, etc. to order meta and user meta reliably for REST (Bling) consumption.billing_persontype as 1 / 2 (Brazilian Market contract); checkout UI still uses pf/pj via default_checkout_billing_persontype.shipping_number, _shipping_number, shipping_neighborhood, _shipping_neighborhood) if shipping extras are empty—helps carriers and integrations that only read _shipping_*.address wrapper class so WooCommerce admin CSS no longer forces strong labels to display: block).billing.cpf, billing.cnpj, billing.number, billing.neighborhood, persontype as F/J, etc.) for Bling and similar integrations — no new public endpoints; uses existing WC REST permission checks._billing_* / _shipping_* alongside existing keys for compatibility with legacy Brazilian Market data.account_username and account_password to use WooCommerce account keys (instead of legacy billing_* prefixes), preventing false “required field” errors when those fields are filled on checkout.form-row-first / form-row-last / form-row-wide classes.updated_checkout or window load) to avoid a brief broken layout flash.input event); non-digits (e.g. hyphen from mask or manual typing) are ignored — lookup no longer waits for leaving the postcode field (blur).max-width: 768px, scoped inline CSS restores form-row-first / form-row-last and three-column helper classes when themes stack fields full width; form-row-wide stays full width; form-row-first uses clear: both (with wide / three-col exclusions); checkout labels use font-size: 70% in that mode to reduce row misalignment; block checkout unaffected; FAQ entry addedrbsmhao_force_legacy_global_selectwoo_strip (returns bool, receives settings array): return true to restore the previous site-wide strip behavior on stores that depended on itselect and leave markup inside #billing_country_field / #shipping_country_field .woocommerce-input-wrapper) using scoped display:flex, min-height, and optional select line-height — not a global span.woocommerce-input-wrapper rule (avoids breaking other fields)select.country_to_state / select.country_select and My Account select.country_to_state get native height rules even when the theme drops rbsmhao-select-field on the country rowclear: both on .woocommerce-checkout .woocommerce-shipping-fields so “Ship to a different address?” is not pulled beside floated billing rows (e.g. some Woodmart layouts)Y-m-d prefill before applying dd/mm/aaaa.woocommerce-checkout, rbsmhao-select-field) to reduce cross-theme mismatch!important; styles are now scoped to checkout/plugin context to lower risk of theme conflictsclear: both behavior for form-row-first plus exclusions for wide rows and plugin three-column helper classescountry_to_state row-class changes, and postcode class restore flow)woocommerce_get_country_locale_base and woocommerce_get_country_locale_default hooks (priority 20) in addition to woocommerce_get_country_localeupdate_totals_on_change is appended only when missing), preventing duplicate classes in repeated locale passeswoocommerce_billing_fields / woocommerce_shipping_fields, priority 20) now includes Brazilian extras Number and Neighborhood when enabled in Checkout Fields settings (same visibility rules as checkout via get_active_fields()).woocommerce-account as well as .woocommerce-checkout (registration, edit-address, etc.); Classic Checkout Layout (Float Compatibility) remains checkout-onlyclear: both on form-row-first inside .woocommerce-checkout form.checkout, excluding form-row-wide and three-column helper classes; documented FAQ on PF/PJ visibility, country_to_state, and postcode row class restorerff toggles for account_username and account_password follow WooCommerce Account & Privacy (manual username/password), are read-only in the admin UI with notice + link to WC settings, and are forced on sanitize; updated_option / woocommerce_update_options_account keep rff aligned when those WC options changeaccount_username / account_password (not billing_*)account_username, account_password) — default settings and the checkout reset action now persist enabled/required from WooCommerce Account & Privacy (woocommerce_registration_generate_username, woocommerce_registration_generate_password); first-install activation uses the same default merge base instead of schema-only enabled => falseenabled/required for those account fields diverge (hooks: woocommerce_update_options_account, updated_option on the two registration options above)cpf_login) is available only when WooCommerce Generate account login is enabled; otherwise the toggle is off, read-only, with notice + link to WooCommerce → Settings → Account & Privacy, hidden input forces cpf_login off on save, and sanitization blocks forged POST valueswoocommerce_registration_generate_username → no), cpf_login is persisted off (woocommerce_update_options_account, updated_option); turning WC generation back on unlocks the toggle without auto-enabling the plugin optioncpf_as_username and duplicate-login checks honour the same WooCommerce rule; CNPJ path now respects cpf_login instead of the non-existent cnpj_login keyracar-checkout-manager-uninstall) with the user performing the uninstall (when available) and which plugin options were deleted; requires WooCommerce active and WC logging enabled per store settingsrbsmhao_plugin_uninstalled action so developers can persist an audit trail elsewhere (payload: user_id, user_login, uninstalled_at, options_deleted)RBSMHAO-checkout-frontend-style.css (order notes / additional fields full-width when shipping row float layout breaks)racar/v1/cep/{cep})AND/OR replaced by &&/||)order_comments management in Checkout Fields Tab with controls for enable/disable, label, placeholder, and requiredrff reads in Tab 4 to avoid PHP Undefined array key warnings on partial/legacy settings arraysrff follows persontype, CPF/CNPJ toggles, and company_as_namepersontype is PF and Billing Company is disabled, company_as_name is automatically turned off and rbsmhao_one_cpf_settings[rff][company] is forced to 0 on savefirst_name/last_name when PJ-only + Company as Name is enabledcompany when PF-only + Billing Company is disabledfor/id attributes (fixes DevTools warning: “A <label> isn't associated with a form field”)RBSMHAO-select2.css); Select2 styling remains only on the storefront when the option is enabledRBSMHAO-checkout-fields-frontend-script.js): when #billing_persontype is absent (e.g. PF-only/PJ-only checkout), initialization returns immediately so no MutationObserver is attached (this was the main performance fix; previously every DOM childList mutation still invoked the toggle path and spammed the console). When the field exists, childList updates are coalesced with requestAnimationFrame, and the old debug console.log was removedwp_register_script URL for the checkout frontend script to use the correct filename casing (RBSMHAO-checkout-fields-frontend-script.js) so the asset loads on case-sensitive hosts (separate from the observer/console issue above)account_username, account_password), relocated from the account fieldset into the billing block for layout; visibility follows WooCommerce Account & Privacy settings (manual username/password); admin toggles for enable/required are locked with a link to WC settings; label, placeholder, priority, and CSS classes remain editable.required when registration is mandatory (no guest checkout); when guest checkout is optional they stay optional until “Create an account?” is checked; companion script syncs visibility and required markers (asterisk / validate-required) so users are not shown “optional” for fields that must be filled.