<?php
if ( ! defined( 'ABSPATH' ) ) {
	// Exit if accessed directly.
	exit;
}
$image_type = get_post_meta( $badge_id, 'qode_badges_for_woocommerce_image_type', true );

?>
<div <?php qode_badges_for_woocommerce_class_attribute( $classes ); ?>>
	<?php
	if ( 'custom_image' === $image_type ) {
		$image_id = get_post_meta( $badge_id, 'qode_badges_for_woocommerce_image', true );

		echo wp_get_attachment_image( $image_id, 'full' );
	} else {
		$predefined = get_post_meta( $badge_id, 'qode_badges_for_woocommerce_badge_image_predefined', true );
		?>
		<img src="<?php echo esc_url( $predefined ); ?>" alt="<?php esc_html_e( 'badge', 'qode-badges-for-woocommerce' ); ?>">
		<?php
	}
	?>
</div>