Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    help question Can I re-use Customer Referral and Customer Nick for something else?

    I've always been skeptical to insert extra fields into my DB, I refuse to do it because I don't want the headache of upgrading and having to worry about customizations.

    I've literally modified all plugins to use defines instead of SQL entries. It just avoids complications and allows me to sleep at night.

    That being said

    I noticed that Customers Nick field is, completely useless to me in its original usage, and I'd like to put it to some good use. I want to use the Nick field for customers to be able to put more information about their business. GST Number for example, P.O. Box, Company registration details - anything they want that should appear on the invoice.

    The customers nick, being a 96-character field is looking especially handsome - I want to use it.

    Has anyone managed this? Looking at the code there are some serious issues from what I can see.

    Firstly, it's a required field.

    Secondly, it's tied to MyBB being enabled, which is easily by-passable by simply editing out some if statements here and there.

    My thoughts are, if I was to leave PHP linkage disabled, and then comment out: if ($phpBB->phpBB['installed'] == true) { ### }

    in tpl_modules_create_account.php - would I have to worry about anything being executed on behalf of the nick? I don't want it to execute any of the code pertaining to phpbb - so I assume leaving it disabled would avoid it executing things such as: if ($phpBB && $phpBB->phpBB['installed'] == true) { ### } that's in modules/create_account.php.

    Obviously, I would have to start coding into the order/invoice sections code to echo the nick in a manner I would like.

    And I have no intention of allowing them to edit this information by themselves once they've signed up with it, once they've put it in, it's done. Only I can change it, only I will change it manually, at their request.

    Perhaps there is some other way. I noticed the cc_type, cc_owner and cc_number fields that are practically unique to each order, could perhaps be better than using the nick field. A customer could for example have different companies, giving them the opportunity to re-enter these fields for each order placed. And I understand cc_type,name,number are practically useless now what with PAS and so on? To be honest, I would prefer the customer being able to enter these every time, it would be practical and less of a headache in the long-run.

    Any info would be awesome thanks :)

  2. #2
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Put Customer Referral and Customer Nick to good usage

    I've taken a look at the Checkout Gift Message module.

    I'm thinking of using this module as a boilerplate to insert info into the cc fields. The gift message module uses sessions to store the data during the checkout process. I think this could be ideal.

    Any advice Zen dev team

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Put Customer Referral and Customer Nick to good usage

    Two approaches:

    1. Add new fields for your specific use
    - then the data never clashes with original core code
    - requires a bit of new code to manage inserting and reading data for those fields
    - upgrades are less painful because you simply need to identify your custom code

    2. Re-use existing fields
    - Requires careful study of existing core code to specifically hack out the normal operation and substitute with something else
    - Requires careful treatment during upgrades to once again hack out normal operation to replace it with your customizations ... every time you upgrade
    - Must carefully manage code in plugins to also not clash with original code or mistakenly use the data in those fields for the original purpose for which those fields exist in the first place.

    I usually recommend the first approach since it's less painful down the road, and requires very little study to ensure no clashes with core code, since your fields are only used by you.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Put Customer Referral and Customer Nick to good usage

    Quote Originally Posted by DrByte View Post
    Two approaches:

    1. Add new fields for your specific use
    - then the data never clashes with original core code
    - requires a bit of new code to manage inserting and reading data for those fields
    - upgrades are less painful because you simply need to identify your custom code

    2. Re-use existing fields
    - Requires careful study of existing core code to specifically hack out the normal operation and substitute with something else
    - Requires careful treatment during upgrades to once again hack out normal operation to replace it with your customizations ... every time you upgrade
    - Must carefully manage code in plugins to also not clash with original code or mistakenly use the data in those fields for the original purpose for which those fields exist in the first place.

    I usually recommend the first approach since it's less painful down the road, and requires very little study to ensure no clashes with core code, since your fields are only used by you.

    Thanks DrByte - I did take another look at some of the files and noticed that the cc fields are referenced to quite a bit - so I shall take your advice.

    I'll simply take the gift message module, duplicate and customize accordingly.

    Thanks.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 28 Feb 2016, 12:05 AM
  2. v150 Looking for plugin "buy something, get something else free"
    By kjetilhansen in forum General Questions
    Replies: 2
    Last Post: 7 Sep 2012, 01:35 AM
  3. Customer Referral Tracking discount for the Referee
    By edgecrusher in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 12 Dec 2010, 01:29 AM
  4. Can I remove the need for customer password? and use number instead of email address?
    By xlserret in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Jun 2008, 03:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR