Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
- function woo_new_product_tab( $tabs ) {
- if(get_field('szerokosc') || get_field('wysokosc') || get_field('glebokosc') || get_field('dlugosc') || get_field('fieldname')) {
- // Adds the new tab
- $tabs['test_tab'] = array(
- 'title' => __( 'Additional information', 'woocommerce' ),
- 'priority' => 50,
- 'callback' => 'woo_new_product_tab_content'
- );
- }
- return $tabs;
- }
- function woo_new_product_tab_content() {
- // The new tab content
- ?>
- <table id="tab-product">
- <?php if(get_field('szerokosc')): echo'<tr><td class="wymiary-left"><strong>Szerokość: </strong></td><td class="wymiary-right">' ?><?php the_field('szerokosc'); echo'</td></tr>'?><?php endif; ?>
- <?php if(get_field('wysokosc')): echo'<tr><td class="wymiary-left"><strong>Wysokość: </strong></td><td class="wymiary-right">' ?><?php the_field('wysokosc'); echo'</td></tr>'?><?php endif; ?>
- <?php if(get_field('glebokosc')): echo'<tr><td class="wymiary-left"><strong>Głębokość: </strong></td><td class="wymiary-right">' ?><?php the_field('glebokosc'); echo'</td></tr>'?><?php endif; ?>
- <?php if(get_field('dlugosc')): echo'<tr><td class="wymiary-left"><strong>Długość: </strong></td><td class="wymiary-right">' ?><?php the_field('dlugosc'); echo'</td></tr>'?><?php endif; ?>
- </table>
- <?php
- echo get_field('fieldname', $post_id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement