Search the Community
Showing results for tags 'best practice'.
-
Hello folks, I'm thinking about an update for the Sloppy Words Cleaner Just for those who do not know it: What does this contrib do? Like the title says... cleans up the sloppy inputted words by customers on their registration, edit account etc. I also added a all lowercase for the email strings. explain sloppy input? OK, new customer creates a new account as: JOHN DoEskY 123 noWHERe ave. canton, NY 12345 email: [email protected] this will be cleaned (and stored in your db) and displayed on all invoices/screen info-text as: John Doesky 123 Nowhere Ave. Canton, NY 12345 email: [email protected] I also added exception words (you can add or remove these exception words to your liking!) i.e. "PO" for PO Box 1234 (allowing a capital "O" after the capital "P") "IV" for John Doe IV (instead of John Doe Iv) "RR 2" for Rural Route 2 (instead of Rr 2) Also includes exception arrays for Names like: "Mc" and "Mac", "De la Rosa" etc.: JOHN MACDONALD will get John MacDonald I plan to modularize it for 2.3.4 BS community version and avoid core file changes as much as possible. Now my doubt is to realize this with a header tag ot hook: Hook: + fits in just in the right place on each page to filter the data before saved in the database + no extra database queries - core file changes (hook call) on each page where it should be applied (create_account.php, account_edit.php, checkout_shipping_address.php, checkout_payment_address.php) - additional configuration entries, install function in hook, but uninstall not so smooth (remove hook then set uninstall to "true" etc.) Header Tag: + no core file changes, upload header tag, install, serves for all pages via selectable page list + all configuration entries, custom exception lists etc integrated in header tag module - header tag is called in template_top when data is already written to database -> needs to be used in the next page (create_account_success.php for create_account.php) and read all data again out of database -> apply filter function -> write back into database. Ergo additional queries-> slows down the process. Header tag with javascript filter on the fly? not so happy with it Any opinion or coment very welcome rgds Rainer
- 12 replies
-
- sloppy words cleaner
- hooks
-
(and 2 more)
Tagged with: