How to make the state not required ?

Discussion in 'Payments processing' started by jfoulquier, Oct 26, 2009.

  1. jfoulquier

    jfoulquier New Member

    Joined:
    Jul 22, 2009
    Messages:
    22
    Hello,

    I'm using aMember (latest version) with the Paypal Pro (credit card payments) plugin. My customers will be 99% french, since my website is... in french.

    During the payment processing, on the screen where they have to fill credit card informations, the customers are askeds their address. My problem is that the State is required, even if we select "France" in the country field. How to make the "State" field not required ?

    Thx !
  2. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    May I add to that: "How to make the "State" field not appearing at all?"
  3. jfoulquier

    jfoulquier New Member

    Joined:
    Jul 22, 2009
    Messages:
    22
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Edit /amember/templates/cc/cc_info.html and change this(or remove whole block if you want to delete state from cc info page ):
    Code:
    <tr>
        <th><b>#_TPL_CC_INFO_STATE#</b><br />
        <div class="small"></div></th>
        <td>
        <input class="required" type="text" name="cc_state" id="t_cc_state" size="30" 
            {if $f.validate_func ne ""}_required="1" realname="#_TPL_CC_INFO_STATE#"{/if} 
            value="{$cc_address.cc_state|escape}" 
            />
        <select class="required" name="cc_state" id="f_cc_state" size="1" 
            {if $f.validate_func ne ""}_required="1" realname="#_TPL_CC_INFO_STATE#"{/if} 
            disabled="true" style='display: none;' >........
            {state_options country=$cc_address.cc_country selected=$cc_address.cc_state}
        </select>
        </td>
    </tr>
    
    to

    Code:
    <tr>
        <th><b>#_TPL_CC_INFO_STATE#</b><br />
        <div class="small"></div></th>
        <td>
        <input  type="text" name="cc_state" id="t_cc_state" size="30" 
            value="{$cc_address.cc_state|escape}" 
            />
        <select  name="cc_state" id="f_cc_state" size="1" 
            disabled="true" style='display: none;' >........
            {state_options country=$cc_address.cc_country selected=$cc_address.cc_state}
        </select>
        </td>
    </tr>
    
    
    Then in /amember/plugins/payment/cc_core/cc_core.inc.php
    remove this:
    Code:
        if (!strlen($vars['cc_state'])) 
            $errors[] = _PLUG_PAY_CC_CORE_ERROR16; 
    
  5. jfoulquier

    jfoulquier New Member

    Joined:
    Jul 22, 2009
    Messages:
    22
    Thank you !
  6. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    Thanks Alex!
  7. juicesupport

    juicesupport New Member

    Joined:
    Jun 12, 2015
    Messages:
    1
    Can someone give an update on this, as the file locations listed above aren't consistent with the current version. I'm trying to get rid of the state requirement so that people all over the world can purchase. It seems odd that it's standard for state to be required for countries that do not have states or the appropriate states listed.
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Do you want to remove this requirement on CC info page? What payment plugin do you use?

Share This Page