We’ve received your ticket and assigned one of our developers to help you check that out. He’ll be looking into your codes and responding as soon as possible.
Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.
I would like to display the shipping information above the total content. I found a function but that doesn't work.
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;
}
Hi Julia,
Thank you for contacting WPClever Support Forum.
We’ve received your ticket and assigned one of our developers to help you check that out. He’ll be looking into your codes and responding as soon as possible.
Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.
Best regards.
Janilyn T. - WPClever Support Agent
Hi Julia,
Please ensure that you added custom code correctly https://wpclever.net/faqs/add-custom-code
After adding the code, please update the cart (add or remove a product) to see the changes.
Best regards,
Dustin