Skip to content
Browse files

Fix strpos warning

  • Loading branch information...
1 parent 6ee17ef commit 430480964f238dbd3367c754510eed9190dee407 @mikejolley mikejolley committed Jun 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 classes/shipping/class-wc-shipping.php
View
4 classes/shipping/class-wc-shipping.php
@@ -194,12 +194,12 @@ function calculate_shipping( $packages = array() ) {
if ( sizeof( $_available_methods ) > 0 ) {
// If not set, set a default
- if ( empty( $chosen_method ) || ! isset( $_available_methods[$chosen_method] ) ) {
+ if ( empty( $chosen_method ) || ! isset( $_available_methods[ $chosen_method ] ) ) {
$chosen_method = apply_filters( 'woocommerce_shipping_chosen_method', get_option('woocommerce_default_shipping_method'), $_available_methods );
// Loops methods and find a match
- if ( ! isset( $_available_methods[ $chosen_method ] ) ) {
+ if ( ! empty( $chosen_method ) && ! isset( $_available_methods[ $chosen_method ] ) ) {
foreach ( $_available_methods as $method_id => $method ) {
if ( strpos( $method->id, $chosen_method ) === 0 ) {
$chosen_method = $method->id;

0 comments on commit 4304809

Please sign in to comment.
Something went wrong with that request. Please try again.