Essa tag é usada em conjunto com a tag MM_Form. Ela gera campos de formulário com os quais o usuário pode interagir para inserir dados.
Atributos
Os tipos de campos disponíveis e outros atributos variam de acordo com o tipo de formulário pai. Este artigo trata dos atributos e exemplos de uso do tipo de formulário Checkout.
checkout
tipo (opcional) – Indicates the type of form field to create. Acceptable values are input, hidden, custom or custom-hidden. The default value is ‘input’.
entrada– Form fields of type ‘input’ output a standard HTML form element that the user can interact with to enter in information. Based on the value ‘name’ attribute MemberMouse will render the appropriate HTML form element.
For example, a dropdown will be rendered for selecting a Country and an input field will be rendered for entering in their first name. The ‘name’ attribute is required for input form fields.oculto– Form fields of type ‘hidden’ output a hidden HTML element which indicates to MemberMouse that the ‘name’ associated with this form field can be ignored when validating the form.
For example, when purchasing a product, billing address is required by default so MemberMouse won’t allow the user to proceed until a billing address has been provided. By using a form field of type hidden for billing address, you’re instructing MemberMouse to allow the form to be submitted without providing a billing address. This is useful when you want to provide a minimal checkout form in cases where you don’t require certain information. The ‘name’ attribute is required for hidden form fields. The ‘value’ attribute is optional.personalizado– Form fields of type ‘custom’ output an HTML form element that the user can interact with to enter in information associated with custom fields you’ve configured in MemberMouse. The ‘id’ attribute is required for custom form fields. The ‘isRequired’ attribute is optional.oculto personalizado– Form fields of type ‘custom-hidden’ output a hidden HTML form element that stores data associated with custom fields you’ve configured in MemberMouse. The ‘id’ attribute is required for custom form fields. The ‘isRequired’ attribute is optional.
Hidden custom fields are perfect for storing information related to the order that the user doesn’t enter.
For example, you could track the ad name they came from, which keyword they used to find your product, etc. All you need to do is pass a querystring parameter to the page in the following format: ‘cf_{ID}’ where ‘{ID}’ is replaced by the ID of the custom field.
Here’s an example: http://mysite.com/checkout?cf_1=banner-1&cf_2=marketing. In this example, we’re passing ‘banner-1’ as the value for the custom field with ID 1 and ‘marketing’ as the value for the custom field with ID 2.nome(condicional com base no tipo de campo) – This field is required for ‘input’ and ‘hidden’ field types. It indicates what data is being collected in the field.
Abaixo está uma tabela de valores aceitáveis.
If a field is optional this means you don’t have to include it in the form. If it’s required, you have to include it in the form, but in a number of cases you can hide required fields from being seen by setting the type to hidden.
Certain names are valid for both ‘input’ and ‘hidden’ field types while others are valid just for ‘input’ fields.
| Valor | Descrição | Opcional | Tipos de campos válidos |
firstName | Collects the user’s first name | Não | entrada, oculto |
lastName | Collects the user’s last name | Não | entrada, oculto |
e-mail | Collects the user’s email address | Não | entrada |
confirmação de e-mail | Força o usuário a confirmar seu endereço de e-mail | Sim | entrada |
nome de usuário | Collects the user’s username | Sim | entrada |
telefone | Collects the user’s phone number | Não | entrada, oculto |
senha | Collects the user’s password | Não | entrada, oculto |
captcha | Força o usuário a preencher um campo captcha para validação | Sim | entrada |
billingAddress | Collects the user’s billing address | Não | entrada, oculto |
billingCity | Collects the user’s billing city | Não | entrada, oculto |
estado do faturamento | Collects the user’s billing state | Não | entrada, oculto |
billingZipCode | Collects the user’s billing zip code | Não | entrada, oculto |
billingCountry | Collects the user’s billing country | Não | entrada, oculto |
shippingAddress | Collects the user’s shipping address | Não | entrada, oculto |
shippingCity | Collects the user’s shipping city | Não | entrada, oculto |
estado da remessa | Collects the user’s shipping state | Não | entrada, oculto |
shippingZipCode | Collects the user’s shipping zip code | Não | entrada, oculto |
shippingCountry | Collects the user’s shipping country | Não | entrada, oculto |
shippingMethod | Coleta o método de envio que o usuário deseja usar | Não | entrada, oculto |
shippingSameAsBilling | Outputs a checkbox the user can click to indicate whether or not they want to provide a shipping address that’s different from their billing address. | Não | entrada |
ccNúmero | Collects the user’s credit card number | Não | entrada |
ccData de expiração | Collects the expiration date associated with the user’s credit card number | Não | entrada |
ccSecurityCode | Collects the security code associated with the user’s credit card number | Não | entrada |
código do cupom | Coleta o código de cupom que o usuário deseja aplicar ao pedido | Sim | entrada |
presente | Gera uma caixa de seleção que o usuário pode clicar para indicar se o produto que está sendo comprado é um presente. | Sim | entrada |
classe(condicional com base no tipo de campo) – This field is optional for ‘input’ and ‘custom’ fields. It indicates the CSS class that should be used for the field.valor(condicional com base no tipo de campo) – This field is optional for ‘hidden’ fields. It specifies the default data to set for the field specified in the ‘name’ attribute.id(condicional com base no tipo de campo) – This field is required for ‘custom’ and ‘custom-hidden’ fields. It specifies the ID of the custom field to collect data for.isRequired(condicional com base no tipo de campo) – This field is optional for ‘custom’ and ‘custom-hidden’ fields. It indicates whether the custom field should be required. Acceptable values are ‘true’ and ‘false’. The default value is ‘false’. This attribute can also be use on ‘input’ fields that can be hidden. This includes firstName, lastName, phone, password, billingAddress, billingCity, billingState, billingZipCode, billingCountry, shippingAddress, shippingCity, shippingState,shippingZipCode.padrão(condicional com base no nome do campo) – This field is optional when the ‘name’ is set to ‘shippingMethod’. Here you can specify the key of the shipping method to use as the default. Read this article to Saiba como pesquisar a chave do método de envio.customAttributes(condicional com base no tipo de campo) – This field is optional for ‘input’ fields. This attribute can be used to add additional HTML attributes to the HTML input field generated by MemberMouse. Whatever is set in this attribute will be added to the HTML verbatim. For example, if you do the following:
[MM_Form_Field type='input' name='firstName' customAttributes='placeholder="First Name"']
O seguinte HTML será gerado:
<input type="text" id="mm_field_first_name" name="mm_field_first_name" class="mm-textField" placeholder="First Name">
Exemplo de uso completo
[MM_Form type='checkout']
Campos de entrada:
Primeiro nome: [MM_Form_Field type='input' name='firstName']
Last Name (Sobrenome): [MM_Form_Field type='input' name='lastName']
Campos ocultos:
[MM_Form_Field type='hidden' name='billingAddress']
[MM_Form_Field type='hidden' name='billingCity']
[MM_Form_Field type='hidden' name='billingState' value='TX']
[MM_Form_Field type='hidden' name='billingCountry' value='US']
Campos personalizados:
Birthday (Aniversário): [MM_Form_Field type='custom' id='1' isRequired='true']
Altura: [MM_Form_Field type='custom' id='3' isRequired='false']
Campo personalizado oculto:
[MM_Form_Field type='custom-hidden' id='5']
...outras SmartTags de formulário...
[/MM_Form]

