You appear to be a bot. Output may be restricted
Description
Retrieve the number of the country group for the country selected by the user on checkout
Usage
$integer = OIK_Shipping_Pro::get_countrygroup( $package );
Parameters
- $package
- ( array ) optional – expected to contain ['destination']['country']
Returns
integer country group – which will be 0 if the country is not present in any of the defined country groups Country group 0 can be used to set up default ratesSource
File name: oik-weightcountry-shipping-pro/class-oik-shipping-pro.phpLines:
1 to 14 of 14
function get_countrygroup( $package = array() ) { $country = $package['destination']['country']; $numbers = $this->country_group_no; $country_group = 0; for ( $counter=1; $counter <= $numbers; $counter++ ) { if ( is_array( $this->settings['countries'.$counter] )) { if (in_array( $country, $this->settings['countries'.$counter])) { $country_group = $counter; } } } return( $country_group ); }View on GitHub