Edit action in sidecart


Please add action in function mfn_get_woo_sidecart_footer:

Example:

do_action('mfn_get_woo_sidecart_footer_header');

do_action('mfn_get_woo_sidecart_footer_content');

do_action('mfn_get_woo_sidecart_footer_footer');



function mfn_get_woo_sidecart_footer(){

$is_translatable = mfn_opts_get('translate');

$translate['translate-side-cart-shipping-free'] = $is_translatable ? mfn_opts_get('translate-side-cart-shipping-free', 'Free!') : __('Free!', 'woocommerce');

do_action('mfn_get_woo_sidecart_footer_header');

echo '<div class="mfn-chft-row mfn-chft-subtotal">'.__( 'Subtotal', 'woocommerce' ).': '; wc_cart_totals_subtotal_html(); echo '</div>';

if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) :


$total = esc_html($translate['translate-side-cart-shipping-free']);


  if ( 0 < WC()->cart->get_shipping_total() ) {


   if ( WC()->cart->display_prices_including_tax() ) {

    $total = wc_price( WC()->cart->shipping_total + WC()->cart->shipping_tax_total );


    if ( WC()->cart->shipping_tax_total > 0 && ! wc_prices_include_tax() ) {

     $total .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';

    }

   } else {

    $total = wc_price( WC()->cart->shipping_total );


    if ( WC()->cart->shipping_tax_total > 0 && wc_prices_include_tax() ) {

     $total .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';

    }

   }

  }


echo '<div class="mfn-chft-row mfn-chft-row-shipping">'.__( 'Shipping', 'woocommerce' ).': <span>'. $total .'</span></div>';

endif;


do_action('mfn_get_woo_sidecart_footer_content');

echo '<div class="mfn-chft-row mfn-chft-total">'.__( 'Total', 'woocommerce' ).': '; wc_cart_totals_order_total_html(); echo '</div>';


do_action('mfn_get_woo_sidecart_footer_footer');

}


or


if (! function_exists('mfn_get_woo_sidecart_footer')) {


}



?

Comments

Sign In or Register to comment.