Global Product Categories for MarketPress Posts

The best that I can see it, right now each individual MarketPress store owner can choose Product Categories for the products in their own store. I’d like to keep that and also have store owners choose a Global Product Category for each product they post, so I can show a listing of items in the network per global category. (Please note that this is different than showing a global list of all the individual store categories themselves.)

I figure there must be some combination of currently-existing WPMU modules that would accomplish this fairly easily. Any ideas/suggestions on how I can go about doing this? My thanks in advance —

  • DavidM
    • DEV MAN’s Mascot

    Hi conkhead and welcome to WPMU DEV!

    Yeah, that would be a very nice feature, but the’re no way I know of to have 2 distinct category listings. It could maybe be done using a specific category where on the main site you pull 1 product from that category on each site. But that wouldn’t quite let site owners pick a select category.

    I’ll mention this to some of the team, but perhaps others around here have ideas on that too. Anyone?


  • conkhead
    • Design Lord, Child of Thor

    I just figured this would be a pretty obvious feature others have also wanted, and that someone has hacked a solution to this before. I’m looking into hacking some non-MarketPress-related MU sitewide category plugin from the WordPress repositor, and if I have any luck, I’ll post what I find out. Honestly, I can’t imagine this being that hard. At the end of the day, MarketPress Products are just blog posts (albeit custom ones :slight_smile:.

  • conkhead
    • Design Lord, Child of Thor

    Okay, I think I have a solution for this: I’m going to try using the bbAggregate plugin ( ); but I need to mod it so that the drop-down form it produces appears *only* on the Product posting custom post type produced by MarketPress.

    There is a spot in the main bbAggregate.php file (line 175) where a callback arrays calls for…

    $page = ‘post’

    If I change “post” to a unique identifier of the Products custom post type (I don’t know what that is), would that do it?

  • JM
    • Design Lord, Child of Thor

    post_type=product (this is taken from the Products section in wp-admin’s url), so instead of $page=’post’ try $page=’product’

    Maybe this could help you. I hope it does because it’s a cool and needed feature.

  • JM
    • Design Lord, Child of Thor

    I’ve tested it and it works on my computer, locally, but not on my server.The local site and the online one are not the same, i have different plugins installed etc.

    On my server the plugin sees only my main blog, so it doesn’t show up the products from other blogs, but i’ve managed to add the select box to product page, and the products are saved.

    It works perfect locally. Assuming that your websites are not like my online version, here is what you need to do if you want/need global categories with this plugin.

    1.Install the plugin and activate it globally.

    2.Open bbAggregate.php and look for these lines of code.

    $page = 'post', $context = 'normal', $priority = 'high', $callback_args=null


    if ( isset($_POST['bbagg_wpnonce']) && (wp_verify_nonce($_POST['bbagg_wpnonce'], 'bbagg-streams') ) && ('post' === $_POST['post_type']) )

    3.In both of them you should change the ‘post’ with ‘product’, so it will look like this

    $page = 'product', $context = 'normal', $priority = 'high', $callback_args=null

    if ( isset($_POST['bbagg_wpnonce']) && (wp_verify_nonce($_POST['bbagg_wpnonce'], 'bbagg-streams') ) && ('product' === $_POST['post_type']) )

    4.Save and replace the old bbAggregate.php.

    5.That’s all. WordPress way :smiley:.

    P.S.: You should read the plugin’s readme file and look at the screenshots because the plugin doesn’t automatically creates a page template to display aggregate products. In the example folder it has such a page but you should copy and paste it into your theme.


  • conkhead
    • Design Lord, Child of Thor

    Thanks, JM. I have been occupied with other matters, and haven’t had a chance to implement this. From what I can tell, though, your hack should work just fine. (Thanks, BTW – I missed the second call to $post_type!)

  • Byronmarkets
    • Flash Drive


    I have followed these instructions however when I changed the code in the bbaggregate.php I have this error message @charset “utf-8”; /* CSS Document */ showing in the top right hand corner of my screen.

    I also was not able to see the ‘settings’ function in the plugin before or after I changed the code as suggested in the screen shots for the plug in.

    I am very keen to make this work, all help is very much appreciated.


  • JM
    • Design Lord, Child of Thor

    If you have the latest verison of wordpress, then, after the plugin is installed you should go from Network Admin to Site Admin. There, under settings you will find bbAggregate. Click it because this is where the settings are.

    I don’t know what to say about that error message you get, maybe it’s something to do with your theme’s css?

    I hope this helps!


  • Byronmarkets
    • Flash Drive

    Back again :slight_smile:

    I have been exploring and found that there is no way to add subcategories which is very much required if our sites are to grow.

    Every stream added is added in the order entered and there is no way to rearrange or show a category as a sub-category.

    For example I want to have a category called Health & Beauty and subcategories such as clothing, make up, bags etc. under this main category. I know I can arrange the way these pages sit on the main site, but my concern is that multi-site uploading products will not pick the right categories and get very confused if they are not in logical order. This could be a lot of manual editing for the website owner if sub-categories cannot be added in the backend…

    looking forward to any ideas…

  • conkhead
    • Design Lord, Child of Thor

    Thanks so much, Byron, Although I started this thread, I am just now ready to try testing this out. I’m going to use your modded script rather than modding it myself; I’ll post back with my results. (Sorry about the sub-categories thing, man; I personally am not in need of them :slight_smile:

  • nickrosener
    • Flash Drive

    How in the world bbAggregate solve the problem? Seems to me that users would have to add to your stream themselves.. and that if you wanted to use it in combination with categories there would be a hefty amount of additional custom code (basically to the point where you should DELETE this plugin and make your own).

    The point is obviously to make global categories ACTUALLY GLOBAL, instead of just a near duplicate of product categories.. All global is doing is letting the main site, share everyone’s categories.. virtually useless, who would ever want to do that? Customer could make a category “some shit” and it would be on yoursite.. OBVIOUSLY IT SHOULD WORK THE OTHER WAY AROUND. and you should pull PRODUCTS IN THE CATEGORIES.. not just the categories.. EBAY.. Amazon..

    Just sayin.. before anyone gets to excited over EITHER.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.