Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,

    You can’t see any badge on the products in shop page because your theme doesn’t use the standard WooCommerce hooks and functions.

    You could fix this issue by editing the wp-content/themes/savoy/woocommerce/content-product.php file

    You should replace lines 91-101:

    if ( has_post_thumbnail() ) {
        $product_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), 'shop_catalog' );
    
        if ( $nm_globals['shop_image_lazy_loading'] ) {
            echo '<img src="' . esc_url( $placeholder_image ) . '" data-src="' . esc_url( $product_thumbnail[0] ) . '" width="' . esc_attr( $product_thumbnail[1] ) . '" height="' . esc_attr( $product_thumbnail[2] ) . '" class="attachment-shop-catalog unveil-image" />';
        } else {
            echo '<img src="' . esc_url( $product_thumbnail[0] ) . '" width="' . esc_attr( $product_thumbnail[1] ) . '" height="' . esc_attr( $product_thumbnail[2] ) . '" class="attachment-shop-catalog" />';
        }
    } else if ( woocommerce_placeholder_img_src() ) {
        echo '<img src="' . esc_url( $placeholder_image ) . '" class="attachment-shop-catalog" />';
    }

    with the following code:

    if ( has_post_thumbnail() ) {
        $product_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), 'shop_catalog' );
    
        if ( $nm_globals['shop_image_lazy_loading'] ) {
            $image = '<img src="' . esc_url( $placeholder_image ) . '" data-src="' . esc_url( $product_thumbnail[0] ) . '" width="' . esc_attr( $product_thumbnail[1] ) . '" height="' . esc_attr( $product_thumbnail[2] ) . '" class="attachment-shop-catalog unveil-image" />';
        } else {
            $image = '<img src="' . esc_url( $product_thumbnail[0] ) . '" width="' . esc_attr( $product_thumbnail[1] ) . '" height="' . esc_attr( $product_thumbnail[2] ) . '" class="attachment-shop-catalog" />';
        }
    
        echo apply_filters('post_thumbnail_html', $image, $post->ID);
    } else if ( woocommerce_placeholder_img_src() ) {
        echo '<img src="' . esc_url( $placeholder_image ) . '" class="attachment-shop-catalog" />';
    }

    In this way everything should work fine.
    Best Regards
    YIThemes

Viewing 1 replies (of 1 total)
  • The topic ‘Badges now showing up in Savoy Theme’ is closed to new replies.