• Resolved sulaardit

    (@sulaardit)


    First of all, thank you for making this plugin available, It’s Awesome!

    I have a single product custom area widget, is there an option to hook ONLY the custom tabs created into this area as accordions either by a function or simply a shortcode? and obviously for them not to be displayed in the regular tab section.

    If this is too much of a custom job do you know anything out there that can reproduce this effect as I’ve been scouring the net for a few days to no avail and my head is exploding!

    The desired effect is something like this; Sample Website

    Again thank you for your time 🙂

    Kind Regards

    • This topic was modified 6 years, 4 months ago by sulaardit.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hey @sulaardit,

    Thanks for using Custom Product Tabs for WooCommerce! You can most definitely move your tabs around but it will take a little bit of code if you’re up for it.

    When you’re making a theme that is compatable with WooCommerce you have to create a folder named /woocommerce in the root directory of your theme. That folder will hold all of the templates for various aspects of your theme.

    This is very common practice for WordPress and its a concept known as template overrides.

    Since you’re using a 3rd party premium theme you don’t want to make any changes to the code in your theme, instead you should create whats known as a child theme. That will allow you to pick and choose pieces of your main theme to override. That way when you update your main theme you’ll still have all of your changes safely preserved in your child theme.

    Once you’ve successfully created a child theme and activated it you should see no difference in your website.

    Now you’ll want to create a WooCommerce folder in your child theme. You’ll want to only place the files in there that pertain to your single product template. You can find those simply by going to your product page and right clicking, choosing “Inspect” and looking at the markup. Do a search through your WooCommerce folder in your main theme and find the markup that matches that product page.

    Now you’re going to want to create those files exactly like they are in your main theme. Once you’re done you should look at your product page and it should be exactly the same. You can add a <h1>Testing</h1> somewhere to test that its working. Look at the frontend of your site and if you’re seeing your test then you’ve successfully overridden the templates.

    Now that you have control of the templates you can make whatever changes you’d like.

    If you look at the WooCommerce Tabs that come by default with WordPress: https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/tabs/tabs.php

    You’ll see that they’re taken out like this:
    $product_tabs = apply_filters( 'woocommerce_product_tabs', array() );

    That filters woocommerce_product_tabs is how we add more custom tabs with this plugin. It’s a collection of tabs that WooCommerce has by default, “Description” etc. and we just add more tabs through that filter and they’re printed into your tab area.

    I’ve included a bunch of resources below to send you off in the right direction!

    Cheers,
    Freddie

    Template Overrides: https://www.dummies.com/web-design-development/wordpress/templates-themes-plugins/how-to-override-parent-template-files-in-wordpress/

    WooCommerce Template Overrides:
    https://docs.woocommerce.com/document/template-structure/

    Child Theme: https://www.wpbeginner.com/beginners-guide/wordpress-child-theme-pros-cons/

Viewing 1 replies (of 1 total)

The topic ‘Hook only custom tabs below woocommerce_product_meta_end’ is closed to new replies.