Skip to content

Social proof notifications

Social proof notifications are floating messages (toast notifications) that inform visitors about recent purchases made by other customers. This social proof mechanism encourages purchases by showing that other customers are actively buying from the store.

Go to WooCommerce > Polski > Storefront modules and enable Social proof. The notifications will start appearing automatically based on recent WooCommerce orders.

  • Floating notifications about recent purchases
  • Data pulled from real WooCommerce orders via AJAX
  • Transient API cache (5 minutes) for performance
  • Anonymization of customer names (e.g. “John K.”)
  • Configurable frequency and display time
  • Choice of on-screen position (4 corners)
  • Option to hide on mobile devices
  • Product thumbnail in the notification

Configuration in WooCommerce > Polski > Storefront modules > Social proof.

SettingDefaultDescription
display_interval30Interval between notifications (seconds)
display_duration5Display time of a single notification (seconds)
positionbottom-leftOn-screen position: bottom-left, bottom-right, top-left, top-right
anonymize_nametrueAnonymize customer names (John Smith -> John S.)
hide_on_mobilefalseHide notifications on mobile devices

Database option: polski_social_proof.

Each notification contains:

  • A product thumbnail
  • The customer’s name (with optional anonymization)
  • The product name with a link
  • The purchase time (e.g. “2 hours ago”)

Example: John K. bought Polo shirt - 2 hours ago

Notifications are generated from recent WooCommerce orders with the completed or processing status. The module fetches up to the 20 most recent orders and rotates them randomly in the notifications.

Order data is cached in the transient API with an expiration time of 5 minutes (polski_social_proof_data). This way the notifications do not generate database queries on every display.

  • JavaScript: assets/js/social-proof.js

The script is loaded conditionally and fetches data via an AJAX endpoint.

// Filter the data shown in the notification
add_filter('polski/social_proof/notification_data', function (array $data): array {
// Hide products from a specific category
if (has_term('vip', 'product_cat', $data['product_id'])) {
return [];
}
return $data;
});
// Change the number of orders fetched for rotation
add_filter('polski/social_proof/orders_limit', function (): int {
return 50;
});
// Change the cache time
add_filter('polski/social_proof/cache_expiration', function (): int {
return 10 * MINUTE_IN_SECONDS;
});
  • .polski-social-proof - notification container
  • .polski-social-proof--visible - visible state (with animation)
  • .polski-social-proof__image - product thumbnail
  • .polski-social-proof__content - notification content
  • .polski-social-proof__name - customer name
  • .polski-social-proof__product - product name
  • .polski-social-proof__time - purchase time
  • .polski-social-proof__close - close button

social_proof

Notifications do not appear - check that the store has orders with the completed or processing status. The module requires at least one order to display notifications.

Notifications appear too often / too rarely - adjust the display_interval and display_duration settings.

Notifications cover other elements - change the position in the settings or adjust the z-index in CSS: .polski-social-proof { z-index: 9999; }.

Reporting issues: github.com/wppoland/polski/issues

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.