@charset "UTF-8";

/*
Theme Name:   Ayrin Shop
Theme URI: https://www.zhaket.com/web/ayrin-theme
Description:  Ayrin shop - E-commerce Theme
Author:       Webgeeks
Author URI:   https://www.zhaket.com/store/web/webgeeks
Version:2.1.5
Release Date:  1402/12/07
Last Update:  1404/01/28
Text Domain:  ayrin-shop
domain path: /languages/
Tags: Digital, shop, woocommerce, Store

██╗    ██╗███████╗██████╗  ██████╗ ███████╗███████╗██╗  ██╗███████╗
██║    ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔════╝██║ ██╔╝██╔════╝
██║ █╗ ██║█████╗  ██████╔╝██║  ███╗█████╗  █████╗  █████╔╝ ███████╗
██║███╗██║██╔══╝  ██╔══██╗██║   ██║██╔══╝  ██╔══╝  ██╔═██╗ ╚════██║
╚███╔███╔╝███████╗██████╔╝╚██████╔╝███████╗███████╗██║  ██╗███████║
 ╚══╝╚══╝ ╚══════╝╚═════╝  ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚══════╝
                                                                   
Developers: --------------------------------
Omid Hajizadeh && Moein Tavassoli
*/
add_filter( 'woocommerce_variable_sale_price_html', 'custom_variable_price_range', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'custom_variable_price_range', 10, 2 );
function custom_variable_price_range( $price_html, $product ) {
    $prefix     = __('شروع قیمت از', 'show-only-lowest-prices-in-woocommerce-variable-products');
    $min_price  = $product->get_variation_price( 'min', true );
    $suffix = $product->get_price_suffix( $price = '', $qty = 1 );
    /* If all variations have same price not display prefix */
    $max_price  = $product->get_variation_price( 'max', true );
    if( $min_price == $max_price )
        return wc_price( $min_price ) . $suffix;
    return $prefix . ' ' . wc_price( $min_price ) . $suffix;
}