Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1736246
Woocommerce Category Images are broken
Closed

Comments

  • Nikolay Todorov started the conversation

    I had several problems with the woocommerce categories but managed to solve them. All but one.

    The category images are not displayed

    This is what debug shows:

    Notice: Trying to get property of non-object in /public_html/wp-content/themes/scalia/inc/woocommerce.php on line 363


    function scalia_woocommerce_subcategory_thumbnail( $category ) {

    $small_thumbnail_size = apply_filters( 'single_category_small_thumbnail_size', 'shop_catalog' );
    $thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true);
    $image = '';

    if ( $thumbnail_id ) {
    $image = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size );
    $image = $image[0];
    }

    if ( $image ) {
    $image = str_replace( ' ', '%20', $image );
    echo '<img src="' . esc_url( $image ) . '" alt="' . esc_attr( $category->name ) . '" class="img-responsive" />';
    } else {
    echo wc_placeholder_img($small_thumbnail_size);
    }
    }

  • [deleted] replied

    Hi,

    Please provide the wp-admin and ftp access. We will try to inspect problem on your site. Also I don't see any  problem on this page - https://sitename.org/products

  •   Nikolay Todorov replied privately
  • [deleted] replied

    I found an error in content-product_cat.php template on your site. I remove next code:

    'woocommerce_template_single_title',

    from this line:

    do_action( 'woocommerce_before_subcategory_title','woocommerce_template_single_title', $category );

    Please check.

  • Nikolay Todorov replied

    Thank you.

    Problem is resolved.