#2600 e-madencilik register error

This commit is contained in:
Diatrex 2020-11-06 15:02:20 +03:00
parent 0956c22ad3
commit 02e10a5833
5 changed files with 63 additions and 49 deletions

View File

@ -28,21 +28,23 @@
{% include 'visiosoft.theme.base::addons/anomaly/users-module/partials/register-form' %}
<div class="col-12">
{{ form.fields.accept_terms|raw }}
</div>
{% if setting_value('visiosoft.module.profile::show_checkbox_terms_on_register') %}
<div class="col-12">
{{ form.fields.accept_terms|raw }}
</div>
<div class="col-12">
{{ form.fields.accept_protection_law|raw }}
</div>
<div class="col-12">
{{ form.fields.accept_protection_law|raw }}
</div>
<div class="col-12">
{{ form.fields.accept_privacy_terms|raw }}
</div>
<div class="col-12">
{{ form.fields.accept_privacy_terms|raw }}
</div>
<div class="col-12">
{{ form.fields.receive_sms_emails|raw }}
</div>
<div class="col-12">
{{ form.fields.receive_sms_emails|raw }}
</div>
{% endif %}
<div class="col-12 row m-0">
<div class="col-6 pr-0 pl-1">

View File

@ -7,7 +7,7 @@ return [
'general_setting' => [
'title' => 'visiosoft.module.profile::section.general_setting',
'fields' => [
'show_my_ads', 'upload_avatar', 'show_tax_office'
'show_my_ads', 'upload_avatar', 'show_tax_office', 'show_checkbox_terms_on_register'
],
],
'recaptcha' => [

View File

@ -34,4 +34,11 @@ return [
"max" => 1.0,
]
],
'show_checkbox_terms_on_register' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
];

View File

@ -10,6 +10,10 @@ return [
'show_tax_office' => [
'name' => 'Show Tax Office Field',
],
'show_checkbox_terms_on_register' => [
'name' => 'Show Checkbox Terms on Register',
'instructions' => 'Show the "Accept term", "protection law", "privacy term", "sms & emails" on the register form'
],
'google_captcha_site_key' => [
'name' => 'Google Captcha Site Key',
],

View File

@ -32,6 +32,43 @@ class Register2FormFields
];
}
if (setting_value('visiosoft.module.profile::show_checkbox_terms_on_register')) {
$register = array_merge($register, [
"accept_terms" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_terms_label',
]
],
"accept_protection_law" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_protection_law_label',
]
],
"accept_privacy_terms" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_privacy_terms_label',
]
],
"receive_sms_emails" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.receive_sms_emails_label',
]
],
]);
}
$builder->setFields(
array_merge(
$register,
@ -66,42 +103,6 @@ class Register2FormFields
'password' => [
'instructions' => false,
],
"accept_terms" => [
"type" => "anomaly.field_type.boolean",
"required" => true,
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_terms_label',
]
],
"accept_protection_law" => [
"type" => "anomaly.field_type.boolean",
"required" => true,
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_protection_law_label',
]
],
"accept_privacy_terms" => [
"type" => "anomaly.field_type.boolean",
"required" => true,
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.accept_privacy_terms_label',
]
],
"receive_sms_emails" => [
"type" => "anomaly.field_type.boolean",
"required" => true,
"config" => [
"default_value" => false,
"mode" => "checkbox",
"label" => 'visiosoft.module.profile::field.receive_sms_emails_label',
]
],
]
)
);