{"id":299,"date":"2025-10-02T14:29:57","date_gmt":"2025-10-02T10:59:57","guid":{"rendered":"https:\/\/mahroo.net\/customer-register\/"},"modified":"2025-10-04T14:32:47","modified_gmt":"2025-10-04T11:02:47","slug":"customer-register","status":"publish","type":"page","link":"https:\/\/mahroo.net\/en\/customer-register\/","title":{"rendered":"\u062b\u0628\u062a \u0646\u0627\u0645 \u0645\u0634\u062a\u0631\u06cc"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"299\" class=\"elementor elementor-299\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5d921ce9 e-flex e-con-boxed e-con e-parent\" data-id=\"5d921ce9\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-28542ee6 elementor-widget elementor-widget-text-editor\" data-id=\"28542ee6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<div class=\"nn-container nn-my-5\">\n<div class=\"nn-p-4 nn-login-form\">\n<div class=\"nn-text-center nn-mb-4\">\n<h2 class=\"nn-text-primary\">Registration<\/h2>\n<\/p><\/div>\n<form id=\"customer-register-form\" action=\"\">\n<div id=\"nn-step1\" class=\"nn-step\">\n<div class=\"nn-mb-3\">\n                            <label for=\"name\" class=\"nn-form-label\">Name<\/label><\/p>\n<div class=\"nn-input-group\">\n                                <input type=\"text\" class=\"nn-form-control\" id=\"name\" name=\"name\" required>\n                            <\/div>\n<\/p><\/div>\n<div class=\"nn-mb-3\">\n                            <label for=\"national_id\" class=\"nn-form-label\">National code<\/label><\/p>\n<div class=\"nn-input-group\">\n                                <input type=\"text\" class=\"nn-form-control\" id=\"national_id\" name=\"national_id\" required>\n                            <\/div>\n<\/p><\/div>\n<div class=\"nn-mb-3\">\n                            <label for=\"mobile\" class=\"nn-form-label\">Phone number<\/label><\/p>\n<div class=\"nn-input-group\">\n                                <input dir=\"ltr\" type=\"text\" class=\"nn-form-control\" id=\"mobile\" name=\"mobile\" placeholder=\"091212345678\" required pattern=\"\\d{11}\" title=\"\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0628\u0627\u06cc\u062f \u06f1\u06f1 \u0631\u0642\u0645 \u0628\u0627\u0634\u062f\">\n                            <\/div>\n<\/p><\/div>\n<p>                        <button type=\"button\" id=\"send-code-btn\" class=\"nn-btn nn-btn-primary\">Send verification code<\/button><\/p>\n<div id=\"nn-send-message\" class=\"nn-text-success nn-mt-3\" style=\"display:none;\"><\/div>\n<\/p><\/div>\n<div id=\"nn-step2\" class=\"nn-step\" style=\"display:none;\">\n<div class=\"nn-mb-3\">\n                            <label for=\"verification_code\" class=\"nn-form-label\">\u06a9\u062f \u062a\u0623\u06cc\u06cc\u062f (\u0645\u0639\u062a\u0628\u0631 \u062a\u0627 \u06f2 \u062f\u0642\u06cc\u0642\u0647)<\/label><\/p>\n<div class=\"nn-input-group\">\n                                <input type=\"text\" class=\"nn-form-control\" id=\"verification_code\" name=\"verification_code\" required maxlength=\"6\">\n                            <\/div>\n<\/p><\/div>\n<div id=\"nn-timer\" class=\"nn-text-info nn-mb-3\">Remaining time: <span id=\"countdown\">02:00<\/span><\/div>\n<p>                        <button type=\"button\" id=\"back-btn\" class=\"nn-btn nn-btn-outline-secondary\">\u0628\u0627\u0632\u06af\u0634\u062a \u0648 \u062a\u063a\u06cc\u06cc\u0631 \u0634\u0645\u0627\u0631\u0647<\/button><br \/>\n                        <button type=\"button\" id=\"register-btn\" class=\"nn-btn nn-btn-primary\">Registration<\/button>\n                    <\/div>\n<\/p><input type=\"hidden\" name=\"trp-form-language\" value=\"en\"\/><\/form>\n<div class=\"nn-text-center nn-mt-3\">\n<p><a href=\"https:\/\/mahroo.net\/en\/customer-dashboard\/\" class=\"nn-website-link\">Return to login<\/a><\/p>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<p>        <script>\n        jQuery(document).ready(function($) {\n            var sendNonce = 'fd3918436e';\n            var verifyNonce = '7556861de2';\n            var countdownInterval;\n            var lastMobile = '';<\/p>\n<p>            function startCountdown() {\n                var timeLeft = 120; \n                clearInterval(countdownInterval);\n                $('#countdown').text('02:00');\n                countdownInterval = setInterval(function() {\n                    timeLeft--;\n                    var minutes = Math.floor(timeLeft \/ 60);\n                    var seconds = timeLeft % 60;\n                    $('#countdown').text((minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds);\n                    if (timeLeft <= 0) {\n                        clearInterval(countdownInterval);\n                        $('#send-code-btn').prop('disabled', false);\n                        $('#nn-send-message').hide();\n                    }\n                }, 1000);\n            }\n\n            $('#send-code-btn').on('click', function() {\n                var mobile = $('#mobile').val();\n                var national_id = $('#national_id').val();\n                var name = $('#name').val();\n                if (!\/^\\d{11}$\/.test(mobile)) {\n                    Swal.fire({\n                        icon: 'error',\n                        title: '\u062e\u0637\u0627',\n                        text: '\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0646\u0627\u0645\u0639\u062a\u0628\u0631 \u0627\u0633\u062a',\n                        confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                    });\n                    return;\n                }\n                if (!national_id) {\n                    Swal.fire({\n                        icon: 'error',\n                        title: '\u062e\u0637\u0627',\n                        text: '\u0644\u0637\u0641\u0627 \u06a9\u062f \u0645\u0644\u06cc \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f',\n                        confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                    });\n                    return;\n                }\n                if (!name) {\n                    Swal.fire({\n                        icon: 'error',\n                        title: '\u062e\u0637\u0627',\n                        text: '\u0644\u0637\u0641\u0627 \u0646\u0627\u0645 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f',\n                        confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                    });\n                    return;\n                }\n                $.ajax({\n                    url: 'https:\/\/mahroo.net\/wp-admin\/admin-ajax.php',\n                    type: 'POST',\n                    data: {\n                        action: 'send_verification_code',\n                        mobile: mobile,\n                        national_id: national_id,\n                        name: name,\n                        nonce: sendNonce\n                    },\n                    success: function(response) {\n                        if (response.success) {\n                            lastMobile = mobile;\n                            $('#nn-step1').hide();\n                            $('#nn-step2').show();\n                            $('#send-code-btn').prop('disabled', true);\n                            $('#nn-send-message').text('\u06a9\u062f \u062a\u0623\u06cc\u06cc\u062f \u0627\u0631\u0633\u0627\u0644 \u0634\u062f').show();\n                            startCountdown();\n                        } else {\n                            Swal.fire({\n                                icon: 'error',\n                                title: '\u062e\u0637\u0627',\n                                text: response.data,\n                                confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                            });\n                        }\n                    },\n                    error: function() {\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u062e\u0637\u0627',\n                            text: '\u062e\u0637\u0627 \u062f\u0631 \u0627\u0631\u0633\u0627\u0644 \u062f\u0631\u062e\u0648\u0627\u0633\u062a',\n                            confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                        });\n                    }\n                });\n            });\n\n            $('#back-btn').on('click', function() {\n                $('#nn-step2').hide();\n                $('#nn-step1').show();\n                $('#nn-send-message').hide();\n                clearInterval(countdownInterval);\n                $('#send-code-btn').prop('disabled', false);\n            });\n\n            $('#register-btn').on('click', function() {\n                var national_id = $('#national_id').val();\n                var mobile = $('#mobile').val();\n                var name = $('#name').val();\n                var verification_code = $('#verification_code').val();\n                if (!national_id || !mobile || !name || !verification_code) {\n                    Swal.fire({\n                        icon: 'error',\n                        title: '\u062e\u0637\u0627',\n                        text: '\u0644\u0637\u0641\u0627 \u0647\u0645\u0647 \u0641\u06cc\u0644\u062f\u0647\u0627 \u0631\u0627 \u067e\u0631 \u06a9\u0646\u06cc\u062f',\n                        confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                    });\n                    return;\n                }\n                $.ajax({\n                    url: 'https:\/\/mahroo.net\/wp-admin\/admin-ajax.php',\n                    type: 'POST',\n                    data: {\n                        action: 'verify_and_register',\n                        national_id: national_id,\n                        mobile: mobile,\n                        name: name,\n                        verification_code: verification_code,\n                        nonce: verifyNonce\n                    },\n                    success: function(response) {\n                        if (response.success) {\n                            Swal.fire({\n                                icon: 'success',\n                                title: '\u0645\u0648\u0641\u0642\u06cc\u062a',\n                                text: '\u062b\u0628\u062a \u0646\u0627\u0645 \u0628\u0627 \u0645\u0648\u0641\u0642\u06cc\u062a \u0627\u0646\u062c\u0627\u0645 \u0634\u062f',\n                                confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                            }).then(function() {\n                                window.location.reload();\n                            });\n                        } else {\n                            Swal.fire({\n                                icon: 'error',\n                                title: '\u062e\u0637\u0627',\n                                text: response.data,\n                                confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                            });\n                        }\n                    },\n                    error: function() {\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u062e\u0637\u0627',\n                            text: '\u062e\u0637\u0627 \u062f\u0631 \u062b\u0628\u062a \u0646\u0627\u0645',\n                            confirmButtonText: '\u062a\u0623\u06cc\u06cc\u062f'\n                        });\n                    }\n                });\n            });\n        });\n        <\/script>\n        <\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-299","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/pages\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":6,"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/pages\/299\/revisions"}],"predecessor-version":[{"id":424,"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/pages\/299\/revisions\/424"}],"wp:attachment":[{"href":"https:\/\/mahroo.net\/en\/wp-json\/wp\/v2\/media?parent=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}