• Resolved johnc1979

    (@johnc1979)


    I’m using the wonderful theme mesecolumn with a woocommerce installation.

    I’m getting one line of error only on the shop page. It is:
    Warning: Invalid argument supplied for foreach() in /home/u665221498/public_html/wp-content/themes/mesocolumn/lib/woocommerce/woocommerce-theme-functions.php on line 136

    There is no message anywhere else, only on the shop section. It displays just above the products on the shop page.

    Is there a way to fix this?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Richie KS

    (@rkcorp)

    make sure you item had 1 category assign at least. or edit line 135
    mesocolumn/lib/woocommerce/woocommerce-theme-functions.php to

    $terms = get_the_terms( $post->ID, 'product_cat' );
    if( count($terms) > 0 ) {
     foreach ($terms as $term) {
        $product_cat_id = $term->term_id;
        break;
    }
    }
    Thread Starter johnc1979

    (@johnc1979)

    Thanks, that did the trick

    I have applied the code above and now the error changed to this

    Warning: Invalid argument supplied for foreach() in /home/house/public_html/wxx.org/wp-content/themes/mesocolumn/lib/woocommerce/woocommerce-theme-functions.php on line 137

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid argument?’ is closed to new replies.