Home › Forums › WoodMart support forum › Using Woodmart Ajax technology causes the menu not to close
Using Woodmart Ajax technology causes the menu not to close
- This topic has 9 replies, 2 voices, and was last updated 3 days, 12 hours ago by
Luke Nielsen.
-
AuthorPosts
-
June 30, 2025 at 4:38 am #670383
ha21cnParticipantI used Html Block to build Mega Menu, and at the same time turned on Woodmart’s Ajax function, but now I found a problem, when I clicked on the categories in Mega Menu, although the page content will be refreshed, Mega Menu will not be closed, and the menu will be closed only when Ajax is turned off, is there any way to solve this problem? Is there any way to solve this problem? While keeping the Ajax function?
https://drive.google.com/file/d/1sqrkXSW66s-hJJgUXpzyfeQ9q00ZSU-6/view?usp=drive_link
This is a video of me clicking through the menu.June 30, 2025 at 10:39 am #670467
Luke NielsenKeymasterHello,
I would like to request temporary admin access so I can look at the settings there better.
Thank you for your time.
Kind Regards
June 30, 2025 at 12:37 pm #670540
ha21cnParticipantThe account and password are provided below.
June 30, 2025 at 3:03 pm #670596
Luke NielsenKeymasterUnfortunately, we don’t have such functionality to close the dropdown during AJAX requests. In this case, we can offer you the following code that will disable AJAX when you click on a category.
add_filter('woodmart_ajax_links', function () { return '.wd-nav-product-cat a, .wd-page-wrapper .widget_product_categories a, .widget_layered_nav_filters a, .woocommerce-widget-layered-nav a, .filters-area:not(.custom-content) a, body.post-type-archive-product:not(.woocommerce-account) .woocommerce-pagination a, body.tax-product_cat:not(.woocommerce-account) .woocommerce-pagination a, .wd-shop-tools a:not([rel="v:url"]), .woodmart-woocommerce-layered-nav a, .woodmart-price-filter a, .wd-clear-filters a, .woodmart-woocommerce-sort-by a, .woocommerce-widget-layered-nav-list a, .wd-widget-stock-status a, .widget_nav_mega_menu a, .wd-products-shop-view a, .wd-products-per-page a, body[class*="tax-pa_"] .woocommerce-pagination a'; });
Kind Regards
June 30, 2025 at 3:48 pm #670618
ha21cnParticipantHowever, this menu was created using your built-in functionality, and the menu data is very large. Without Ajax functionality, it will cause the website to load very slowly. Do you have any other methods to cache this menu? This would improve the website’s loading speed.
June 30, 2025 at 5:33 pm #670671
Luke NielsenKeymasterThis specific use of AJAX functionality with product categories was not intended from the beginning, since AJAX is not designed for situations where regular links are used in dropdown menus (for example, in Mega Menu). In such cases, clicking on an element should lead to a complete page transition, not partial content updates — that’s exactly why conflicts arise with menu behavior that remains open. So currently, it’s not possible to change it.
Kind Regards
July 3, 2025 at 1:51 am #671320
ha21cnParticipanthttps://ibb.co/pjxvcQw8
When I use Google Chrome’s DevTool to analyse a website, it says [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://clubshopjerserys .com/wp-content/themes/woodmart/fonts/woodmart-font-1-400.woff2?v=8.2.5, I think it is because of the font loading that the site is slowing down, how do I disable the use of Woodmart fonts?July 3, 2025 at 2:40 pm #671495
Luke NielsenKeymasterEnable the “Swap” option for the font in Theme Settings -> Performance: https://take.ms/z8vQk
Kind Regards
July 12, 2025 at 6:27 pm #673603
ha21cnParticipantI would like to confirm where the code to turn off the Ajax function is placed above?
July 14, 2025 at 9:21 am #673712
Luke NielsenKeymaster -
AuthorPosts
- You must be logged in to create new topics. Login / Register