Problem with the Woocommerce hook ‘wtwh_print_cart_weight’
-
Hi,
I have implemented this function through Code Snippets:
add_action( ‘woocommerce_before_checkout_form’, ‘wtwh_print_cart_weight’ );
add_action( ‘woocommerce_before_cart’, ‘wtwh_print_cart_weight’ );
function wtwh_print_cart_weight() {
$notice = ‘Waga zamówienia: ‘ . WC()->cart->get_cart_contents_weight() . ‘ ‘ . get_option( ‘woocommerce_weight_unit’ );
if ( is_cart() ) {
wc_print_notice( $notice, ‘notice’ );
} else {
wc_add_notice( $notice, ‘notice’ );
}
}
It should output a frontend information about overall order weight.
It works fine on the default WordPress Cart/Checkout pages (1st screenshot)
Yet, it doesn’t work with Woodmart Layout Cart/Checkout pages (2nd screenshot).
Is there anything I have to customize in this code to make it work on your custom layout pages?
Can you help me with this one?
Thanks
Greetings
Attachments:
You must be
logged in to view attached files.
Hello,
We would be happy to help but we don’t know exactly how this code is supposed to work and fixing additional codes like this are out of our theme support scope.
Kind Regards
Ok, understood.
Thanks,
Please close this topic.
The topic ‘Problem with the Woocommerce hook ‘wtwh_print_cart_weight’’ is closed to new replies.