• Resolved renato.barone

    (@renatobarone)


    After update I got this error:

    Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /var/sites/v/villamarts.co.uk/public_html/wp-content/plugins/woocommerce/includes/walkers/class-wc-product-cat-list-walker.php:105
    
    The line 105, is: 
    
    

    $output .= ‘”>tree_type ) . ‘”>’ . apply_filters( ‘list_product_cats’, $cat->name, $cat ) . ‘‘;

    And here is the whole function:

    public function start_el( &$output, $cat, $depth = 0, $args = array(), $current_object_id = 0 ) {
    		$cat_id = intval( $cat->term_id );
    
    		$output .= '<li class="cat-item cat-item-' . $cat_id;
    
    		if ( $args['current_category'] === $cat_id ) {
    			$output .= ' current-cat';
    		}
    
    		if ( $args['has_children'] && $args['hierarchical'] && ( empty( $args['max_depth'] ) || $args['max_depth'] > $depth + 1 ) ) {
    			$output .= ' cat-parent';
    		}
    
    		if ( $args['current_category_ancestors'] && $args['current_category'] && in_array( $cat_id, $args['current_category_ancestors'], true ) ) {
    			$output .= ' current-cat-parent';
    		}
    
    		$output .= '"><a href="' . get_term_link( $cat_id, $this->tree_type ) . '">' . apply_filters( 'list_product_cats', $cat->name, $cat ) . '</a>';
    
    		if ( $args['show_count'] ) {
    			$output .= ' <span class="count">(' . $cat->count . ')</span>';
    		}
    	}

    Please someone could help. me on this?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP_Error could not be converted to string in’ is closed to new replies.