Forums Forums Search & Filter Pro sort by woocommerce featured product

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #179657

    Hi I’m trying to sort by woocommerce featured product and I see others have asked this question but your replies are marked as private. Is there a way to do this? Search results page seems to ignore woocommerce_catalog_ordering(). Thanks

    Trevor
    #179662

    It depends how WooCommerce store the setting that a product is featured. Chances are it is a post meta (custom field). The problem will be that this field will only exist in the post meta data for a given product IF it IS featured. If it is not, there will be no field at all. That would result in ALL non-featured products disappearing from the results.

    If the data is stored as, for example, ‘featured’ and ‘not featured’, then that could sorted on.

    This does assume that WooCommerce correctly uses Post Meta. If it uses a taxonomy to store the data, that cannot be sorted by.

    Anonymous
    #179679

    Ah ok thanks Trevor. The new woocommerce does use taxonomy so guess I cant do a featured sort 🙁

Viewing 3 posts - 1 through 3 (of 3 total)