<?php
if ( ! defined( 'ABSPATH' ) ) exit;

$custom_sale_badge_upload_new = get_bodycommerce_option( 'custom_sale_badge_upload_new' );
  $BodyCommerce_sale_badge_size_new = get_bodycommerce_option( 'BodyCommerce_sale_badge_size_new' );
  $check_BodyCommerce_sale_badge_edge_distance_new = get_bodycommerce_option( 'BodyCommerce_sale_badge_edge_distance_new' );
  $check_BodyCommerce_sale_badge_top_distance_new = get_bodycommerce_option( 'BodyCommerce_sale_badge_top_distance_new' );
  $check_BodyCommerce_sale_badge_position_new = get_bodycommerce_option( 'BodyCommerce_sale_badge_position_new' );


  $aa_img_attachment = wp_get_attachment_image_src( $custom_sale_badge_upload_new );
  $path = $aa_img_attachment[0];
  ?>
  <img class="custom_user_badge new" src="<?php echo $path ?>">
  <?php

  $css_badge = '
  <style id="bodycommerce-new-badge user_custom">
.custom_user_badge.new,
.woocommerce ul.products li.product a img.custom_user_badge.new {
  width:'.$BodyCommerce_sale_badge_size_new .'px;
  max-height:'.$BodyCommerce_sale_badge_size_new .'px;
  position: absolute;
  z-index: 100;
  '.$check_BodyCommerce_sale_badge_position_new.':'.$check_BodyCommerce_sale_badge_edge_distance_new.'px;
  top: '.$check_BodyCommerce_sale_badge_top_distance_new.'px;
} 
</style>
';

$css_badge_min = str_replace( array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $css_badge );
echo $css_badge_min;
