[Resolved] Order of Woocommerce Single Product Page Tabs

Home Forums Support Order of Woocommerce Single Product Page Tabs

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1024904
    Kim

    Hi there, would it be possible to show the Woocommerce Tabs one below the other like in this in example?

    Section Example

    Best regards!

    #1025029
    David
    Staff
    Customer Support

    Hi there,

    try this PHP snippet – it will remove the tabs and the call each of the template parts to display them in a stack:

    add_action( 'after_setup_theme','db_stack_product_tabs' );
    
    function db_stack_product_tabs(){ 
        // Remove product tabs
        remove_action('woocommerce_after_single_product_summary','woocommerce_output_product_data_tabs', 10 ); 
        // Get tab content template parts
        add_action('woocommerce_after_single_product_summary','db_get_tab_template_parts', 10 );
    }
    
    function db_get_tab_template_parts() {
        // Include required template parts
        ?>
        <div class="woo-description-section"><?php wc_get_template( 'single-product/tabs/description.php' ); ?></div>
        <div class="woo-information-section"><?php wc_get_template( 'single-product/tabs/additional-information.php' ); ?></div>
        <?php comments_template();
    }
    #1025067
    Kim

    Hi David,

    it returns an error saying “syntax error, unexpected end of file” in line 16. What do I have to change?

    #1025098
    David
    Staff
    Customer Support

    I made an edit to the above code.

    #1025148
    Kim

    Awesome! Works well 🙂

    #1025164
    David
    Staff
    Customer Support

    Awesome – hadn’t tried it before so glad to hear that.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.