Home › Forums › WoodMart support forum › PHP notices header already sent › Reply To: PHP notices header already sent
October 2, 2019 at 2:13 pm
#148084
metuza
Participant
I just did a test in /wp-content/themes/woodmart/inc/integrations/woocommerce/functions.php
I commented out the add_action as below and issue dissapeared. isn it a little late to set session cookie “woodmart_before_shop_page” as other html has already been output?
if( ! function_exists( 'woodmart_set_customer_session' ) ) {
//add_action( 'woodmart_before_shop_page', 'woodmart_set_customer_session', 10 );
function woodmart_set_customer_session() {
if( ! function_exists( 'WC' ) ) return;
if ( WC()->version > '2.1' && ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) ) :
WC()->session->set_customer_session_cookie( true );
endif;
}
}