No State / County field

pixyweb's Avatar

pixyweb

26 Oct, 2011 11:10 PM via web

In the billing and shipping forms in the processing order there is a State / County field, how to pull it out ?

  1. Support Staff 2 Posted by Matt on 27 Oct, 2011 03:07 AM

    Matt's Avatar

    You want to remove it? Any reason why? :)

  2. 3 Posted by pixyweb on 27 Oct, 2011 08:46 AM

    pixyweb's Avatar

    Yes I want to remove it because in France we do not really use that kind of field.

  3. Support Staff 4 Posted by Jeff on 27 Oct, 2011 01:40 PM

    Jeff's Avatar

    Unfortunately, you really can't without editing the core files. Which you could do, but would have to re-do with each Jigoshop update.

    It would have to be changed in quite a few places though and not sure that it wouldn't break something somewhere without testing it thoroughly to be honest.

  4. 5 Posted by pixyweb on 27 Oct, 2011 02:19 PM

    pixyweb's Avatar

    OK Jeff.
    But is it possible to make this field as not required ?

  5. Support Staff 6 Posted by ivica on 27 Oct, 2011 02:46 PM

    ivica's Avatar

    If possible, I would also like to see option to set some field as "not required" by myself (in settings?), and if it is not possible, at least put this field as not required as it doesn't have any use (doesn't exist) in my country (Croatia) as well.

  6. Support Staff 7 Posted by Matt on 27 Oct, 2011 02:55 PM

    Matt's Avatar

    I believe all that would be required is going into jigoshop_checkout.class.php and finding your field then changing required to false.

    Eg:

    array( 'type'=> 'state', 'name'=>'billing-state', 'label' => __('State/County', 'jigoshop'), 'required' => true, 'class' => array('form-row-last'), 'rel' => 'billing-country' ),
    

    Change 'required' => true to => false

    Give it a go :)

  7. Support Staff 8 Posted by Jeff on 27 Oct, 2011 03:12 PM

    Jeff's Avatar

    Yes, and again, any time Jigoshop is updated, you will need to redo it.

    There is a request to allow user selection to allow which fields are required and we will look at it for some future release after the end of November release most likely.

  8. Support Staff 9 Posted by ivica on 27 Oct, 2011 03:24 PM

    ivica's Avatar

    Thx Matt and Jeff, we wish you (and us :-)) all the best for the next release(s), especially for the famous 1.0!

  9. 10 Posted by Vincent on 16 Nov, 2011 01:15 PM

    Vincent's Avatar

    Hi,

    The easiest way would be to modify the $billing_fields variable of the jigoshop_checkout class, but doing it in a plugin/theme instead of editing the core files.

    An easy way to do it would be like this
    `function jigo_mod_wp() {

    if ( class_exists( 'jigoshop_checkout' ) ) {
        $fields = array(
            array( 'name'=>'billing-first_name', 'label' => __('First Name', 'jigoshop'), 'placeholder' => __('First Name', 'jigoshop'), 'required' => true, 'class' => array('form-row-first') ),
            array( 'name'=>'billing-last_name', 'label' => __('Last Name', 'jigoshop'), 'placeholder' => __('Last Name', 'jigoshop'), 'required' => true, 'class' => array('form-row-last') ),
            array( 'name'=>'billing-address', 'label' => __('Address', 'jigoshop'), 'placeholder' => __('Address', 'jigoshop'), 'required' => true ),
            array( 'name'=>'billing-city', 'label' => __('City', 'jigoshop'), 'placeholder' => __('City', 'jigoshop'), 'required' => true ),
            array( 'validate' => 'postcode', 'format' => 'postcode', 'name'=>'billing-postcode', 'label' => __('Postcode', 'jigoshop'), 'placeholder' => __('Postcode', 'jigoshop'), 'required' => true, 'class' => array('form-row-first') ),
            array( 'type'=> 'country', 'name'=>'billing-country', 'label' => __('Country', 'jigoshop'), 'required' => true, 'class' => array('form-row-last') ),
            array( 'name'=>'billing-email', 'validate' => 'email', 'label' => __('Email Address', 'jigoshop'), 'placeholder' => __('***@yourdomain.com', 'jigoshop'), 'required' => true )
        );
        jigoshop_checkout::instance()->billing_fields = $fields;
        jigoshop_checkout::instance()->shipping_fields = $fields;
    }
    

    } add_action ( 'wp', 'jigo_mod_wp' );`

    I hope I could help!

  10. 11 Posted by Vincent on 16 Nov, 2011 01:22 PM

    Vincent's Avatar

    Hm, the formatting got a bit messed up.

    I hope it makes sense anyway!

  11. 12 Posted by khoyan on 01 May, 2012 10:40 AM

    khoyan's Avatar

    State/Province is something we don't use in Norway either, and it would be nice if it was either automatically recognized as unnecessary based on what country you choose, or that you could specify if it's needed or not, without editing theme or core files.

  12. 13 Posted by Susan on 02 May, 2012 06:51 AM

    Susan's Avatar

    Hi - Thanks but I´m a little confused..
    How is it that I remove the adress boxes so my products only is available in download form?

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Recent Discussions

17 May, 2012 05:51 AM
17 May, 2012 05:20 AM
17 May, 2012 05:18 AM
17 May, 2012 04:50 AM
17 May, 2012 12:14 AM