WOOT - WooCommerce Active Products Tables

WooCommerce wishlist table with filters and add to cart

A WooCommerce wishlist table lets customers collect the products they like and come back to them as a real products table, with filters, sorting, quantities and the add to cart button, instead of a plain list of links. The products table plugin has this built in: the Favourites feature adds a heart to every row, and any table can be switched to show only the products the current visitor has hearted. Below is how the list is stored, how to build the wishlist page step by step, the quick alternatives, and the details that matter in production.

How Favourites works

Favourites is part of the plugin and always active, so there is nothing to install or enable. It gives you three pieces: a Favourites column with a heart icon, the Favourites only rule for full tables, and two shortcodes, [woot_favourites] and [woot_favourites_single_btn].

Where the list is kept depends on the visitor:

  • Logged-in customers. The list is saved in their user account (user meta woot_favourites), so it stays permanently and follows them to any device.
  • Guests. The list is saved on the server for the visitor's IP address and expires one day after the last change. When a guest logs in, the guest list is merged into the account list.

The list holds product IDs only. Prices, stock and titles are always read fresh when a table shows the list, so a wishlist never shows an outdated price.

Step 1: add the heart to your product tables

  1. Open WOOT → Tables, open the table where customers browse products and go to its Columns tab.
  2. Add a column and choose the Favourites field. Drag it next to the title or the add to cart column.

Each row now has a heart. A click adds the product to the visitor's list; a second click asks for confirmation and removes it. Under every heart there is a My Favourites link that opens the current list in a popup, so customers can check their wishlist without leaving the page.

Step 2: a WooCommerce wishlist table page

The popup list is compact. For a wishlist page with the full power of a products table, create a separate table that shows only the visitor's favourites:

  1. In WOOT → Tables create a new table, for example Wishlist.
  2. In its Predefinition tab switch on Favourites only.
  3. In the Columns tab add what customers need to buy: thumbnail, title, price, stock, quantity and add to cart. Add the Favourites column too, so customers can remove items right in the wishlist.
  4. Add filter elements, sorting and the search by title in the Filter and Options tabs if the lists in your shop get long.
  5. Create a page called Wishlist, put the table's shortcode on it, for example [woot id=7], and link the page from your menu or account area.

The table loads its rows by AJAX for the visitor who opens the page, so every customer sees their own list even when the page itself is served from a page cache. A product whose heart is cleared leaves the table the next time the table loads its rows, for example after a reload or a page change.

When the list is empty

The Favourites only rule narrows the table to the products in the list. When the list is empty, for example for a guest who has not hearted anything yet or a customer who removed the last item, the rule has nothing to narrow by, and the table shows all products. To show an empty wishlist instead, with your own message, add this code and replace 7 with the ID of your wishlist table:

/*
 * Wishlist table #7 with "Favourites only": show no products while the
 * visitor's list is empty, and a custom message instead of "No Data!".
 * Child theme functions.php or a code snippets plugin.
 */
add_filter('woot_wp_query_args', function ($args, $table_id) {
    if (intval($table_id) === 7 && empty($args['post__in'])) {
        $args['post__in'] = [0];
    }
    return $args;
}, 20, 2);

add_filter('woot_no_found_text', function ($text, $table_id) {
    return intval($table_id) === 7 ? 'Your wishlist is empty.' : $text;
}, 10, 2);

The first filter uses woot_wp_query_args: when no product IDs are set for the query, it asks for product ID 0, which does not exist. Priority 20 makes it run after the plugin's own Favourites rule.

The quick list: [woot_favourites]

The [woot_favourites] shortcode prints the current list on any page without creating a table. It is the same list as in the My Favourites popup.

[woot_favourites]Table with Favourites only
ColumnsOne global set: Favourites columns in the plugin SettingsAny columns, per table
Filter and searchNoYes
SortingBy title first; sortable columns are sorted in the browserAny sortable column
Remove from listAn X button in every rowThe Favourites heart column
Empty listThe No Data! messageCan show all products; add the code above
Page cacheThe list is printed into the page: exclude the page from cachingSafe: the rows load by AJAX

Its columns are chosen once for the whole site in the Favourites columns setting on the plugin's Settings tab (ID, title, price, SKU and add to cart by default). Useful attributes are per_page (10 by default) and skin, for example [woot_favourites per_page=20].

The share attribute adds a share link for logged-in customers. Set it to the address of the page that holds the shortcode: [woot_favourites share="https://example.com/wishlist/"]. The customer sees a link ending with ?user_id= and their user ID, and whoever opens it sees that customer's list. Anyone who changes the number in such a link can see another customer's list, so use share only where wishlists are not private.

A heart on the single product page

[woot_favourites_single_btn] shows the heart for the current product and a My Favourites link that opens the list in a popup. It takes the product ID from the page, or from the id attribute. In a classic theme, add it under the add to cart button with a hook:

/*
 * Favourites heart on the single product page, below add to cart.
 * Child theme functions.php or a code snippets plugin.
 */
add_action('woocommerce_single_product_summary', function () {
    echo do_shortcode('[woot_favourites_single_btn]');
}, 35);

In a block theme, edit the Single Product template in the Site Editor and add a Shortcode block with [woot_favourites_single_btn] instead. Whether this heart is drawn filled is decided when the page is built, so on cached product pages a guest may see the state stored in the cache rather than their own; the list itself is always saved correctly. More placements are described in how to insert shortcodes into the single product page.

Other wishlist plugins

If the shop already runs another wishlist plugin, its button cannot simply be placed into the table. Such buttons are activated by their plugin's script when the page loads, while table rows arrive later by AJAX and are redrawn on every page change, sort and filter, so the buttons stay inactive or lose their state. The built-in Favourites is made for the table and works with all its features. If you switch, link the new wishlist page where the old one was.

If the wishlist behaves unexpectedly

  • Guests see each other's products. Guest lists are tied to the IP address, so visitors behind the same office network or mobile carrier gateway share one list. If every guest shares the same list, the server sees the IP of a proxy or CDN instead of the visitor's: ask your hosting to pass the real visitor IP to PHP. Logged-in customers are not affected.
  • A guest's list is gone the next day. Guest lists expire one day after the last change. Invite customers to log in; the guest list is moved into the account at login.
  • Visitors see someone else's list on a [woot_favourites] page. A page cache stored the page with one visitor's list in it. Exclude that page from the cache, or use a table with Favourites only.
  • The wishlist page shows all products. The list is empty; add the code from the empty list section.
  • Hearts do nothing. The heart sends an AJAX request like the table itself; a script optimizer that delays or combines the plugin's scripts stops it. Exclude the plugin folder from those features.

If something else does not work, open a topic on the WOOT support forum with the link to your wishlist page and the table ID.