Hi,
and thank you for writing in!
You cannot see the badge in single product badge, because your theme probably doesn’t use the standard WordPress and WooCommerce hooks and functions to print the images.
You should override the template wp-content/themes/shopkeeper/woocommerce/single-product/product-image-default.php by copying and pasting it into wp-content/themes/shopkeeper-child/woocommerce/single-product/ folder.
Then you should replace the lines 92-96 in wp-content/themes/shopkeeper/woocommerce/single-product/product-image-default.php:
<?php if ( has_post_thumbnail() ) { ?>
<img src="<?php echo esc_url($featured_image_src[0]); ?>" data-src="<?php echo esc_url($featured_image_data_src[0]); ?>" alt="<?php echo $featured_image_title; ?>" class="swiper-lazy wp-post-image">
<?php } else { ?>
<img src="<?php echo esc_url(wc_placeholder_img_src()); ?>" data-src="<?php echo esc_url(wc_placeholder_img_src()); ?>" class="swiper-lazy">
<?php } ?>
with the following code snippet:
<?php ob_start(); ?>
<?php if ( has_post_thumbnail() ) { ?>
<img src="<?php echo esc_url($featured_image_src[0]); ?>" data-src="<?php echo esc_url($featured_image_data_src[0]); ?>" alt="<?php echo $featured_image_title; ?>" class="swiper-lazy wp-post-image">
<?php } else { ?>
<img src="<?php echo esc_url(wc_placeholder_img_src()); ?>" data-src="<?php echo esc_url(wc_placeholder_img_src()); ?>" class="swiper-lazy">
<?php } ?>
<?php echo apply_filters('post_thumbnail_html', ob_get_clean(), $post->ID); ?>
Best Regards
YITH Support
-
This reply was modified 7 years, 7 months ago by
YITHEMES.