WPIntell

Source evidence

Hide tabs when empty

Custom Product Tabs for WooCommerce WP All Import Add-on · support · 2019-08-29T13:29:00+00:00

mixedsentiment
mediumseverity
0.84relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

10 / 38 rows with source links

26.3% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
thnor resolved
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. @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 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. @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 🙂 @tonyhnor , Sorry I missed your reply but you’re welcome glad to hear it! – Freddie

Comments

5 shown
Freddie 2019-08-29T14:39:00+00:00

@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

thnor 2019-08-29T15:50:00+00:00

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.

Freddie 2019-08-29T21:03:00+00:00

@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/

thnor 2019-09-11T08:44:00+00:00

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

Freddie 2019-09-11T14:51:00+00:00

@tonyhnor , Sorry I missed your reply but you’re welcome glad to hear it! – Freddie