• 27-12-2020, 02:16:58
    #1
    Merhaba ürün sayfasında ürünümün fiyatı 20tl ise 10tlye indirdiğimde indirim miktarı: 10tl olarak gözüküyor ancak ben ürün sayfasında vergili tutar gösterdiğim için (24.20 vergili, 12.10 fiyatı düşmüş yani %50 indirim) indirim tutarında ise 10tl gözüküyor kısacası indirim tutarımın koduna vergi oranı eklemem lazım yardımcı olur musunuz?

    İndirim kodu:
    function ts_you_save() {
    global $product;
    if( $product->is_type('simple') || $product->is_type('external') || $product->is_type('grouped') ) {
    $regular_price = get_post_meta( $product->get_id(), '_regular_price', true );$sale_price = get_post_meta( $product->get_id(), '_sale_price', true );
    if( !empty($sale_price) ) {
    $amount_saved = $regular_price - $sale_price;$currency_symbol = get_woocommerce_currency_symbol();
    $percentage = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );?><p style="font-size:24px;color:#2e7daa;"><b>Korting: €<?php echo number_format($amount_saved,2, '.', '')." "; ?></b></p><?php}}}
  • 27-12-2020, 02:23:50
    #2
    Kısacası çıkan sonuca +%21 eklemem lazım
  • 27-12-2020, 02:46:23
    #3
    $amount_saved = $regular_price - $sale_price;$amount_saved = ($amount_saved) + ($amount_saved * 0.21);

    İle çözdüm..