Marketpress - change category order

Is there any way to change the category order in MarketPress? I tried using the My Category Order plugin, but it only works with posts, not custom post types.

I'm using the built in product category list widget, but that only sorts alphabetically right now, and I need to control the order that the categories appear in the list.

    DavidM

    Hi nickd32,

    For the ultimate in MarketPress widget customization, you could simply enable shortcodes in the text widget by including the following in your theme's functions.php file:
    <?php add_filter('widget_text', 'do_shortcode'); ?>

    With that you could use the simple WordPress text widget to display any of the MarketPress shortcodes, like for instance the following:
    [mp_list_categories orderby="author"]
    [mp_list_categories orderby="id"]

    And for easy reference, the following fields work with that shortcode:
    "order_by" - What field to order products by. Can be: title, date, ID, author, price, sales, rand (random).

    Cheers,
    David

    nickd32

    Yes, I thought about doing that, but it still doesn't give me the option I need, which is "I set the order"

    In this case the client has multiple categories of products that they want shown in a specific order which has nothing to do with the built-in criteria.

    The "My Category Order" plugin mentioned above adds a new option to the 'orderby' set called
    orderby=order

    ...that's what I'm looking for here.

    nickd32

    Maybe something like what WP does for Pages...

    DavidM

    There's not a way to specify the particular order as far as I can see, but wouldn't that be best achieved by simply hard-coding it with a text widget, seeing as it's going to be so specific?

    nickd32

    That's my next option. But I thought the ability to control category order would be beneficial for lots of other users as well.

    DavidM

    I'd say these types of things would be best done via a taxonomy widget that can accept custom queries though for your particular circumstance it would be best to have a drag and drop interface or at least some means of specifying the order. I just haven't seen a widget of that sort in particular.

    sixseconds
    • Elite
    • 36
    • #3,362

    Me too - important for marketing to be able to put certain categories and products first in the lists...

    camparoo

    Hi all, this is actually an easy fix (though a bit tedious). You use shortcode to display items in the order they were added, and then edit the dates each product was added to correspond with the product order you are seeking.

    [mp_list_products order_by="date"]

    I know this impractical for displaying a lot of products, but it worked perfectly for me. I had a site needing some products ordered by year (which I did with shortcode and tags - like this: [mp_list_products tag="2010"] ), and the top 20 products in a grid in an order specified by the client on a daily basis. As the items weren't top sellers and there was no alphabetical order that would make sense, I simply taught the client to edit the post dates to change the product order.

    sixseconds
    • Elite
    • 36
    • #3,362

    Any update on this - it seems very strange to have the "best" shop software and not be able to sort product order!!!

    sixseconds
    • Elite
    • 36
    • #3,362

    I tried the plugin Gary mentioned above, and it let me change category order. The publishers of that plugin also make this: http://wordpress.org/plugins/post-types-order/

    This one worked to change product order via drag & drop, not bad! It's a little awk because it shows ALL products in a big long list... rather than letting you order products within the category taxonomy... but it seems to work!

    I hope the WPMU folks decide to do something like this
    :)

    DavidM

    Thanks sixseconds, that's really helpful to know. I think a robust system for handling custom post types being integrated in CustomPress would be great. Including such functionality as you mentioned. But those plugins you guys mentioned seem to cover that currently.

    Timothy

    Hey there.

    Thanks for posting in this thread, however it might be best if you open your own, even if the issues seem closely related. That way it will remain independent of this one and ensure it doesn't confuse issues here if this thread needs reopening again by the author.

    Posting on old threads can also lead to us missing your questions.

    It also means the member who started this thread or anyone following it isn't inundated with post notifications each time we respond to each other. A lengthy thread could annoy the original

    This also allows us to better track and answer your questions to ensure we don't miss any for ya.

    You can start a new thread here:

    http://premium.wpmudev.org/qanda/

    Thanks.

    danmont
    • 72
    • #1,557

    This is a great topic. Ordering categories is a must for most e-commerce sites.

    camparoo,

    thank you for shearing your workaround.

    Would any one please advice me where this code needs to be placed to order the categories?

    [mp_list_products order_by="date"]

    Im using FrameMarket GridMarket theme and Market Press plugin

    thank you

    DavidM

    Hi @danmont,

    For use with GridMarket, you'll need to first enable shortcodes in widgets using either the snippet I mentioned in my initial response or using the following:
    http://wordpress.org/plugins/shortcodes-in-sidebar-widgets/

    With that, you can use the standard Text widget and include that or even other shortcodes in the content for it. The category list will then be displayed.

    Hope that helps! :)

    Cheers,
    David

    danmont
    • 72
    • #1,557

    Hi David,

    I prefer not to use plugins, that's why I like your coding method. However, Im having some difficulty in activating it.

    1) I added the <?php add_filter('widget_text', 'do_shortcode'); ?> line of code the gridmarket theme functions.php file.

    2) I added a text box to the sidebar and added this [mp_list_categories orderby="id"] to it.

    See Images attached.

    However, the categories are still sorted alphabetically.
    I'm I doing something wrong?

    Regards,

    Dan

    danmont
    • 72
    • #1,557

    Hi David,

    Would you take a look at this when you have a min?
    I installed the code as shown in the 2 Images above. Am I missing a step here? I cannot get it to work for some reason.

    Thanks

    DavidM

    Hi @danmont,

    Sure thing, could you let me know what happens when you use just the bare shortcode like so?

    [mp_list_categories]

    If that doesn't display anything at all, could I get you to create a new topic here?
    http://premium.wpmudev.org/qanda/

    That'll help to keep things organized, as this thread's more for custom ordering of category lists.

    Thanks,
    David

    danmont
    • 72
    • #1,557

    I finally got it to work, Thanks David!

    For those implementing this, be sure not to leave any empty space after adding the <?php add_filter('widget_text', 'do_shortcode'); ?> line of code the gridmarket theme functions.php file.

    I think that was the extra empty spaces that were causing the problem.

    DavidM

    Hi @danmont,

    Glad that worked for ya and thanks for letting us know, as well as providing the solution. It's always really helpful to know the specific solutions that finally work.

    Thanks!
    David

Join 370541 happy members

Get access to our entire collection of epic plugins, astonishing themes & genius support

Become a member