• Deepak Chauhan

    (@deepchauhan)


    Hi,
    I want to show the shipping charge on the fly cart below the subtotal. Is there a way to show the shipping charge there?

    Thank You

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    I also want to know how this can be done, to show flat fee shipping, and or handling charge. Will the paid version show this?

    At the moment it does show the amount added to the total, but it doesn’t show what the charge is. So this is helpful to let the buyer know what the extra charge is.

    Please let me know.

    Thanks.

    • This reply was modified 3 years, 9 months ago by gercal.
    Plugin Author WPClever

    (@wpclever)

    Hi @gercal

    You can use the filter hook ‘woofc_below_subtotal_content’ to show more information below the subtotal.

    Please try to add the below code to current-theme (or child-theme) / functions.php

    add_filter( 'woofc_below_subtotal_content', 'your_woofc_below_subtotal_content', 99, 1 );
    function your_woofc_below_subtotal_content() {
    	$content = '';
    
    	foreach ( WC()->cart->get_fees() as $fee ) {
    		$content .= '<div class="woofc-total"><div class="woofc-total-left">' . esc_html( $fee->name ) . '</div><div class="woofc-total-right">' . ( WC()->cart->display_prices_including_tax() ? wc_price( $fee->total + $fee->tax ) : wc_price( $fee->total ) ) . '</div></div>';
    	}
    
    	if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) {
    		$taxable_address = WC()->customer->get_taxable_address();
    		$estimated_text  = '';
    
    		if ( WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ) {
    			$estimated_text = sprintf( ' <small>' . esc_html__( '(estimated for %s)', 'woocommerce' ) . '</small>', WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] );
    		}
    
    		if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
    			foreach ( WC()->cart->get_tax_totals() as $code => $tax ) {
    				$content .= '<div class="woofc-total"><div class="woofc-total-left">' . esc_html( $tax->label ) . $estimated_text . '</div><div class="woofc-total-right">' . wp_kses_post( $tax->formatted_amount ) . '</div></div>';
    			}
    		} else {
    			$content .= '<div class="woofc-total"><div class="woofc-total-left">' . esc_html( WC()->countries->tax_or_vat() ) . $estimated_text . '</div><div class="woofc-total-right">' . apply_filters( 'woocommerce_cart_totals_taxes_total_html', wc_price( WC()->cart->get_taxes_total() ) ) . '</div></div>';
    		}
    	}
    
    	return $content;
    }

    I tried your code, but it wont show “Flat Rate” shipping. I wonder if in your parameters it is included code for it.

    Hi @wpclever ,

    Congrats for this nice plugin.
    Its almost perfect except the possibility of showing shipping fees charge below the sub-total.
    We tried the filter hook you gave to @gercal but it didn’t work for us either.

    This is the only option that miss to buy your plugin.
    (could be included in the premium version also)

    Any plan to fix it in the near future?

    Best Regards
    ns.

    I need to know as well, the snippet didn’t work.

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to show shipping charge on fly cart’ is closed to new replies.