If you want to use a WooCommerce Ajax Filters plugin, Uncode offers basic compatibility with the free version of the YITH WooCommerce Ajax Product Filter plugin. With YITH WooCommerce Ajax Product Filter you can simplify product search in your shop. Thanks to the Widgets you can easily set up search filters and allow users to consult quickly your products by having access in a few seconds to the screen showing only those products they are interested in.
How to set up
To properly configure the plugin to work with Uncode, please:
1. Use this code in the function.php of your Child Theme:
add_filter( 'yith_wcan_ajax_frontend_classes', 'uncode_yith_ajax_filters' );
function uncode_yith_ajax_filters( $opts ){ $opts['container'] = '.isotope-container'; $opts['pagination'] = '.pagination'; $opts['result_count'] = '.woocommerce-result-count'; $opts['scroll_top'] = '.isotope-system'; return $opts; }
2. Use this JavaScript code in your Child Theme or in the Theme Options → Utility → CSS & JS → JavaScript:
(function( $ ) { $(document).on('yith-wcan-ajax-filtered',function(){ UNCODE.isotopeLayout(); }); })(jQuery);
3. Use this CSS code in your Child Theme or in the Theme Options → Utility → CSS & JS → CSS:
.yit-wcan-container > div > .tmb { padding-right: 36px; /* adjust this value to your need */ }
Notes
- Archive and Category pages. The plugin works only in WooCommerce archive pages. By inserting Widgets on different pages you won’t achieve any result.
- Page Builder. The WooCommerce Ajax Filters plugin does not generate any Page Builder module: this is designed to be a Widget. If you need to use it through the Page Builder, you must first create a dedicated Sidebar and use it through the Widgetised Sidebar module of the Page Builder.
- Pagination. The YITH WooCommerce Ajax Filter only works with the default WooCommerce Pagination that in Uncode is actionable when the option Theme Options → Products → Content → Remove Pagination is set to Off (it cannot be combined with the Ajax Pagination of the Posts module).
Comments
0 comments
Article is closed for comments.