Adding custom product tabs to 2.01
-
Since we’ve been upgraded the custom tabs features don’t work, i can’t add or remove tabs like i used to, here’s the code i was using called from my functions.php
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30); remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30); add_action( 'woocommerce_product_tabs', 'sb_woocommerce_new_tab', 40 ); add_action( 'woocommerce_product_tab_panels', 'sb_woocommerce_new_panel', 40 ); function sb_woocommerce_new_tab() { echo '<li><a href="#assesment-assignment">' . __('Assessment & Assignment', 'woocommerce') . '</a></li>'; echo '<li><a href="#examination-accreditation">' . __('Examination & Accreditation', 'woocommerce') . '</a></li>'; echo '<li><a href="#reviews">' . __('Comments & Reviews', 'woocommerce') . '</a></li>'; } function sb_woocommerce_new_panel() { echo '<div class="panel" id="assesment-assignment"> <h2>New Panel 1</h2> <p>Example content...</p> </div> <div class="panel" id="examination-accreditation"> <h2>New Panel 2</h2> <p>Example content...</p> </div> <div class="panel" id="reviews"> <h2>New Panel 3</h2> <p>Example content...</p> </div>'; }
- The topic ‘Adding custom product tabs to 2.01’ is closed to new replies.