osCmax v2.5 User Manual
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Tax ID REQUIRD -- help!!

This is a discussion on Tax ID REQUIRD -- help!! within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; It looks like the checking code is missing from form_check.js.php in catalog/includes ... there should be a conditional in there ...

      
  1. #11
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: Tax ID REQUIRD -- help!!

    It looks like the checking code is missing from form_check.js.php in catalog/includes ... there should be a conditional in there if the Tax ID and Company are on.

    Something like:
    if (ACCOUNT_COMPANY == 'true') { ?>

    check_input("company", <?php echo ENTRY_COMPANY_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_ERROR; ?>");
    check_input("company_tax_id", <?php echo ENTRY_TAX_ID_MIN_LENGTH; ?>, "<?php echo ENTRY_TAX_ID_ERROR; ?>");

    <?php } ?>
    Then set up the defines for anything that is missing ... If this fixes things - can you post in the bugtracker?

    Regards,
    pgmarshall
    _______________________________

  2. #12
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Tax ID REQUIRD -- help!!

    OK will try that now I was real close I had:
    Code:
    // require company_tax_id
      check_input("company_tax_id", <?php echo ENTRY_COMPANY_TAX_ID_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_TAX_ID_ERROR; ?>");
    But in the case of a beauty professional, they dont always have a "company name" but they should have a license. so can I safely assume:
    Code:
    if (ACCOUNT_COMPANY == 'true') { ?>
    
    check_input("company", <?php echo ENTRY_COMPANY_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_ERROR; ?>");
    check_input("company_tax_id", <?php echo ENTRY_TAX_ID_MIN_LENGTH; ?>, "<?php echo ENTRY_TAX_ID_ERROR; ?>");
    
    <?php } ?>
    would become:

    Code:
    if (COMPANY_TAX_ID == 'true') { ?>
    
    check_input("company_tax_id", <?php echo ENTRY_TAX_ID_MIN_LENGTH; ?>, "<?php echo ENTRY_TAX_ID_ERROR; ?>");
    
    <?php } ?>
    Debbie D
    NY & VA

  3. #13
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Tax ID REQUIRD -- help!!

    OK its not working.. I'm missing somthign basic here I just know it..

    And as a FYI I dont care if the field is forced required anywhere except the create account page, that is where the manufacturer is hounding me to get this done..

    FYI #2 No matter what I do here, when you turn on Company in the Customer Details settings it can still be blank when creating an account. I can absolutely see where it would NOT be required by the average merchant, but in my case and in the case of many different "professional only" items, people need to prove licensure, certification - something - to gain the right to purchase particular items.. They would not necessarily have to own a business or even be an independant contractor to make such a purchase - oh here is a good example - fire arms.. I think.. I dont do fire arms here but the thought process is you need to hold a gun permit to purchase, you dont have to be a business owner or employed by anyone to make the purchase but you must have a verifyable permit - so Company is still not "required", but the tax ID/license number as I am using it, is a must. This field could also double as a age verification I suppose.. I can see lots of uses for it to be required - but again - the average store selling retail products would not need it required.

    FYI #3 while doing some more poking.. I do see in the
    catalog/template/fallback/content/
    and
    catalog/template/compromise/content/
    create_acct.tlp.php
    code that looks like it is checking the tax ID field for being filled in.. (the tep_not_null ??? is that what it is doing??)
    Code:
    <!-- BOF Separate Pricing Per Customer: field for tax id number -->
                  <tr>
                    <td class="main" width="150"><?php echo ENTRY_COMPANY_TAX_ID; ?></td>
                    <td class="main"><?php echo tep_draw_input_field('company_tax_id') . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TAX_ID_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TAX_ID_TEXT . '</span>': ''); ?></td>
                  </tr>
    <!-- EOF Separate Pricing Per Customer: field for tax id number -->
    I am using a custom template but the create account is being pulled from fallback.

    Here is what I have now.. some of it may not be needed, some may be in the wrong place.. I really am unsure.. but I am trying
    /catalog/includes/javascript/form_check.js.php
    Code:
    //BOF fix by pgmarshal require company_tax_id
    <?php if (ACCOUNT_COMPANY == 'true') { ?>
    check_input("company", <?php echo ENTRY_COMPANY_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_ERROR; ?>");
    check_input("company_tax_id", <?php echo ENTRY_COMPANY_TAX_ID_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_TAX_ID_ERROR; ?>");
    <?php } ?> 
    // EOF require company_tax_id
    I changed what you had to COMPANY_TAX_ID because it was everywhere like that

    /catalog/create_account.php
    Code:
    // require company_tax_id
        if (strlen($company_tax_id) < ENTRY_COMPANY_TAX_ID_MIN_LENGTH) {
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_TAX_ID_ERROR);
        }
    catalog/includes/languages/english.php
    Code:
    define('ENTRY_COMPANY_TAX_ID', 'License or Tax-ID number REQUIRED:');
    define('ENTRY_COMPANY_TAX_ID_ERROR', 'License number is required unless you reside in an unlicensed country or state. Please enter your license number or NONE of licensing is not required.');
    define('ENTRY_COMPANY_TAX_ID_TEXT', '*');
    I also added a Tax ID minimum setting to the config table:
    Code:
    75 Tax ID ENTRY_COMPANY_TAX_ID_MIN_LENGTH 5 Minimum length of Tax ID 2 6 2011-03-02 23:35:11 0000-00-00 00:00:00 NULL NULL
    I had altered this one also in the address table:
    Code:
    ALTER TABLE address_book
        MODIFY `entry_company_tax_id` varchar(32) NOT NULL DEFAULT '';
    Debbie D
    NY & VA

  4. #14
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Smile Re: Tax ID REQUIRD -- help!!

    Wkdwich,

    I knew I should have check this before posting! BTS has javascript fallback as well as css and content functionality ... the file you should be editing is catalog/templates/fallback/javascript/create_account.js.php.

    Add this:
    Code:
    <?php 
      if (ACCOUNT_COMPANY == 'true') {
        if (tep_not_null(ENTRY_COMPANY_TEXT)) { ?>
          check_input("company", <?php echo ENTRY_COMPANY_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_ERROR; ?>");
        <?php
        }
        if (tep_not_null(ENTRY_COMPANY_TAX_ID_TEXT)) { ?>
          check_input("company", <?php echo ENTRY_COMPANY_MIN_LENGTH; ?>, "<?php echo ENTRY_COMPANY_TAX_ID_ERROR; ?>");
        <?php
        }    
      }
    ?>
    Then go to core.php in the language file and set the ENTRY_COMPANY_TEXT & ENTRY_COMPANY_TAX_ID_TEXT to a '*'. The form should now work ... if you don't want the field to be required then remove the '*'.

    I will be extending this form shortly to make it conditionally check only fields marked with a '*'.

    Sorry for the confusion ...

    Regards,
    pgmarshall
    _______________________________

  5. #15
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Tax ID REQUIRD -- help!!

    PG you are the best! I'll get to testing this later, full plate this morning.. so I wason the right track?? I did the correct thing as far as the DB fields and the other changes or were they not needed???

    And just to clarify..
    core.php in the language file
    means:
    /catalog/includes/languages/english.php
    since english is my core langague.. correct??
    Last edited by wkdwich; 03-03-2011 at 04:40 AM.
    Debbie D
    NY & VA

  6. #16
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Thumbs up Re: Tax ID REQUIRD -- help!!

    well curiosity got the better of me.. that worked!!!! yippppeeeeee

    thank you thank you thank you!!! I will have my client make a contribution to the cause
    Debbie D
    NY & VA

  7. #17
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: Tax ID REQUIRD -- help!!

    Yes core.php is the main language file for each language.

    Also if you want the full fix: r1185 - oscmax2 - Project Hosting on Google Code

    This now allows you to turn on the compulsory nature of the field by adding the * to the language file.

    Regards,
    pgmarshall
    _______________________________

  8. #18
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Tax ID REQUIRD -- help!!

    so all that other stuff I did wasnt needed????? OMG the hours spend hunting this down...

    Debbie D
    NY & VA

  9. #19
    Active Member
    Join Date
    Nov 2004
    Location
    California
    Posts
    158
    Rep Power
    25


    Default Re: Tax ID REQUIRD -- help!!

    Thanks guys. I edited the includes/languages/english/core.php taking out the * from the lines company and tax id. Thank You!

Page 2 of 2 FirstFirst 12

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
  •