filters country areas defined in Lookup::country_areas().

add_filter( 'shopp_areas', [callback] )

@param array $areas country areas defined in Lookup::country_areas().


filters country areas defined in Lookup::country_areas().


// register filter callback
add_filter('shopp_areas', 'my_filter');

// create filter function
function my_filter( $areas ) {
    // $areas['CC']['Area Name'] = array('ABR1', 'ABR2', 'ABR3'...);
    // CC is the 2-digit alphabetic ISO abbreviation of your country
    // Area Name is the larger area of the country containing the states/provinces listed
    // in the following array.
    // ABR1, ABR2... is the abbreviation for you state/province.
    $areas['US'] = array();
    $areas['US']['Continental US']      = array();
    $areas['US']['Northeast US']        = array('MA','RI','NH','ME','VT','CT','NJ','NY','PA');
    $areas['US']['Midwest US']          = array('OH','IN','MI','IA','WI','MN','SD','ND','IL','MO','KS','NE');
    $areas['US']['South US']            = array('DE','DC','MD','VA','WV','NC','SC','GA','FL','AL','TN','MS','KY','LA','AR','OK','TX');
    $areas['US']['West US']             = array('MT','CO','WY','ID','UT','AZ','NM','NV','CA','OR','WA');
    $areas['US']['Continental US']  = array_merge($areas['US']['Northeast US'],$areas['US']['Midwest US'],$areas['US']['South US'],$areas['US']['West US']);

    return $areas;

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar