WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Woocommerce - option to add attributes in "Sort by" (9 posts)

  1. karwal.bubble
    Member
    Posted 1 year ago #

    Hi,

    I have just started using this plugin. But I am looking for the option to add new created attributes in "sort by" or "shop by". Like I have created new attribute "Location" and now I want to sort products by Location. Even I want to show group of products of each locations in widgets(sidebars). Like heading will be "Products in Otago" and show all products related to this attribute(otago).
    Anyone thr to help??

    Thanks,
    Baljit

    http://wordpress.org/extend/plugins/woocommerce/

  2. mikejolley
    Member
    Plugin Author

    Posted 1 year ago #

    I can't guide you sorting by attributes (taxonomies) as its pretty advanced (easier with custom fields), but this shows how to actually add extra options

    http://wcdocs.woothemes.com/snippets/custom-sorting-options-ascdesc/

  3. karwal.bubble
    Member
    Posted 1 year ago #

    Thanks Mike, I will try that..

  4. phantolino
    Member
    Posted 1 year ago #

    Sorry but the link you provided doesnt seem to work. I really need to customize sorting attrbutes and i cant find anywhere else information about it.

  5. phantolino
    Member
    Posted 1 year ago #

    Nevermind now it works but still the documentation is for adding attributes only, not adding a new "Sort by" drop down box with e.g. Color.

    Is it possible to give us a piece of code example on how to add a new sort drop box and where to put that code?

    Thanks

  6. tremblayly
    Member
    Posted 1 year ago #

    Hi,

    I'd be interested in finding out on how this can be done!

    Lyse

  7. Jive Dig
    Member
    Posted 1 year ago #

    I'm also curious if anyone ever figured this out.

  8. fightthecurrent
    Member
    Posted 1 year ago #

    Hey guys,

    You can modify the Sort By select dropdown by modifiying the Sorting template. Drag the default template found in wp-content/plugins/woocommerce/templates/loop/sorting.php to your theme's woocommerce folder. You should end up with wp-content/themes/theme-name/woocommerce/templates/loop/sorting.php. Feel free to modify away!

  9. rm3k
    Member
    Posted 1 year ago #

    @fight It seems as though the real customization is in the orderby.php file located within the woocommerce plugin directory /templates/loop...
    is that correct?

    I've edited both, and the orderby.php changes the appearance of the dropdown, however I haven't found the place to actually add in the functionality for different options for sorting.

    Ideally I'd like to be able to sort by category (either by just showing the category chosen OR by showing the categories ordered ASC/DESC by their ID or slug). Any ideas/examples of this kind of custom option addition?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic