woocommerce_before_calculate_totals in woocommerce 3.0
Well, the problem is you are calling price directly at $value[‘data’]->price. Make it $value[‘data’]->get_price() and I think you problem will be fixed. So the whole code block will be- function calculate_embossing_fee( $cart_object ) { if( !WC()->session->__isset( “reload_checkout” )) { /* Gift wrap price */ $additionalPrice = 5; foreach ( $cart_object->cart_contents as $key => $value ) … Read more