تابع ووکامرسی wc_cart_totals_order_total_html دریافت کد html هزینه کل سبد خرید

تابع ووکامرسی wc_cart_totals_order_total_html دریافت کد html هزینه کل سبد خرید

تابع ووکامرسی wc_cart_totals_order_total_html – دریافت کد html هزینه کل سبد خرید که در صورت نیازشامل مالیات هم می شود

Syntax – سینتکس

wc_cart_totals_order_total_html(); 

Usage – نحوه استفاده

if ( !function_exists( 'wc_cart_totals_order_total_html' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-cart-functions.php'; 
} 
 
  
// NOTICE! Understand what this does before running. 
$result = wc_cart_totals_order_total_html(); 
    

Defined – محل تعریف

/includes/wc-cart-functions.php

function wc_cart_totals_order_total_html() { 
    $value = '' . WC()->cart->get_total() . ' '; 
 
    // If prices are tax inclusive, show taxes here 
    if ( wc_tax_enabled() && WC()->cart->tax_display_cart == 'incl' ) { 
        $tax_string_array = array(); 
 
        if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) { 
            foreach ( WC()->cart->get_tax_totals() as $code => $tax ) 
                $tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label ); 
        } else { 
            $tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() ); 
        } 
 
        if ( ! empty( $tax_string_array ) ) { 
            $taxable_address = WC()->customer->get_taxable_address(); 
            $estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() 
                ? sprintf( ' ' . __( 'estimated for %s', woocommerce ), WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] ) 
                : ''; 
            $value .= '' . sprintf( __( '(includes %s)', woocommerce ), implode( ', ', $tax_string_array ) . $estimated_text ) . ''; 
        } 
    } 
 
    echo apply_filters( 'woocommerce_cart_totals_order_total_html', $value ); 
} 

versions – نسخه ها

از نسخه : 3.0.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us