aristath
Supreme Deity
WPMU DEV Staff
Lifetime member
Support Hamster Likes (0)
Suppose we have a product category with the slug 'bass-guitars-electric'.
The normal URL would be something like this: http://makrismusic.gr/store/products/category/bass-guitars-electric/
Sometimes though, we need to query products using more than that... So we need to use something like this: http://makrismusic.gr/?product_category=bass-guitars-electric
Unfortunately this returns a 500 error.
After looking at the apache error logs this is what I got:
PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /...../...../wp-includes/pluggable.php on line 894
When using the exact same method with other taxonomies There are no errors. For example, on the same site I have created a custom taxonomy vocabulary called "brand". When going to http://makrismusic.gr/?brand=fender we get no errors.
This could be caused by the custom product categories slugs though I 'm not sure.
Any advice would be appreciated...
This issue is related to this one (This post is the actual problem, the one linked here is the desired outcome): http://premium.wpmudev.org/forums/topic/marketpress-custompress-taxonomy-queries

Responses (9)
Support Chimp (joined March 2010) Likes (0)
Ya this would normally work:
?product_category=marketpress-test-cat
But I believe this is why you need permalinks enabled for MarketPress other wise categories won't work.
I'll ping Aaron see if he can drop a note to explain further.
Thanks.
Support Hamster (joined March 2012) Likes (0)
@Timothy thanks!!!
Member (joined February 2012) Likes (0)
Hello
Just wanted to chime in with this. A customer is having the same error crop up today, when they filter by product category.
Tested this on an offline server with up to date WP and so forth, Twenty Eleven theme and no other plugins - it still produces the same error.
error message: http://d.pr/i/RGHe
Lead Developer (joined May 2009) Likes (0)
MarketPress wasn't designed to handle those kind of URLs unfortunately. That being said I don't know why it wouldn't work, I'll take a quick look at it and if it's something simple it'll be in the next version.
Thanks!
Support Hamster (joined March 2012) Likes (0)
@Aaron thank you! This would make some things like faceted product searches a lot easier to implement...
Lead Developer (joined May 2009) Likes (1)Liked by: 
Ok, so that is an artifact of a bug fix in the latest version. The default WP product category widget was broken because it links to ?product_category=# with a numeric ID. So I put in a redirect for those, except the redirect was breaking when you didn't past a numeric ID.
Anyway I'll fix at least that. Note that the way marketpress handles its internal themeing will likely prevent additional manual query arguments from actually working in the URL though.
Support Hamster (joined March 2012) Likes (0)
@Aaron wow, that was fast... thanks!
Just a quick question...
So in order to achieve what I am describing here: http://premium.wpmudev.org/forums/topic/marketpress-custompress-taxonomy-queries would you suggest using a custom taxonomy instead?
Lead Developer (joined May 2009) Likes (1)Liked by: 
You can try it, but if things act quircky like I think they will, using a different taxonomy would fix that.
Support Hamster (joined March 2012) Likes (0)
@Aaron Thank you, I'll do that.
Become a member