Grab The New Year Offer! Flat 20% off now. Use code 'CYM20'

angusisok

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • angusisok
    Participant

    And here is the solution:

    I am currently running PHP 7.3.18, since PHP 7.3 release you should use the function is_countable():

    So we change line 212 from this:

    $count2 = count($child_cats_child);

    to this:

    $count2 = is_countable($child_cats_child);

    and that solves the issue of the uncaught error: Call to a member function.

    I hope you can understand as I have come to understand. Thank you for your help.

    angusisok
    Participant

    Again, I will pass. I want to understand, not have someone do it for me.

    angusisok
    Participant

    Couple of problems here with that. First is the line for the code isn’t 101. It is 264. But if I were to go to 101, it would say this: if ( $count2 > 0 ){
    and for context here is lines 97 through 106
    //’taxonomy’ => //get children of this parent using the catID variable from earlier
    );
    $child_cats = get_terms( ‘product_cat’ ,$get_children_cats );
    $count2 = count($child_cats);
    if ( $count2 > 0 ){
    echo ‘ <ul class=”dropdown-menu”>’;
    foreach( $child_cats as $child_cat ){
    //for each child category, get the ID
    $childID = $child_cat->cat_ID;
    $thumbnail_id2 = get_woocommerce_term_meta( $child_cat->term_id, ‘thumbnail_id’, true );
    So I don’t think this is the correct line number that you are referring to. The original posting that I made talked about line 264, which is this:

    <span class=”cart_icon”><i class=”fa fa-shopping-cart” aria-hidden=”true”><span class=”cart-no”><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></i></span></span>

    I believe you are referring to line 264; however, your suggestion reads to replace the following: cart ) ? WC()->cart->get_cart_contents_count() : ”;?> with this line: cart->get_cart_contents_count() );?>

    The problem with that is the original line doesn’t include that exact match. I have no line that begins with: cart) unless you are referring to the call for wp_kses_data, is that where I should start replacing from? Please help me to understand.

    angusisok
    Participant

    No, I’d rather not, thanks. I would prefer to learn how to fix it myself. Can additionally, I think it would help others that might have this issue in the future if the solution was available instead of having you fix it every time. Can we do that?

Viewing 4 posts - 1 through 4 (of 4 total)

Translate »