Jump to content

Replying to Shipping Address For Countries With No States

Post Options

  or Cancel

Topic Summary


Posted 28 March 2015 - 07:52 AM

This didnt work for me, have double checked so that the updated fields.php are correct and in the right path of the theme. Even updated the core file but the state field are still there. I would like to have it removed both from the billing and shipping adress. This isnt an option for us here in Sweden.

Can this be overridden by some other themefunctions?

Live site: http://siga-sverige.se

Elise Alley

Posted 14 November 2013 - 05:39 PM

Hi Lisa,

The state field is there also to cover provinces, one or the other of which would be included in most countries.  This is certainly something you can remove, however, if you'd like to do so.  You'll want to download and unzip a copy of Exchange and then go into Exchange/lib/templates/super-widget-shipping-address/loops where you'll find the fields.php file.  

You don't want to make changes directly to that file as any subsequent updates to Exchange will overwrite your changes.  Instead, you'll copy that file into a directory you create in your theme.  The directory would be as follows:  wp-content/themes/YourTheme/exchange/super-widget-shipping-address/loops/

In your copy of fields.php, you'll see this at about line 19:

<?php $fields = array( 'first_name', 'last_name', 'address_1', 'address_2', 'city', 'country', 'state', 'zip', 'nonce' ); ?>

Simple remove the "'sate'," portion of the code, so it will look as follows:

<?php $fields = array( 'first_name', 'last_name', 'address_1', 'address_2', 'city', 'country', 'zip', 'nonce' ); ?>

This will remove that field from you shipping address form.

Let us know if you have any additional questions.



Posted 12 November 2013 - 11:18 AM

Is there a way to make the shipping address form's 'state' field optional?

It all works fine if the customer's country has states, but for the rest of us it doesn't seem possible to complete the form without bringing up an error. That's a whole lot of world to exclude!

Is there a setting I'm missing, or another way to get around this glitch?

Review the complete topic (launches new window)