• Resolved KatrineDS

    (@katrineds)


    Hi,

    How do I move related products above tabs?

    Tried this in functions.php

    remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
    add_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 5);

    That just gives some empty white space

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    > That just gives some empty white space

    Some custom CSS should also do the trick. Where can we see this? Can you send us an example product URL so we can examine via our browser tools.

    Kind regards,

    Thread Starter KatrineDS

    (@katrineds)

    Sorry, that was badly explained. The related products doesn’t move at all. They stay below the tabs; but the code creates empty space above the tabs. So it’s not just CSS I need. I still need help getting the php above correct.

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    > The related products doesn’t move at all. They stay below the tabs; but the code creates empty space above the tabs. So it’s not just CSS I need. I still need help getting the php above correct.

    Ah ok. So like this?
    https://businessbloomer.com/woocommerce-change-number-upsells-move-product-tabs/

    but with related products?

    Kind regards,

    Thread Starter KatrineDS

    (@katrineds)

    Yes, exactly. Tried it already but didn’t quite nail it.

    I see now that my support subject is REmove – that’s a mistake. Just MOVE.

    Du you know how to modify BB’s code to achieve what I want? To get the related products ABOVE the tabs. Would be great! Thanks in advance.

    Plugin Support Rynald0s.a11n

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @katrineds!

    You can try the following code:

    add_action( ‘init’, ‘move_related_products_before_tabs’ );
    function move_related_products_before_tabs( ) {
    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20 );
    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 5 );
    }

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove related products above tabs’ is closed to new replies.