Reserve Your Free Seat for Our Next WooCommerce Class! Search
Business Bloomer
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • 0
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • Search
  • Contact
  • Cart
WooCommerce Code Snippets My Account Product Reviews

WooCommerce: Add “Leave a Review” Column to Downloads Table

Last Revised: Feb 2025

STAY UPDATED

In a recent blog post, we discussed a way to display “Leave a Review” buttons inside the WooCommerce My Account page; I shared a solution that adds a custom table listing purchased products, but this time, we’re enhancing the default Downloads table by adding a new column.

This snippet modifies the WooCommerce My Account downloads section, ensuring customers can leave product reviews directly from their available downloads. The button appears only for products that haven’t been reviewed yet.

Here’s the PHP snippet to implement this feature!

Here I add a custom table to the existing “Downloads” table under WooCommmerce My Account, and this features buttons to leave product reviews!

PHP Snippet: Display Review Buttons in WooCommerce My Account Downloads

The snippet first adds a new “Review” column to the existing downloads table using woocommerce_account_downloads_columns.

Then, it retrieves the customer’s previous reviews and checks if a review for the downloaded product already exists. If not, it displays a “Leave a Review” button linking to the product’s review section. If the review has already been submitted, it simply shows a “Reviewed” text instead.

This approach ensures that customers are encouraged to review their downloads while keeping the WooCommerce My Account page clean and user-friendly!

/**
 * @snippet       Review Products @ My Account Downloads
 * @tutorial      https://businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 9
 * @community     https://businessbloomer.com/club/
 */

add_filter( 'woocommerce_account_downloads_columns', 'bbloomer_add_review_column' );
add_action( 'woocommerce_account_downloads_column_review', 'bbloomer_display_review_button' );

function bbloomer_add_review_column( $columns ) {
    $columns['review'] = __( 'Review', 'woocommerce' );
    return $columns;
}

function bbloomer_display_review_button( $download ) {
    $product = wc_get_product( $download['product_id'] );
    
    if ( ! $product ) {
        return;
    }

    $customer = new WC_Customer( get_current_user_id() );
    $reviewed_products = [];
    $comments = get_comments( array(
        'author_email' => $customer->get_billing_email(),
        'type' => 'review',
        'status' => 'approve',
    ));

    foreach ( $comments as $comment ) {
        $reviewed_products[] = $comment->comment_post_ID;
    }

    if ( ! in_array( $product->get_id(), $reviewed_products ) ) {
        echo '<a class="button alt" href="' . esc_url( get_permalink( $product->get_id() ) . '#tab-reviews' ) . '">' . esc_html__( 'Add a review', 'woocommerce' ) . '</a>';
    } else {
        echo esc_html__( 'Reviewed', 'woocommerce' );
    }
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Separate Login, Registration, My Account Pages
    There are times when you need to send logged out customers to a Login page and unregistered customers to a standalone Register page. As you…
  • WooCommerce: Add New Tab @ My Account Page
    One of the features of Business Bloomer Club is the provision of Premium WooCommerce Q&A Support to supporters who enroll. So, how to add an…
  • WooCommerce: How To Make A Website GDPR Compliant? (12 Steps)
    Ok, we all know that the EU General Data Protection Regulation (GDPR) will come into force on the 25th May 2018. So the main question…
  • WooCommerce Visual Hook Guide: My Account Pages
    Hey WooCustomizers, the Visual Hook Guide is back 🙂 In this episode, I’ve created a visual HTML hook guide for the WooCommerce Account Pages (there…
  • WooCommerce: Add First & Last Name to My Account Register Form
    Here’s yet another useful PHP snippet – and a mini-plugin alternative with super simple settings – that adds the Billing First Name and Billing Last…

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Cancel reply

Your email address will not be published. Required fields are marked *


Search WooCommerce Tips

Popular Searches: Visual Hook Guides - Checkout Page - Cart Page - Single Product Page - Add to Cart - Emails - Shipping - Prices - Hosting

Recent Articles

  • WooCommerce: How to Stop Spam Orders on Free Products
  • WooCommerce: How to Configure Product and Order Sync
  • WooCommerce: “Beautify” Item Meta in Order Emails
  • WooCommerce: Per-Product Checkout Fees / Tariffs
  • WooCommerce: Auto-Cancel Orders After 3 Failed Payments

Latest Comments

  1. Eduard on WooCommerce Add To: Cc: Bcc: Email Recipients Mini-Plugin
  2. Rodolfo Melogli on WooCommerce: Remove “Payments” From WordPress Sidebar Admin Menu
  3. Rodolfo Melogli on WooCommerce: Remove “Payments” From WordPress Sidebar Admin Menu

Find Out More

  • Become a WooCommerce Expert
  • Business Bloomer Club
  • WooCommerce Blog
  • WooCommerce Weekly
  • Contact

Contact Info

Ciao! I'm Rodolfo Melogli, an Italian Civil Engineer who has turned into an international WooCommerce expert. You can contact me here:

Twitter: @rmelogli

Get in touch: Contact Page

Business Bloomer © 2011-2025 - VAT IT02722220817 - Terms of Use - Privacy Policy

Cart reminder?

x