Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1330100

    How can I customize the sort options on the shop page, category page and tag page?
    Thanks, Stephan

    #1330255

    Hey Stephan_H,

    Thank you for the inquiry.

    Can you be more specific? What are you trying to change in the sort options?

    The current sort options are created using the avia_woocommerce_frontend_search_params function in the themes/enfold/config-woocommerce/config.php around line 1503. You can manually edit the options from there.

    You can also use a plugin to extend the default sorting option.

    // https://wordpress.org/plugins/woocommerce-extra-product-sorting-options/
    // https://wordpress.org/plugins/woocommerce-more-sorting/

    But you have to remove the custom sorting options that the theme added and re-enable the default sorting options from the shop plugin with these hooks.

    
    add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
    remove_action( 'woocommerce_before_shop_loop', 'avia_woocommerce_frontend_search_params', 20 );
    

    Best regards,
    Ismael

    #1330274

    Hi Ismael,
    Thanks for your reply. I want to remove some of the sort options that are not needed.
    If I change the config file, will the changes be persistent? Would I have to copy that file into the child theme subdir?
    And if I would like to remove the sort options altogether, would it be sufficient to use that remove_action hook?
    Thanks, Stephan

    #1330417

    Hi,

    Thank you for the update.

    You cannot override the config file in the child theme, but you can copy the avia_woocommerce_frontend_search_params function in the child theme’s functions.php file and modify it as you please. And yes, you can use the remove_action function to completely disable or remove the custom sort options.

    Best regards,
    Ismael

    #1330433

    Hi Ismael,
    Thanks for your help and advise!
    I chose to override the avia_woocommerce_frontend_search_params function in the child theme’s functions.php. This gives us the flexibility regarding sort options and their style of display we need.
    Best Regards,
    Stephan

    #1330549

    Hi,

    Great! Glad we could be of help. Please feel free to open another thread if you need anything else. We will close this one for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Customize WooCommerce sort options’ is closed to new replies.