OC 3.0.3.8
Thanks
Choose what?ahmedattiawd wrote: ↑Tue Aug 02, 2022 11:31 amI need new customer choose between mobile or email when register
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
That would require a larger extension to accomplish this. However, if you're looking for something specific with your registration methods, you could always create a new service request in the Commercial Support section of the forum to get this done as a custom job or use an extension from the Marketplace if you can find one that suits the needs.ahmedattiawd wrote: ↑Tue Aug 02, 2022 9:50 pmUser can choose one of them enter email or mobile number when registration - Not required both.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
As @straightlight has said above, it would be quite a lot of work to change all of OpenCart so it works without an email address so if you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.ahmedattiawd wrote: ↑Tue Aug 02, 2022 9:50 pmUser can choose one of them enter email or mobile number when registration - Not required both.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
You can find simple form validation all over the internet. This may not be the "proper" way to do it and if you upgrade you will lose this but this is your shop, you can mess with the code however you want. This can be done more elegantly like having text reveal itself in a <div> instead of a pop up alert, but I did this in 10 min and it's been a while since I messed with javascript. Check back with me in a week or so I'll give you an ocmod so you wont lose it in an upgrade if you really need it. Good luck on your OC journey, you'll need it lol.
Only thing, I don't know if this interferes with the actual registration function...it shouldn't...but if it does, then it isn't simple and go pay someone lol.
I put the validation in the policy agreement checkbox. I didn't run it through rigorous tests, but it should be correct.
In catalog/view/theme/default/template/account/register.twig
Change:
Code: Select all
[quote]<form action="{{ action }}" method="post" enctype="multipart/form-data" class="register-form form-horizontal">[/quote]
Code: Select all
[quote]<form action="{{ action }}" method="post" enctype="multipart/form-data" class="register-form form-horizontal" name="validaate">[/quote]
Code: Select all
<input id="input-agree" type="checkbox" name="agree" value="1" />
Code: Select all
<input id="input-agree" type="checkbox" name="agree" value="1" onclick="myFunction()" />
Code: Select all
<script type="text/javascript">
function myFunction() {
alert("Javascript is working!");
var testing1 = document.forms["validate"]["telephone"].value;
var testing2 = document.forms["validate"]["email"].value;
if ((testing1 == "") && (testing2 == "")) {
alert("Fill in telephone OR email!");
return false;
}
};
</script>
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
straightlight wrote: ↑Thu Aug 04, 2022 7:32 amNow that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.
Joe1234 wrote: ↑Fri Aug 05, 2022 9:39 pmDon't go around paying people to help you with simple things. Just wait a few days and you may get some help. Don't get overwhelmed by OC, remember it all breaks down to php, javascript, and simple "old school" html with one page edits for easy things like this....I guess the twist is figuring out what is simple despite people telling you different.
You can find simple form validation all over the internet. This may not be the "proper" way to do it and if you upgrade you will lose this but this is your shop, you can mess with the code however you want. This can be done more elegantly like having text reveal itself in a <div> instead of a pop up alert, but I did this in 10 min and it's been a while since I messed with javascript. Check back with me in a week or so I'll give you an ocmod so you wont lose it in an upgrade if you really need it. Good luck on your OC journey, you'll need it lol.
Only thing, I don't know if this interferes with the actual registration function...it shouldn't...but if it does, then it isn't simple and go pay someone lol.
I put the validation in the policy agreement checkbox. I didn't run it through rigorous tests, but it should be correct.
In catalog/view/theme/default/template/account/register.twig
Change:To:Code: Select all
[quote]<form action="{{ action }}" method="post" enctype="multipart/form-data" class="register-form form-horizontal">[/quote]
Change:Code: Select all
[quote]<form action="{{ action }}" method="post" enctype="multipart/form-data" class="register-form form-horizontal" name="validaate">[/quote]
To:Code: Select all
<input id="input-agree" type="checkbox" name="agree" value="1" />
Put this at the bottom of your registration page.Code: Select all
<input id="input-agree" type="checkbox" name="agree" value="1" onclick="myFunction()" />
Code: Select all
<script type="text/javascript"> function myFunction() { alert("Javascript is working!"); var testing1 = document.forms["validate"]["telephone"].value; var testing2 = document.forms["validate"]["email"].value; if ((testing1 == "") && (testing2 == "")) { alert("Fill in telephone OR email!"); return false; } }; </script>
Typo on validate.<form action="{{ action }}" method="post" enctype="multipart/form-data" class="register-form form-horizontal" name="validaate">
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Attachments
Screenshot 2022-08-15 020618.png (56.36 KiB) Viewed 1114 times
Screenshot 2022-08-15 020150.png (42.39 KiB) Viewed 1114 times
Users browsing this forum: niagato, Semrush [Bot] and 642 guests