You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have written some custom functions to have a custom sort by popularity search order for woo commerce
Basically where you see the drop down on the catalog listing page, sort by latest, sort by popularity etc
But if we make the default sorting order for woo commerce our 'sort by popularity' option
it completely breaks the elasticPress search
I am wondering if anyone can please let me know what would I need to do, so that we can set up our custom sort by popularity as default without breaking ElasticPress search
Below I have attached the custom code for our sort by popularity search
public function __construct() {
add_action('admin_menu', array($this, 'wcgp_add_submenu'));
add_action('admin_init', array($this, 'register_wcgp_settings'));
add_filter('cron_schedules', array($this,'add_cron_interval_for_ten_mins'));
add_action('update_grouped_product_sales', array($this,'update_grouped_product_sales'));
// Schedule the event to run every 10 minutes
if (!wp_next_scheduled('update_grouped_product_sales')) {
wp_schedule_event(time(), 'ten_minutes', 'update_grouped_product_sales');
}
add_filter( 'woocommerce_default_catalog_orderby_options', array($this,'custom_woocommerce_catalog_orderby') );
add_filter( 'woocommerce_catalog_orderby', array($this,'custom_woocommerce_catalog_orderby') );
add_filter( 'woocommerce_get_catalog_ordering_args', array($this,'custom_woocommerce_get_catalog_ordering_args') );
add_action('init',array( $this, 'callAFunction' ));// for calling all ajax based frunction from here
}
Many thanks in advance
With Kind Regards,
Alex
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe your question
Hi Everyone,
We have written some custom functions to have a custom sort by popularity search order for woo commerce
Basically where you see the drop down on the catalog listing page, sort by latest, sort by popularity etc
But if we make the default sorting order for woo commerce our 'sort by popularity' option
it completely breaks the elasticPress search
I am wondering if anyone can please let me know what would I need to do, so that we can set up our custom sort by popularity as default without breaking ElasticPress search
Below I have attached the custom code for our sort by popularity search
And you can see how this is getting intitialsied
Many thanks in advance
With Kind Regards,
Alex
Code of Conduct
The text was updated successfully, but these errors were encountered: