Merhaba,
Anladığım kadarıyla WooCommerce tarafında böyle bir ayar yok. İnternette de bulamadım. İstemeyerekte olsa PHP modifikasyonu atmak zorunda kaldım.
1. Kod:
add_filter('woocommerce_variable_sale_price_html', 'hide_high_price', 10, 2);
add_filter('woocommerce_variable_price_html', 'hide_high_price', 10, 2);
function hide_high_price($v_price, $v_product) {
$prod_prices = array($v_product->get_variation_price('min', true), $v_product->get_variation_price('max', true));
$price = $prod_prices[0] !== $prod_prices[1] ? wc_price($prod_prices[0]) : wc_price($prod_prices[0]);
return $price;
}1. kodda indirimli fiyatlar da gözükmez, sadece tek bir fiyat gösterir.
2. Kod:
// Mağaza Çift Fiyat Engelleme
add_filter('woocommerce_variable_sale_price_html', 'show_sale_price', 10, 2);
add_filter('woocommerce_variable_price_html', 'show_sale_price', 10, 2);
function show_sale_price($v_price, $v_product) {
// En düşük ve en yüksek normal fiyatları al
$prod_prices = array($v_product->get_variation_regular_price('min', true), $v_product->get_variation_regular_price('max', true));
// En düşük ve en yüksek indirimli fiyatları al
$sale_prices = array($v_product->get_variation_sale_price('min', true), $v_product->get_variation_sale_price('max', true));
if ($prod_prices[0] !== $sale_prices[0] && $v_product->is_on_sale()) {
// Eğer ürün indirimdeyse, normal fiyatın yanında indirimli fiyatı da göster
$price = wc_format_sale_price($prod_prices[0], $sale_prices[0]);
} else {
// Eğer ürün indirimde değilse, sadece normal fiyatı göster
$price = wc_price($prod_prices[0]);
}
return $price;
}2. kodda indirimli fiyatlar gözükür ama varyasyon fiyatları gözükmez.
Not: Kodları çocuk temanızın functions.php dosyasına ekleyiniz.