Home Forums WoodMart support forum How remove mines from promotion seals price

How remove mines from promotion seals price

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #530156

    av_admin_1984
    Participant

    Hello

    How remove mines from promotion seals price?

    see the image, The first one is what woodmart shows, the second one is what I want to be shown

    Attachments:
    You must be logged in to view attached files.
    #530458

    Hung Pham
    Keymaster

    Hi av_admin_1984,

    Thanks for reaching to us,

    Unfortunately, it is not possible to remove the minus. It is a part of the text.

    If you have any questions please feel free to contact us.

    Regards,

    #530470

    av_admin_1984
    Participant

    Hi

    Tell me what file is responsible for this

    #530474

    Hung Pham
    Keymaster

    Hi av_admin_1984,

    This is related to WooCommerce functionality, please reach out o their support team for more details.

    Regards,

    #530501

    av_admin_1984
    Participant

    Found in your support center, so it’s is related to theme not Woocommerce and your college fix this before
    https://xtemos.com/forums/topic/how-to-remove-negative-symbol/

    the code wont work, it’s look like the image link

    if ( ! function_exists( function: 'woodmart_product_label' ) ) {
    	function woodmart_product_label() {...}
    	add_filter( 'woocommerce_sale_flash', 'woodmart_product_label', 10 );
    #530609

    Hung Pham
    Keymaster

    Hi av_admin_1984,

    Please try to add to functions.php file in Child theme.

    if ( ! function_exists( 'woodmart_product_label' ) ) {
    	function woodmart_product_label() {
    		global $product;
    
    		$output = array();
    
    		$product_attributes = woodmart_get_product_attributes_label();
    		$percentage_label   = woodmart_get_opt( 'percentage_label' );
    
    		if ( 'small' === woodmart_loop_prop( 'product_hover' ) ) {
    			return;
    		}
    
    		if ( $product->is_on_sale() ) {
    
    			$percentage = '';
    
    			if ( $product->get_type() == 'variable' && $percentage_label ) {
    
    				$available_variations = $product->get_variation_prices();
    				$max_percentage       = 0;
    
    				foreach ( $available_variations['regular_price'] as $key => $regular_price ) {
    					$sale_price = $available_variations['sale_price'][ $key ];
    
    					if ( $sale_price < $regular_price ) {
    						$percentage = round( ( ( (float) $regular_price - (float) $sale_price ) / (float) $regular_price ) * 100 );
    
    						if ( $percentage > $max_percentage ) {
    							$max_percentage = $percentage;
    						}
    					}
    				}
    
    				$percentage = $max_percentage;
    			} elseif ( ( $product->get_type() == 'simple' || $product->get_type() == 'external' || $product->get_type() == 'variation' ) && $percentage_label ) {
    				$percentage = round( ( ( (float) $product->get_regular_price() - (float) $product->get_sale_price() ) / (float) $product->get_regular_price() ) * 100 );
    			}
    
    			if ( $percentage ) {
    				$output[] = '<span class="onsale product-label">' . sprintf( _x( '%d%%', 'sale percentage', 'woodmart' ), $percentage ) . '</span>';
    			} else {
    				$output[] = '<span class="onsale product-label">' . esc_html__( 'Sale', 'woodmart' ) . '</span>';
    			}
    		}
    
    		if ( ! $product->is_in_stock() && 'thumbnail' === woodmart_get_opt( 'stock_status_position', 'thumbnail' ) ) {
    			$output[] = '<span class="out-of-stock product-label">' . esc_html__( 'Sold out', 'woodmart' ) . '</span>';
    		}
    
    		if ( $product->is_featured() && woodmart_get_opt( 'hot_label' ) ) {
    			$output[] = '<span class="featured product-label">' . esc_html__( 'Hot', 'woodmart' ) . '</span>';
    		}
    
    		if ( woodmart_get_opt( 'new_label' ) && woodmart_is_new_label_needed( get_the_ID() ) ) {
    			$output[] = '<span class="new product-label">' . esc_html__( 'New', 'woodmart' ) . '</span>';
    		}
    
    		if ( $product_attributes ) {
    			foreach ( $product_attributes as $attribute ) {
    				$output[] = $attribute;
    			}
    		}
    
    		$output = apply_filters( 'woodmart_product_label_output', $output );
    
    		if ( $output ) {
    			woodmart_enqueue_inline_style( 'woo-mod-product-labels' );
    			$shape = woodmart_get_opt( 'label_shape' );
    
    			if ( 'rectangular' === $shape ) {
    				woodmart_enqueue_inline_style( 'woo-mod-product-labels-rect' );
    			}
    
    			if ( 'rounded' === $shape ) {
    				woodmart_enqueue_inline_style( 'woo-mod-product-labels-round' );
    			}
    
    			echo '<div class="product-labels labels-' . $shape . '">' . implode( '', $output ) . '</div>';
    		}
    	}
    }

    Regards,

    #530900

    av_admin_1984
    Participant

    Thanks for this code
    Please close this topic

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘How remove mines from promotion seals price’ is closed to new replies.