How to Change text echoed in div of protected function woocommerce

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Sun May 23, 2021 5:18 am

Sun May 23, 2021 5:34 am

I am a learner
i want to change or remove change all lines in blankstate message which is echoed in below code.

Code: Select all

         Protected function render_blank_state() {
         	echo '<div class="woocommerce-BlankState">';
         	echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'When you receive a new order, it will appear here.', 'woocommerce' ) . '</h2>';
         //want to delete or change this below
         	echo '<div class="woocommerce-BlankState-buttons">';
         	echo '<a class="woocommerce-BlankState-cta button-primary button" target="_blank" href="">' . esc_html__( 'Learn more about orders', 'woocommerce' ) . '</a>';
         	echo '</div>';
         	do_action( 'wc_marketplace_suggestions_orders_empty_state' );
         	echo '</div>';
***CSS display :none; doesn't work***
User avatar
php-forum GURU
php-forum GURU
Posts: 1222
Joined: Mon Feb 22, 2016 5:52 pm

Mon May 24, 2021 10:22 am

Delete them?

Your question isn't very clear and my answer reflects my literal understanding of it; so if the answer does not help, try rewording it and I will try again.
php-forum Fan User
php-forum Fan User
Posts: 137
Joined: Mon Jun 08, 2020 2:00 am

Mon May 24, 2021 11:07 am

OP is trying to change the HTML produced by woocommerce when the orders table is empty. Unfortunately it's hardcoded deep in a class, so getting to it via an action is pretty tricky.

It will be easier to get the CSS approach working correctly. Check the element you've attached the style to in your browser's dev tools; is your style there?
Post Reply