Home › Forums › WoodMart support forum › Product Filters stop working after you remove
Product Filters stop working after you remove
- This topic has 6 replies, 2 voices, and was last updated 6 years, 9 months ago by Artem Temos.
-
AuthorPosts
-
March 6, 2018 at 6:52 pm #44325
jinsley8ParticipantHi,
I’ve been seeing issues with product filters when you add 1 or 2 then remove and try to select a new one, it doesn’t load anymore.
On my link select the following steps:
1. Select Flags & Banners under Product Type dropdown
2. Select Large Banners under Product Type dropdown again
3. now x out of both – remove/close
4. Now try using the Product Type filter menu dropdown again, it doesn’t load the new selectionMarch 7, 2018 at 7:18 am #44388
Artem TemosKeymasterHi,
As we can see, you are using some JS scripts to stylize default WooCoommerce select dropdown https://gyazo.com/bbc90b8e2ed7eed1ea2959d3e5b52bb8
And this script is not initialized again after the AJAX request. For example when you clear your filters. That is why it doesn’t work while you do not reload the page. You need to disable this script or turn off our AJAX shop function in Theme Settings.Kind Regards
March 7, 2018 at 7:38 am #44397
jinsley8ParticipantDoes the regular dropdown not look like that in the theme?
I didn’t notice this styling change or add anything that I know of.
March 7, 2018 at 7:56 am #44404
Artem TemosKeymasterHere is a screenshot how it looks by default https://gyazo.com/5c66b9b38b85dc10792c049ed986ad2e
March 19, 2018 at 5:30 am #46919
jinsley8ParticipantI disabled all plugins except the woodmart required plugins and Woocommerce but the dropdowns still look and act the same.
The search input on the dropdowns shows its being styled by woocommerce.
/wp-content/plugins/woocommerce/assets/css/select2.cssI found this script that may have something to do with it?
/wp-content/plugins/woocommerce/assets/js/selectWoo/selectWoo.full.min.jsI also found this script in the page source:
<!-- WooCommerce JavaScript --> <script type="text/javascript"> jQuery(function($) { // Update value on change. jQuery( '.dropdown_layered_nav_product-type' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_product-type"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_product-type' ).selectWoo( { placeholder: 'Any Product Type', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_product-subtype' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_product-subtype"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_product-subtype' ).selectWoo( { placeholder: 'Any Product Subtype', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_product-subtype2' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_product-subtype2"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_product-subtype2' ).selectWoo( { placeholder: 'Any Product Subtype2', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_country' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_country"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_country' ).selectWoo( { placeholder: 'Any Country', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_club' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_club"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_club' ).selectWoo( { placeholder: 'Any Club', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_hot-brand' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_hot-brand"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_hot-brand' ).selectWoo( { placeholder: 'Any Hot Brand', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } // Update value on change. jQuery( '.dropdown_layered_nav_sub-brand' ).change( function() { var slug = jQuery( this ).val(); jQuery( ':input[name="filter_sub-brand"]' ).val( slug ); // Submit form on change if standard dropdown. if ( ! jQuery( this ).attr( 'multiple' ) ) { jQuery( this ).closest( 'form' ).submit(); } }); // Use Select2 enhancement if possible if ( jQuery().selectWoo ) { var wc_layered_nav_select = function() { jQuery( '.dropdown_layered_nav_sub-brand' ).selectWoo( { placeholder: 'Any Sub Brand', minimumResultsForSearch: 5, width: '100%', allowClear: true, language: { noResults: function() { return 'No matches found'; } } } ); }; wc_layered_nav_select(); } }); </script>
March 19, 2018 at 5:41 am #46922
jinsley8ParticipantAlso – the widget being used is the Filter Product by Attribute.
March 19, 2018 at 7:34 am #46951
Artem TemosKeymasterPlease, provide us your admin and FTP access so we can check what to do there.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register