Flash sale: Get up to 30% off themes and extensions. Ends April 26 at 3 pm UTC. Shop the sale.
  1. Documentation /
  2. Product Likes

Product Likes

Installation

↑ Back to top

Download, install and activate the extension.

It is strongly recommended you initially use a staging/development environment and test the extension before use on a production website.

If you haven’t already, connect your store to your WooCommerce account. This ensures you get extension update notifications when available.

Quick start guide

↑ Back to top
  • Perform the installation steps above
  • Go to WooCommerce > Settings > Products > Product likes
  • Configure the settings as required, we recommend using the defaults
  • Once the settings have been saved products throughout your store will shown like buttons as per the settings used
  • Once you have built up a number of likes go to Products > Likes to access the likes dashboard which shows how many likes products/customers have and you can view which products have been liked/which products specific customers have liked

Settings

↑ Back to top

You can access the settings at WooCommerce > Settings > Products > General > Product Likes.

It includes several configuration options including enabling like buttons for non-logged in users, my account likes list, display preferences, icon types and more.

Configuration of product likes settings
  • Enable
    • Enables product likes across your store, ensure you also enable at least one of the display options below.
  • Enable if not logged in
    • Allows users without an account to like products, user will see their likes on products for 30 days or until cookies cleared. After this period likes by a not logged in user will still count towards the total number of product likes.
  • Enable in account
    • Adds a page within the user’s account listing the products previously liked.
  • Display on product pages
    • Displays a product like button on product pages. This is displayed via the woocommerce_product_meta_start hook which all themes generally include, if this setting is enabled and it is not displayed then ask your theme developer how to enable this hook, if you are using a page builder it should include a product meta block you can add to your page which will include this hook. Alternatively you can display this using the alternative woocommerce_after_add_to_cart_form hook by adding add_filter( 'wcpl_product_likes_products_alternative_hook', '__return_true' ); to your theme’s functions file, however this is not recommended as this hook is not used if a product is not purchasable (e.g. out of stock).
  • Display on product archive pages
    • Displays a product like button on each product in an archive page (e.g. shop page, product categories, search, etc). This is displayed via the woocommerce_after_shop_loop_item hook which all themes generally include, if this setting is enabled and it is not displayed then ask your theme developer how to enable this hook, if you are using a page builder it should include a product archive (or similar name) block you can add to your page which will include this hook.
  • Display on product blocks
    • Displays a product like button on each product in any core WooCommerce product block (excluding the All Products block due to extensibility constraints).
  • Display total likes
    • Displays the total number of likes if a product has been liked.
  • Icon
    • Icon type used for product likes. If you wish to use a custom icon set this to none (or disable styles entirely) and apply your own with custom CSS.
  • Styles
    • Adds styles to product likes, if disabled this will remove all styles from product likes including the icon chosen, this option should only be disabled if you wish to style product likes yourself with CSS.

Display

↑ Back to top

Product like buttons and total likes are shown on the product page and on each product in an archive page (e.g. product category), you can disable the display on either of these areas if needed. You can select the icon type (heart, thumb or none) or choose to remove all styling and style yourself with CSS.

Products on category/search pages showing like buttons
Like button displayed on product page

Dashboard

↑ Back to top

The likes dashboard can be accessed via Products > Likes and shows a list of your products and their likes total. You can click a like total to see which customers/how many guests liked the product. The likes dashboard and be searched/sorted and you can export/print all the data. It also includes a customer totals section which lists all customers, how many likes they’ve made and you can click the total likes to see which products they liked.

Outside of the likes dashboard you can also see the total number of likes in a designated column on the product listings.

Likes dashboard showing all hoodies with likes totals

Technical information

↑ Back to top

Non-logged in users

↑ Back to top

For users who aren’t logged in their likes will count towards the product’s like total and their likes will remain visible when they visit your store until their cookie expires or is deleted. You can disable this option if needed via settings.

Post meta

↑ Back to top

This extension stores product post meta with the key _wcpl_product_likes_likes for the total number of likes. This post meta should not be created/updated through the database, import, custom development or by using clone page/post/product plugins (with the exception of using the duplicate link on products in the dashboard product list) as it is related to data stored outside post meta in a database table for each individual like and both should remain in sync. If the post meta is added/updated you may see inconsistencies when attemping to like or unlike products.

If you have attempted to create/update this post meta and have issues then you can resync the post meta by logging into your dashboard as an administrator and adding the query string wcpl_product_likes_debug_post_meta=1 to the admin URL and pressing enter e.g. http://localhost/area51/wp-admin/?wcpl_product_likes_debug_post_meta=1.

Custom development

↑ Back to top

The following information is provided for custom development purposes for web developers, they are useful if you wish to add custom features or modify how the extension works. As per the WooCommerce support policy we cannot offer any support for your use of these custom development features.

Filter hooks

↑ Back to top
Filter hookDescription
wcpl_product_likes_likes_none_textChange text in my account when no products yet liked
wcpl_product_likes_likes_textChange likes text
wcpl_product_likes_like_textChange like text
wcpl_product_likes_products_alternative_hookReturn false to use default woocommerce_product_meta_start action hook, return true to use woocommerce_after_add_to_cart_form (not recommended) – see display on product pages information in settings for further details
wcpl_product_likes_total_after_textChange text which appears after total likes
wcpl_product_likes_total_before_textChange text which appears before total likes
wcpl_product_likes_unlike_textChange unlike text

BETA functionality

↑ Back to top

We may occasionally include BETA functionality, this is highlighted with a (BETA) label. Functionality with this label should be used with caution and is only recommended to be tested on a staging/development environment. The functionality is included so users can test the functionality/provide feedback before it becomes stable, at which point the (BETA) label will be removed. Note that there may be occasions where BETA functionality is determined unsuitable for use and removed entirely.

Caching

↑ Back to top

If you are using any form of caching then it is recommended that the cache lifespan/expiry should be set to 10 hours or less. This is recommended by most major caching solutions to avoid potential issues with WordPress nonces.

Cookies

↑ Back to top

This extension may set the following cookies, it is recommended you include details of these cookies in your cookie policy.

NameDescriptionExpiry
wcpl_product_likesUsed to give a unique ID to a user who isn’t logged in so their likes are remembered until the cookie is removed.30 days

Screen sizes

↑ Back to top
  • Frontend: Where elements may be displayed they will fit within the screen width
  • Backend: Where interfaces may be displayed it is recommended to use a desktop computer with a resolution of 1920×1080 or higher, for lower resolutions any interfaces will attempt to fit within the screen width but some elements may be close together and/or larger than the screen width

Translation

↑ Back to top

We generally recommend Loco Translate to translate and/or adapt text strings within this product.

Works with

↑ Back to top

Where we have explicitly stated this product works with another product, this should only be assumed accurate if you are using the version of the other product which was the latest at the time the latest version of this product was released. This is because, while usually unlikely, the other product may have changed functionality which effects this product.

FAQs

↑ Back to top

Is it compatible with a specific theme?

↑ Back to top

This extension will generally be compatible with most themes. There may be a small number of themes that are fully or partially incompatible due to clashes in functionality and/or if the theme has removed or adapted core WooCommerce functionality. If you would like to know if a specific theme will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the theme requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the theme and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Is it compatible with a specific extension/plugin?

↑ Back to top

This extension will generally be compatible with most extensions/plugins. There may be a small number of extensions/plugins that are fully or partially incompatible due to clashes in functionality and/or if the extension/plugin has removed or adapted core WooCommerce functionality. If you would like to know if a specific extension/plugin will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the extension/plugin requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the other extension/plugin and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Is it compatible with a specific page builder?

↑ Back to top

This extension will generally be compatible with most page builders. There may be a small number of page builders that are fully or partially incompatible due to clashes in functionality and/or if the page builder has removed or adapted core WooCommerce functionality. If you would like to know if a specific page builder will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the page builder requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the page builder and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Support

↑ Back to top

If you need any further assistance with this extension please contact us. Please note that extension support does not include providing assistance with any custom development requirements as per the WooCommerce support policy.