registrobr / whmcs-registrobr-epp

WHMCS Registrar Module for interfacing to Registro.br EPP
GNU General Public License v3.0
41 stars 21 forks source link

2 additional fields required, only 1 should #81

Closed rubenskuhl closed 1 year ago

rubenskuhl commented 1 year ago

Additional fields currently requires 2 additional fields, 1 for CPF and 1 for CNPJ, but only one of those should be required. @brunoferreiralkn , one option is to only require 1 and detect whether it's a CPF or CNPJ.

brunoferreiralkn commented 1 year ago

It would be a great shortcut for the installation. But I see the module already has it implemented: https://github.com/registrobr/whmcs-registrobr-epp/blob/f798b843ffae738c95074d03fbe9d9dab3c713e2/whmcs/modules/registrars/registrobr/registrobr.php#L374-L392

Am I wrong?

rubenskuhl commented 1 year ago

At least in my test environment it's showing two fields to fill in and requiring both...

brunoferreiralkn commented 1 year ago

Here in my test environment and in production we have only one field appearing. We followed the module documentation about the additional fields in this was the result.

rubenskuhl commented 1 year ago

Perhaps this is dependent on theme being used. Which theme are you testing with ?

rubenskuhl commented 1 year ago
Captura de Tela 2023-05-06 às 12 37 09

This is what happens. Two additional fields appear, one called "Register number" and the other called "CPF ou CNPJ".

rubenskuhl commented 1 year ago

Gotcha. "Register Number" comes with WHMCS 8.7.2 (perhaps other versions). To remove it, this has to be added:

$additionaldomainfields[".com.br"][] = array( "Name" => "Register Number", "Remove" => true, );

I will do a rewrite of additionalfields.php to include other TLDs and remove repetitions, adding this for all .br TLDs.

rubenskuhl commented 1 year ago

Fixed in f14a483e016f8ca4252d52f7c9aef4542ac35c65