public static function get_available_shipping_methods() { $_available_methods = array(); if (self::$enabled == 'yes') { foreach (self::get_all_methods() as $method) { /** @var $method fflcommerce_shipping_method */ if (fflcommerce_cart::has_free_shipping_coupon() && $method->id == 'free_shipping') { $_available_methods[$method->id] = $method; } if ($method->is_available() && $method->cost >= 0) { $_available_methods[$method->id] = $method; } } } //throw error if there are no shipping methods if (empty($_available_methods)) { self::$shipping_error_message = __('Please enter your shipping destination and postal code to view shipping options and rates.', 'fflcommerce'); if (self::get_options()->get('fflcommerce_enable_shipping_calc') == 'no' && is_cart()) { self::$shipping_error_message .= __(' If the Shipping Calculator is not available here, you will need to advance to the Checkout to do this.', 'fflcommerce'); } self::$shipping_error_message .= __(' There may be no methods available for your destination and you should contact us for assistance.', 'fflcommerce'); } return apply_filters('fflcommerce_available_shipping_methods', $_available_methods); }