Support » Plugin: WP e-Commerce Related Products » Displaying unrelated products when related products are not available

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Onnay Okheng

    (@onnayokheng)

    Hola,

    Yes, if product doesn’t has any related product, this plugin will show random products. But if you want remove random products, modify “wpec-related-product.php”

    found this:

    if(!$related_product->have_posts()){
    
                     $query = array (
                        'showposts' => $number,
                        'orderby'   => 'rand',
                        'post_type' => 'wpsc-product',
                        'post__not_in' => array ($post->ID),
                    );
                    $related_product = new WP_Query($query);
                }

    change with this:

    if(!$related_product->have_posts()){
    
                     return;
    
                }

    Cheers!

    Excellent! Worked perfectly! Thanks very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying unrelated products when related products are not available’ is closed to new replies.