Home Forums Basel support forum A non-numeric value encountered (…) on line 443 after update

A non-numeric value encountered (…) on line 443 after update

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #38138

    ss24
    Participant

    Hello,

    after updating today both, Woocommerce and Basel theme, there appeared some strange text in project-category-thumbnail:

    Warning: A non-numeric value encountered in /home/(…)/public_html/wp-content/themes/basel/inc/woocommerce.php on line 443

    Even if I change the image that text is still seen.
    Please see attached printscreens.

    How can I fix it?

    Attachments:
    You must be logged in to view attached files.
    #38204

    Artem Temos
    Keymaster

    Hi,

    Be sure that you are running the latest version of our theme – 3.9.1.

    Regards

    #38252

    ss24
    Participant

    Hello,

    just checked that I’m using Basel 3.9.1 which was released yesterday.

    That text in project-category-thumbnail “Warning: A non-numeric value encountered in /home/(…)/public_html/wp-content/themes/basel/inc/woocommerce.php on line 443” appeared after updating yesterday WooCommerce to 3.3.1. and also your theme to 3.9.1.

    How to fix that?

    Best regards

    #38292

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a link to your website where we can see this issue?

    Kind Regards

    #38297

    ss24
    Participant

    Hello,

    the website is in maintenance mode, so you need to login to see this issue.
    Find login info in Private content.

    Let me know.

    Thank you!

    #38302

    Artem Temos
    Keymaster

    Could you please provide us your FTP access also?

    #38312

    ss24
    Participant

    Hello,

    see it in Private content.

    Best regards

    #38331

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function basel_category_thumb_double_size( $category ) {
    	global $basel_loop;
    	$small_thumbnail_size  	= apply_filters( 'subcategory_archive_thumbnail_size', 'woocommerce_thumbnail' );
    	$dimensions    			= wc_get_image_size( $small_thumbnail_size );
    	$thumbnail_id  			= get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true  );
            $attr_height 			= '';
    
    	if( ! empty( $basel_loop['double_size'] ) && $basel_loop['double_size'] ) {
    		$small_thumbnail_size = 'shop_catalog_x2';
    		$dimensions['width'] *= 2;
    		if ( $dimensions['height'] ) {
    			$dimensions['height'] *= 2;
    			$attr_height = 'height="' . esc_attr( $dimensions['height'] ) . '"';
    		}
    	}
    
    	if ( $thumbnail_id ) {
    		$image = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size  );
    		$image = $image[0];
    	} else {
    		$image = wc_placeholder_img_src();
    	}
    
    	if ( $image ) {
    		// Prevent esc_url from breaking spaces in urls for image embeds
    		// Ref: https://core.trac.wordpress.org/ticket/23605
    		$image = str_replace( ' ', '%20', $image );
    
    		echo '<img src="' . esc_url( $image ) . '" alt="' . esc_attr( $category->name ) . '" width="' . esc_attr( $dimensions['width'] ) . '" ' . $attr_height . ' />';
    	}
    }
    #38344

    ss24
    Participant

    Hello,

    just did that. It works!

    Many thanks again 🙂

    #38392

    Artem Temos
    Keymaster

    Great, you are welcome!

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