Post by mobilserv.ro » Fri Nov 27, 2015 2:50 am

I have OpenCart 1.5.6 .4
My website is for unlock phones, and IMEI option from product page is requiered , but i want an IMEI validation.
When a customer add to cart first to check IMEI and if IMEI is right to continue, else
if IMEI is not valid to display a pop-up message that contains explanations.

I have php function to check IMEI but i dont know how to integrate .

<?php function validate_imei($imei) { if (!preg_match('/^[0-9]{15}$/', $imei)) return false; $sum = 0; for ($i = 0; $i < 14; $i++) { $num = $imei[$i]; if (($i % 2) != 0) { $num = $imei[$i] * 2; if ($num > 9) { $num = (string) $num; $num = $num[0] + $num[1]; } } $sum += $num; } if ((($sum + $imei[14]) % 10) != 0) return false; return true; } ?>

Please help.

Newbie

Posts

Joined
Fri Nov 27, 2015 2:40 am

Post by OSWorX » Sat Nov 28, 2015 5:04 pm

That is quite easy to embedd.
If you contact me by email, I can add it.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 4 guests