Home › Forums › Themes Support › Claue › Hide WooCommerce Sub-Category Widget from Menu when viewing Vendor Shop
- This topic has 7 replies, 2 voices, and was last updated 5 years, 2 months ago by Harry.
-
AuthorPosts
-
-
March 4, 2019 at 4:16 pm #29403bankzySupport Expired
Hello,
I am trying to hide the sub-menu created when adding the WooCommerce category widget to the “WooCommerce Categories Menu Sidebar” when viewing any vendor shop from WC Vendors Pro.
I have tried using javascript to hide the class below when viewing a certain permalink but I cannot get anything to work. The vendor name (club name in our case) would be prefixed to the end of that URL but I was hoping to include if anyone visits the below URL containing /club/ it would hide the below css class.
<p style=”padding-left: 30px;”>http://www.bdtesting.co.uk/club/</p>
<p style=”padding-left: 30px;”>.shop-top-sidebar</p>
-
March 4, 2019 at 5:06 pm #29406HarrySupport Expired
Hi Bankzy,
I check your link http://www.bdtesting.co.uk/club/boltonmetro/ the sub-category menu hided. Did you solve problem?
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
March 4, 2019 at 5:08 pm #29407bankzySupport Expired
Sorry I have just added the following JS but it’s also hiding it on every other WooCommerce category page which isn’t what I want. It seems to be ignoring my URL all together…
window.onload = function() {
if (window.location.href.indexOf(‘www.bdtesting.co.uk/club’)) {
//Hide the element.
document.querySelectorAll(‘.shop-top-sidebar’)[0].style.display = ‘none’;
}
}; -
March 4, 2019 at 5:33 pm #29411HarrySupport Expired
Hi,
Please try go to Widgets > WooCommerce Categories Menu Sidebar and check in only http://prntscr.com/msyhnd
“Only show children of the current category”
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
March 4, 2019 at 5:35 pm #29412bankzySupport Expired
Hello,
Yes I have tried that and thought it would work as I had hoped, however, when you click into a child category I still want the category bar to show so that customers can switch to another category very easily.
-
March 4, 2019 at 5:37 pm #29413HarrySupport Expired
Please add below code to Claue > Theme Option > General Layout > Custom CSS
.post-type-archive.post-type-archive-product .shop-top-sidebar {display: none;}
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
March 4, 2019 at 5:38 pm #29414bankzySupport Expired
Ahh fantastic! Had no idea vendor products were tagged as archive.
Thank you for the swift responses!
-
March 4, 2019 at 7:03 pm #29421HarrySupport Expired
You’re welcome. Have great week ahead!
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio
-
-
AuthorPosts
You must be logged in to reply to this topic.