Forum Replies Created
-
AuthorPosts
-
May 22, 2020 at 4:07 pm in reply to: Critical Uncaught Error: Call to a member function Get_Cart_Contents_Count() #12109angusisokParticipant
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.
May 22, 2020 at 1:38 pm in reply to: Critical Uncaught Error: Call to a member function Get_Cart_Contents_Count() #12108angusisokParticipantAgain, I will pass. I want to understand, not have someone do it for me.
May 21, 2020 at 5:19 pm in reply to: Critical Uncaught Error: Call to a member function Get_Cart_Contents_Count() #12105angusisokParticipantCouple 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.
May 20, 2020 at 3:17 pm in reply to: Critical Uncaught Error: Call to a member function Get_Cart_Contents_Count() #12098angusisokParticipantNo, 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?
-
AuthorPosts