• Resolved TonyHnor

    (@tonyhnor)


    Hi, your plugin works fine and easy to use and have solved issues that were hard to find a solution to. Thank you for creating this addon.

    Have one issue; we have several thousand products and we use Custom Product Tabs to show progress in steps from 1-3. But some of the products only have two steps. When we manually remove a step on the product page it only shows the two steps, but when importing the excel-file, we get step 3 visible with no content.

    Is there a solution to hide the steps with no content through the excel spreadsheet, without manually deleting the tabs? We are going to reimport the excel spreadsheet on a monthly time basis, so manually removing them is not an option. We are trying to find solutions to meet our needs with only one spreadsheet.

    Looking forward to your answer.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Freddie

    (@fmixell)

    @tonyhnor,

    Thanks for using Custom Product Tabs! I want to help you get this resolved but I need a little bit more information.

    Your workflow is to edit products with a spreadsheet and then upload through All Import?

    Where did this excel sheet come from, WordPress Export?

    Are you exporting it each time you want to make changes?

    – Freddie

    TonyHnor

    (@tonyhnor)

    Hi, thank you for your quick reply.
    We have created the spreadsheet by ourself, it is based on products from another CMS, so it is pretty much created from scratch.

    The plan is to use the spreadsheet as the basis for every change done in WC, but it is wanted to use wp all export as well, if that works out with your plugin, if there has been done minor changes directly in WC.

    Plugin Author Freddie

    (@fmixell)

    @tonyhnor,

    I have a solution for you. If you have no content in the tab we can just add a little javascript to hide that tab. In the code snippet below you would need to change hide-tab to your tab title name. So if you want to hide a tab titled “Step 1” you would change that to .step-1-tab and #tab-step-1. All the code is doing here is looking to see if that tab has at least 2 children. The title being the first child and the content being the second child.

    window.addEventListener('DOMContentLoaded', function() {
        const hideButton = document.querySelector(".hide-me_tab");
    
        const hidePanel = document.querySelector("#tab-hide-me");
    
        if (hidePanel.children.length < 2) {
    	hidePanel.style.display = "none";
    	hideButton.style.display = "none";
        }
    });
    

    If you’re not sure where to put this code you could use this custom javascript plugin.

    https://wordpress.org/plugins/custom-css-js/

    Hi, Freddie.

    Just wanna reach out and say a big thank you for your solution. It worked like a charm 🙂

    Plugin Author Freddie

    (@fmixell)

    @tonyhnor,

    Sorry I missed your reply but you’re welcome glad to hear it!

    – Freddie

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide tabs when empty’ is closed to new replies.