getshopped
05
Jun
2011
In getshopped
hack
php
WordPress 3.0
WordPress Development
WordPress Plugins
wp e-commerce
By Andy
Add related products to wp e-commerce (getshopped) store
On 05, Jun 2011 | 25 Comments | In getshopped, hack, php, WordPress 3.0, WordPress Development, WordPress Plugins, wp e-commerce | By Andy
Here is a nice and simple way to enable related products on a single product page when using wp e-commerce. There’s only four steps!
Step one: Download the “Related Posts” plugin from http://www.microkid.net/wordpress/related-posts/ and install it.
Step two: Set up the plugin and familiarise yourself with the admin panel. Here is a great place to start.
Step three: Insert the following where you want your related products to display (for me this is in the imported wpsc-single_product.php file in my theme folder)-
MRP_show_related_posts()
Step four: Change line 450 in microkids-related-posts.php (now in your wp-content/plugins/microkids-related-posts folder)
FROM
$output .= "<li><a href="".get_permalink( $related_post->ID )."">".$related_post->post_title."</a></li>n";
TO
$output .= "<li><a href="".get_permalink( $related_post->ID ).""><img src="".wpsc_the_product_thumbnail(get_option('product_image_width'),get_option('product_image_height'),$related_post->ID,'single')."" ><br>".$related_post->post_title."</a></li>n";
And you’re done.
Comments
-
Nice post really usefull for wp-ecommerce plugin thx
-
Hi… I did it all…and I get a
Error de HTTP 500 (Internal Server Error) any clue???
-
FYI, they updated the plugin. Instead of changing line 450, now it’s line 658
-
i try it in my site but always give none….means no related posts why?
m using shortcode in single-post [related-posts posttype=products] but result none..
-
How can I set the thumbnails to automatically go to 180 x 180?
-
Hi
Can’t seem to get this to output image + product link without php error.I think it’s because of new WP E-Commecce ver 3.8.7.5 .
Anyone able to update the code as such?
Cheers
Glennyboy
-
I’m getting a parse error when changing that line on 450. Any ideas?
-
Thanks for this great information and plugin but unfortunately it does not seems to work , I’ve followed your instruction and use Advance implementation but still no luck.
btw one question what the product refer to show as related a “tag”, “category” or what? I didn’t find it in the tutorial above.
Thanks,
-
Excellent, was looking at how to add related products, the only problem I have now is it seems to put a massive load on my server (admittedly a shared server) should I get a dedicated server?
-
Hi,
I have follow the steps you mentioned but my Single Product Page still showing no related products … Am i missing something?
Thnx Heaps
-
Thanks for this. Was just what I was looking for my product pages.
Would never have manage this without your help!
-
HI!
Where in the wpsc-single_product.php should I put this MRP_show_related_posts() code?
When I copy it to the end of the code it just displays that code(as a text) on my single product pages. Any ideas=)? Thanks
-
Thanks for the great step-by-step tutorial, it worked great. I was wondering if there’s a way to do the same thing for the widget so that the related product thumbnails also appear in the sidebar and not just the links?










Submit a Comment