New Landing How can we help? Themeforest Theme Support Neighborhood Relocate the Product tabs.

Viewing 15 posts - 1 through 15 (of 20 total)
  • #299526
    Baronkelvin
    Member
    Post count: 26

    Hi,

    I want to move the product tab (product description, additional info and reviews) after Share and under product pictures. I tried the code below to relocate the product tab. But the code seems not working for me, I checked other code online, i can only remove the tab, but not relocate it to the “after_single_product_summary” area. if I increase the importance factor, there will be two product tabs at the same time.

    function dante_product_tabs_override() {
    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10);
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 35);
    }
    add_action(‘init’, ‘dante_product_tabs_override’);

    Thanks in advance.

    #299531
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    It doesn’t seem the correct way of doing it.

    Check this documentation.

    https://docs.woocommerce.com/document/editing-product-data-tabs/

    Hope it helps.

    -Rui

    #299635
    Baronkelvin
    Member
    Post count: 26

    Hi Rui,

    I have checked the doc before and the first code inside can only remove the tabs, not relocate (the add_action is not working).
    I got the code above from the previous post in this forum, please see the attached pic.
    Hope there is a solution for that.
    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #299655
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    did you tried this one that is in the page I sent you?
    https://www.dropbox.com/s/o29zy1tqphzheh4/Screenshot%202016-10-31%2016.58.23.png?dl=0

    -Rui

    #299677
    Baronkelvin
    Member
    Post count: 26

    Hi Rui,

    I tried this one (reorder tabs), it seems nothing got changed, the tabs order is still the same.
    All i am looking for is to move the product tab under the picture and share row, so it can have the width of 8 column (4|4 4)
    Please see the attached pic.

    Looking forward to your feedback.

    Attachments:
    You must be logged in to view attached files.
    #299776
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Do you have a child theme? are you placing this code inside the functions.php of the child theme?

    If so, provide me admin credentials to have a quick look.

    -Rui

    #299872
    Baronkelvin
    Member
    Post count: 26
    This reply has been marked as private.
    #299876
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Check again, the problem was your child theme that wasn’t activated.
    You need to do it or else you aren’t using a child theme.

    -Rui

    #299911
    Baronkelvin
    Member
    Post count: 26

    Hi,

    I have tried on Child theme, the re_ordering tabs function (the previous link you sent me) is working, and for the
    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
    after I change the importance factor from “10” to “5”, it is working too, please see the attached picture 1.
    But the following code is not working

    function dante_product_tabs_override() {
      add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 35);
    }
    add_action('init', 'dante_product_tabs_override', 5);

    I can not move the product tabs below the picture and share row, please see the attached picture 2.

    Best,

    Baron

    Attachments:
    You must be logged in to view attached files.
    #300116
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    I changed the order since that wasn’t making sense to me, because first you have to remove it and add it later with a different priority.

    function dante_product_tabs_override() {
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 35);
      add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
    }
    add_action('init', 'dante_product_tabs_override', 5);

    Give it a try.

    -Rui

    #300141
    Baronkelvin
    Member
    Post count: 26

    Hi Rui,

    Thank you for your feedback, I tried the code above and it is not working.
    If I change
    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
    to
    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 5);
    then it will duplicate another tab in the target area, but the remove action seems not working. (please see the attached pic)

    Attachments:
    You must be logged in to view attached files.
    #300177
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Try to change the remove line priority, replace it by this one.

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );

    p.s- Since you have 2 tabs section there is also the change of hiding the 1s one with css, but try the code above first.

    -Rui

    #300343
    Baronkelvin
    Member
    Post count: 26

    Hi Rui,

    I changed the remove line priority from 35 to 10 and to 1, it was not working.
    I have tried the code below from Woocommerce Docs, which is the only one that can actually remove the tabs, but it will remove the duplicate one at the same time.

    add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
    
    function woo_remove_product_tabs( $tabs ) {
    
        unset( $tabs['description'] );      	// Remove the description tab
        unset( $tabs['reviews'] ); 			// Remove the reviews tab
        unset( $tabs['additional_information'] );  	// Remove the additional information tab
    
        return $tabs;
    
    }
    #300347
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    In that case. Add the code below to your custom css option.

    .summary .woocommerce-tabs.wc-tabs-wrapper {
        display: none;
    }

    -Rui

    #300349
    Baronkelvin
    Member
    Post count: 26

    Hi Rui,

    Thank you so much, the css works!

    Best,

    Baron

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register