krionix Posted June 19, 2003 Posted June 19, 2003 Hi :D When new user wants to register @ catalog/create_account.php He can enter Company Details -> Company Name, and only this in this section. Here in Poland when he wants to receive special tax bill (invoice) he must tell me his ?NIP? number so I can send him invoice by ordinary mail. What I ask You: can you make a contribution for all Polish people using osC to support NIP ? I'am a php lame :( I?d like to add inside create_account.php , Company Details -> Company NIP Number filed (near to company name), but I don?t know how to do that ;( ? This number must be stored in MySQL, just a new filed for those customers who want receive invoice in the future. This filed is not compulsory for people without own company. When someone during registering will enter his NIP It would be a good idea to validate It, I have found php code for this: <?php # returns 1 when NIP is OK ! function check_nip($nip) { // tworzenie tablicy wag $steps = array(6, 5, 7, 2, 3, 4, 5, 6, 7); // wycinanie zbędnych znak?w z numeru, remove useless signs $nip = str_replace('-', '', $nip); $nip = str_replace(' ', '', $nip); if (strlen($nip) != 10) return 0; // tworzenie sumy iloczyn?w for ($x = 0; $x < 9; $x++) $sum_nb += $steps[$x] * $nip[$x]; $sum_m = $sum_nb % 11; if ($sum_m == $nip[9]) return 1; return 0; } // how to use that, example: if (check_nip('768-000-24-66')) echo 'NIP is correct '; ?> After customer made his order I?d like to see his NIP in admin/orders.php The most difficult task for me is to add NIP form filed and validate it and Write to mysql as OsC makes with name, phone, city etc.. Support for different languages will be a good step. It is not urgent but if someone knows.. I have next question: How to add in catalog/checkout_shipping.php near ?Add Comments About Your Order? A <input type="checkbox"> saying ?I want to receive invoice by ordinary mail? ? When customer will tick this input data will be written in Mysql and I will see in admin/orders.php that John Doe with NIP 222222, bought a product ?.. and wants to receive invoice. It would be a great help. Can someone please help me ? I appreciate all help , thank you. Best regards, Krzysztof, Poland. P.s I made country pull down menu @ create_account.php show Poland by default, but State/Province: filed is a ordinary <input?> filed, if I enter a false province, php validate Will return error and show pull down menu with all provinces in Poland to choose from, how can I make by default OsC to show pull down menu with all provinces (stored in MYSQL) by default, not only when the entered province is wrong (just to make customer life easier) ? The input province should stay for people outside Poland. Excuse my english ;)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.