Image Image Image Image Image

Fish Can’t Whistle Limited

Registered Company Number: 7781289

Studio 30
Fazeley Studios
191 Fazeley Street
Birmingham
West Midlands
B5 5SE

 

Scroll to Top

To Top

getshopped

Add related products to wp e-commerce (getshopped) store

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.
:-)

Submit a Comment

Comments

  1. Nice post really usefull for wp-ecommerce plugin thx

  2. Hi… I did it all…and I get a

    Error de HTTP 500 (Internal Server Error) any clue???

    • Andy

      Hey Claudia,

      Im afraid I cant help much more without logging in to your site and having a poke around. :-)

  3. FYI, they updated the plugin. Instead of changing line 450, now it’s line 658

    • fish

      thnx :-)

  4. 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.. :(

    • fish

      I would double check the syntax for the shortcode. That doesn’t look quite right to me.

  5. How can I set the thumbnails to automatically go to 180 x 180?

    • fish

      You should be able to set the thumbnail width and height in your settings panel for getshopped. :-)

  6. 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

    • fish

      Sorry, i havent had a chance to look at this… did you find a solution?

  7. I’m getting a parse error when changing that line on 450. Any ideas?

    • fish

      Afraid not mate.. Are you still getting it?

  8. 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,

    • fish

      Sorry for the late response…. are you still having problems with this?

  9. 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?

    • FCW

      Hi Jon

      I would not imagine that you need a dedicated server. But it depends on the size of the site and the amount of traffic it gets. Do you have visitor stats?

      Andy

  10. Omer

    Hi,

    I have follow the steps you mentioned but my Single Product Page still showing no related products … Am i missing something?

    Thnx Heaps

    • FCW

      Hi Omer,

      Have you got this code in your wpsc-single_product.php file MRP_show_related_posts()?

  11. Thanks for this. Was just what I was looking for my product pages.

    Would never have manage this without your help!

  12. 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

    • FCW

      Hello

      You need to ensure the code is wrapped in php tags -

      < ?php ...code here... ?>

  13. 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?

    • FCW

      Hi

      You should be able to do the same thing. Essentially you need to find the code that outputs the text and replace it with

      ID,’single’).”" >

      I’m not at my computer right now but will confirm that when I’m back at it. :-)