How to suggest related products
What are the related products suggestions based on? If I add tags to my products will the products with the same tag be shown as related? Thanks!
Log in to Community
What are the related products suggestions based on? If I add tags to my products will the products with the same tag be shown as related? Thanks!
Support Staff 2 Posted by Jeff on 03 Sep, 2011 05:43 AM
With both the same tags and categories actually. Gathered randomly.
3 Posted by guy on 15 Sep, 2011 06:53 PM
How could I remove the categories criteria and only find related products by similar tags?
I assume that jigoshop_related_products_args needs slight modification, but I can't find it anywhere.
Any help would be much appreciated!
Support Staff 4 Posted by Jeff on 15 Sep, 2011 08:01 PM
Well, it's pretty much hard coded in I'm afraid. 'jigoshop_related_products' has some args you can change, yes, but ultimately ends up calling each products get_related() function. You can see that in the classes/jigoshop_product.class.php file, look for get_related()
A theory might be to extend the Product class, (write your own), and only provide a rewitten get_related() function and instead of $_product = &new product( $post->ID) you would instantiate where you need it based on the new class.
$product = &new related_product( $post->ID ); $related = $product->get_related( '5' );
and of course over ride Jigoshops add_action with a remove_action and installing your own. Here is ours:
add_action( 'jigoshop_after_single_product_summary', 'jigoshop_output_related_products', 20);
So I guess it will depend on how bad you want it and your skillset.
5 Posted by guy on 15 Sep, 2011 10:49 PM
Wow thanks for the quick reply, Jeff!
After reading your last message I 've decided to remove the automated related products altogether from jigoshop_template_actions and use shortcodes in the description: [products skus="x, y, z"].
This now gives complete control over which products are related to each other and, after some CSS, looks identical to the normal "related products".
Thanks a lot for the help, it's much appreciated!
Support Staff 6 Posted by Jeff on 15 Sep, 2011 11:02 PM
Say, you're thinking ... :)
7 Posted by nbruley on 21 Sep, 2011 04:07 PM
Is the only way to change the number of related products to hardcode it in somewhere?
Support Staff 8 Posted by Jeff on 21 Sep, 2011 04:37 PM
Yes. Place the following in your theme's functions.php:
[php] function set_jigoshop_related_products_count( $args ) {
} add_filter( 'jigoshop_related_products_args', 'set_jigoshop_related_products_count' );
[/php]
... and obviously change the '593' to something suitable. :)
Just before the call to query_posts is issued to retrieve the related products, this filter gets run and you can override certain things.
9 Posted by nbruley on 21 Sep, 2011 04:57 PM
I changed the 593 to 4 to show 4 related products below the current product (right?) and now I get "No products found which match your selection."
??
Support Staff 10 Posted by Jeff on 21 Sep, 2011 05:10 PM
Figures. :)
I did that quick and never actually checked it. I will though and get back to you.
However, if you removed the ' or single quote on each side of the number so that there is only the number, would that fix it?
11 Posted by nbruley on 21 Sep, 2011 05:14 PM
Thanks... removing ' didn't change anything.
Support Staff 12 Posted by Jeff on 21 Sep, 2011 05:31 PM
Ok, this works for sure:
http://pastebin.com/A92iKHK8
Replace all that you put in from above with the pastebin.
there are 2 sets of numbers in the create_function part ... 4, 2
The 4 is the number of products and the 2 is the number of columns. Adjust accordingly.
13 Posted by nbruley on 21 Sep, 2011 06:15 PM
Perfect! Works great. Thanks.
Support Staff 14 Posted by ivica on 29 Oct, 2011 11:18 PM
Hi! Is it possible that in some future and distant version of Jigoshop you put somewhere in Settiings options possibility to chose how many related product to be visible under particular products?
And also, if not too much to ask for some future version, is it possible to put somwehere in the Product options possibility to control (choose, input, whatever) EXACTLY which products to be shown as related products for particular product?
In this way sellers/merchants would like to better control their selling strategy.
Maybe Cross/Up sells plugin is/will cover these needs?
15 Posted by Matt on 30 Oct, 2011 02:15 AM
Yes, ivica, Cross / Up Sells plugin will handle your requests. We pulled it off the site though because it only half-worked. Looking to repair and perhaps include it for free in Jigoshop :).
Support Staff 16 Posted by ivica on 30 Oct, 2011 07:30 AM
Fantastic news, guys! Thx a lot :-) You really rocks, please, just continue with the development of Jigoshop plugin in a way that you started - you are trully on the best development track possible!
17 Posted by kgaspeed on 04 Nov, 2011 07:25 PM
Hi Matt - the Cross / Up Sell plugin is a great idea and a vital tool for the build I'm currently working on. I'll sub to this thread and if you would, please let us know when the plugin is fixed and ready for action.
I have products split in two primary categories with 4-5 sub categories for each. Many of the products are actually the same from both sides, but they just have to be presented as Category A and B. This seems to really limit the Related Products show; control over this would be fantastic.
18 Posted by Matt on 04 Nov, 2011 08:02 PM
Certainly, kgaspeed. I'm not sure when our developers plan on tackling that monstrosity of a plugin, but I've notified Jeff to respond with perhaps a timeframe.
Jeff, thinking after Jigoshop 1.0? Or before?
19 Posted by kgaspeed on 04 Nov, 2011 08:25 PM
That plugin will be really nice to have; from what I'm seeing so far, Related Products isn't working that great, given my situation.
Support Staff 20 Posted by Jeff on 04 Nov, 2011 09:28 PM
Hey guys,
It's really not fully decided yet, but I would like it in for 1.0, yes. And before anyone asks, 1.0 itself is a moving target. We don't want to release anything too soon or after Christmas. My preference is for a 1.0 release early December as any later starts to impinge on the no christmas release inner ruling we have. It is quite unlikely to appear before then, certainly but we will see what we can do.
21 Posted by Steve Carroll on 09 Nov, 2011 12:27 AM
In response to (written by guy):
"After reading your last message I 've decided to remove the automated related products altogether from jigoshop_template_actions and use shortcodes in the description: [products skus="x, y, z"]."
Did this work for you? I tried with no luck and saw this thread today:
http://forum.jigoshop.com/discussions/problems/203-product-shortcod...