$content ); } private function get_container_class(): string { return self::NOTICE_CONTAINER_CLASS . ' ' . $this->session_variable_name; } private function get_fragments_id(): string { return 'div.' . str_replace( ' ', '.', $this->get_container_class() ); } /** * @return string */ private function get_notice_message( FreeShippingNoticeData $free_shipping_notice_data ): string { $amount = $free_shipping_notice_data->get_missing_amount(); if ( $amount === 0.0 ) { return ''; } return $this->prepare_notice_text( $free_shipping_notice_data ); } /** * @param FreeShippingNoticeData $free_shipping_notice_data . * * @return string */ private function prepare_notice_text( FreeShippingNoticeData $free_shipping_notice_data ): string { $notice_text = apply_filters( 'flexible-shipping/free-shipping/render-notice', $free_shipping_notice_data ); /** * Notice text for Free Shipping. * * @param string $notice_text Notice text. * @param float $amount Amount left to free shipping. * * @return string Message text. */ $notice_text = apply_filters( 'flexible_shipping_free_shipping_notice_text', $notice_text, $free_shipping_notice_data->get_missing_amount() ); return is_string( $notice_text ) ? $notice_text : ''; } }