Support » Plugins » WooCommerce: remove related products info

Viewing 15 replies - 1 through 15 (of 26 total)
  • I just did this. This worked for me, and hasn’t broken anything so far.

    Go to wp-content/plugins/woocommerce/woocommerce-hooks.php

    In the woocommerce-hooks.php file, comment out the following line (it is at line 51 in my version) under the comment After Single Products Summary Div:

    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);

    Result:
    /* add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); */

    Now I am trying to figure out how to format the single product page. It is pretty gross, very narrow for no reason. Given that there will only be one product on a detail page, it is really bad design to format that page with the tiniest thumbnail and a very narrow column. If you have any hints about fixing that formatting, please post!

    Thanks! I just took that and modified slightly and put in my functions.php file in my child theme. I was a little worried about modifying the actual plug-in files, and I had already figured out how to remove the sidebar on all WooCommerce pages using a functions.php file, so I figured I could add it to that. Worked great!

    Here’s what I put in my functions.php file, based on your suggestion:

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);

    I think your product page layout will really vary depending on what theme you are using. From what I understand, WooCommerce looks great with some themes and not so great with others. I’m using TwentyEleven. Here’s a link to one of my product pages, if you want to see how that theme looks with WooCommerce:

    http://ultimateshowstoppers.com/wordpress/shop/doorstopper-c34-ss/

    Still working on the site, but it’s getting there.

    The site is really nice. Clean and simple.

    In WooCommerce you can override the use of the plugin’s CSS, but that leads to other problems on the shop and category pages, so I think I need to work with the Woo CSS and the single product page itself. I’m using Genesis + ClipCart66 child theme.

    Best of luck with wrapping up your site. We all know that the last bit of work can take as long as the first 80%.

    @texins5 @lynn

    Thanks for the code snippet. I didn’t want to mod the core plugin either because of upgrades and all. Texins suggestion of adding it to functions.php worked perfectly. Thanks.

    How to resized related products for woocommerce plugin wordpress
    Find woocommerce\assets\css\woocommerce.css if you see

    .related ul.products li.product img, .upsells.products ul.products li.product img, .related ul li.product img, .upsells.products ul li.product img{
    height: auto;
    width: 100%;
    }

    edit width: 100%; to width: 30%; or other number you want to resized.

    Thank you very much as this helped me as well!!

    Thanks, useful information !

    I’m setting up web shop and I use the sommerce theme and the latest versions of WP and Woocommerce.

    What I want is not remove the Related Products but change it from left to right in de tab bar. It is very annoying if you open the product page that not immediately the Description is showing but instead Related Products.

    Where can I change this “order”

    See this example:
    http://www.rembrandtlights.com/?product=high-power-4-channel-led-flasher

    Thanks,

    Janusz

    Hey JanuszJG Hi,

    1 Question for you can you please tell me how did you get the related products tab on each products page ??
    I want that feature on my site and I don’t know how to enable it. You can see this example – http://wh10.droa.com/~c1182561/product/vitamin-c-cream/

    sschmitt

    (@sschmitt)

    Try this plugin:

    woocommerce-custom-product-tabs-lite

    There is also this code you can put in your themes functions.php file:

    http://pastebin.com/N39FFBgK

    I think this is useful to you,

    In woocommerce\templates\single-product\related.php page line no 29 like if ( $products->have_posts() ) : ?>

    <div class=”related products”>

    <h2><?php _e(‘Related Products’, ‘woocommerce’); ?></h2>

    <ul class=”products”>

    <?php while ( $products->have_posts() ) : $products->the_post(); ?>

    <?php woocommerce_get_template_part( ‘content’, ‘product’ ); ?>

    <?php endwhile; // end of the loop. ?>

    </div>

    <?php
    endif;

    if you comment on this code(put before the code /* and end with */), then that related products are not displayed in single product page.

    I’ve solved this same problem using a slightly different approach. Instead of removing the hook, I’ve just overridden the template in my theme. The related products are queried in the WooCommerce template, so overriding the template removes that overhead (and it was an overhead of several seconds for me, as the query was randomising up to 10,000 products, before picking five, and that was heavy lifting for the database).

    This method also means I can put my own alternative “related products” into the template.

    The template is:

    {your-theme}/woocommerce/single-product/related.php

    Just create an empty file in that location and the related products will be gone.

    — Jason

    Thanks for this code- worked great!

    I have seen so many posts on editing or hiding the Related Products code set for Woocommerce, but I need help moving only the Related Products to another area of my page… I am super new to Woo Commerce, I just can’t for the life of me figure out how to move ONLY the related products section to another place on my page…

    Please help!!

    Anyone out there would be willing to help with woocommerce. My client wants the products listed on a single page with out showing the thumbnail product images. Is the an easy way to do that? Also, how can I display more details about a product on a “[recent_products per_page=”12″ columns=”4″ orderby=”date” order=”desc”]” type page? Thanks in advance!!!

    Another way to remove the related products from the bottom of a product page is by adding the following to your style.css:

    .related.products { display: none; }

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘WooCommerce: remove related products info’ is closed to new replies.