Download the PHP package mage2kishan/module-live-activity without Composer

On this page you can find all versions of the php package mage2kishan/module-live-activity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-live-activity

Magento 2 Live Activity

Live Activity shows small notification cards on the storefront that describe recent customer activity: purchases, cart additions, wishlist additions, a live viewer count, a trending view count and a low stock alert. Each card can show a product thumbnail and an activity icon, and clicking or tapping it opens the product page.

The numbers come from two sources that can be used together. Real purchase, cart and wishlist events are recorded by event observers and read back from a database table. Simulated notifications are generated on every request with random names, locations, timestamps and counts. The live viewer count and the trending view count are always random; a low stock alert is only shown when the product's real stock quantity is between 1 and 10. The module is used by store owners who want social proof messages on their storefront, and it ships one template with separate CSS rules for Hyva and Luma themes.

Product page: kishansavaliya.com/magento-2-live-activity.html

Features

Compatibility

Platform Versions
Magento Open Source 2.4.4 to 2.4.8 (as published on the product page)
Adobe Commerce 2.4.4 to 2.4.8 (as published on the product page)
PHP 8.1, 8.2, 8.3, 8.4 (from composer.json)
Themes Hyva and Luma

Composer constraints on Magento packages: magento/framework ^103.0, magento/module-catalog ^104.0, magento/module-sales ^103.0, magento/module-checkout ^100.4, magento/module-wishlist ^101.0, magento/module-store ^101.1, magento/module-backend ^102.0, magento/module-config ^101.2, magento/module-catalog-inventory ^100.4.

Requirements

Installation

setup:di:compile is only needed in production mode. setup:static-content:deploy is listed because the module ships an admin JavaScript file under view/adminhtml/web/js/.

Check the result with:

Configuration

Go to Stores > Configuration > Panth Extensions > Live Activity & Social Proof. The tab label in etc/adminhtml/system.xml is "Panth Extensions" with a rocket emoji in front of it, which is omitted here. The section is also reachable from the admin menu under Panth Extensions > Live Activity > Configuration. All fields can be set at default, website and store view scope.

General Settings

Setting Default What it does
Enable Live Activity Yes Master switch. When set to No the block renders nothing, the AJAX endpoint returns a "disabled" response and observers stop recording activity.
Show On Pages Product pages Page types where notifications may appear: product, category, home, search results and CMS pages. Cart, checkout and customer account pages never show notifications.
Notification Position Bottom Left Corner of the viewport where cards appear. Shown when the module is enabled.
Display Delay (seconds) 5 Wait before the first notification (0 to 60).
Notification Duration (seconds) 5 How long each card stays on screen (3 to 30).
Interval Between Notifications (seconds) 8 Pause between one card closing and the next opening (5 to 120).
Maximum Notifications Per Page 10 Cap per page view; 0 means unlimited.

Activity Types to Display

Setting Default What it does
Show Recent Purchases Yes Shows " from purchased
Show Cart Additions Yes Shows " from added to cart
Show Wishlist Additions Yes Shows " from added to wishlist
Show Live Viewers Count Yes Shows " people are viewing this right now". Simulated only.
Show Trending Products Yes Shows "Trending: views in the last hour". Simulated only.
Show Low Stock Alerts Yes Shows "Stock Alert: Only items left!". Simulated only. Uses the real stock quantity and is shown only when it is between 1 and 10.

Data Source Settings

Setting Default What it does
Use Real Activity Data Yes Records purchase, cart and wishlist events and includes them in the feed.
Use Simulated Activity Yes Adds 3 to 7 generated notifications to every feed response.
Activity Time Range Last 24 Hours How far back real events are read. Shown when Use Real Activity Data is Yes.
Anonymize Customer Names Yes No longer changes the output. Logged-in customers are always stored and shown as first name plus last initial (for example "John D."), whatever this setting is.
Featured Product IDs empty Comma-separated product IDs chosen with the product picker. When set, simulated notifications use only these products; when empty, up to 50 enabled, visible products are used.
Fake Customer Names 15 sample names JSON list of names used for simulated notifications. Shown when Use Simulated Activity is Yes.
Fake Customer Locations 15 sample cities JSON list of locations used for simulated notifications only. Shown when Use Simulated Activity is Yes.

Appearance Settings

Setting Default What it does
Animation Style Slide In Entrance animation: Slide In, Fade In, Bounce In or Scale Up.
Show Product Image Yes Shows a 90x90 product thumbnail when the product has an image.
Show Activity Icon Yes Shows an SVG icon for the activity type.
Custom CSS empty Appended to the inline style block of the template. Any < character is written as the CSS escape \3C so the value cannot close the style tag.

Advanced Settings

Setting Default What it does
Exclude Categories empty Products in these categories are left out of the simulated product pool. Real events are not filtered.
Enable on Mobile Yes When No, the script exits on viewports narrower than 768px and on touch devices with a mobile user agent.

Config paths:

Default behaviour after installation: the module is enabled, all six types are on, real and simulated data are both on, and notifications appear bottom left on product pages after 5 seconds.

Usage

Where notifications appear

The block live.activity.notifications is added to the after.body.start container by view/frontend/layout/default.xml, and the block renders only on the page types selected in Show On Pages (never on cart, checkout or customer account pages). On checkout it is also removed by layout: checkout_index_index.xml and multishipping_checkout.xml remove the block, and a CSS rule hides it on body.checkout-index-index, so it never covers the Place Order button. On a product page the block reads the id request parameter and passes it to the endpoint, so real events are limited to that product (plus events with no product); on other pages all real events for the current store are used.

Notification types and data sources

Type Real data Simulated data
Purchase One row per visible order item on sales_order_place_after. Random name, location and time 5 to 180 minutes ago.
Cart addition Recorded on checkout_cart_product_add_after. Same as above.
Wishlist addition Recorded on wishlist_add_product. Same as above.
Live viewers Not recorded. Random count between 3 and 25.
Trending Not recorded. Random count between 30 and 150 views "in the last hour".
Low stock Not recorded. The real stock quantity of the product; skipped unless that quantity is between 1 and 10.

For real events the stored customer name is the logged-in customer's first name plus last initial or, for guests, a random first name from a fixed list plus a random initial. No location is stored for real events; the module does not read the customer's address. Names already stored in full by earlier versions are shortened to first name plus last initial when the feed is built, but locations already stored with older real events are returned as stored until those events fall outside the time range.

What is simulated: every entry with "is_real": false in the feed is invented, including its name, location, time and product choice. The live viewer count, the trending view count and the stats numbers (current_viewers, views_today, cart_adds_today, purchases_today) are always random; the stats block is only returned when Use Simulated Activity is Yes and then carries "simulated": true. The low stock quantity is always the real stock quantity. Every simulated entry names a real, visible product; entries that cannot be given one are dropped. Only entries with "is_real": true come from real purchases, cart additions and wishlist additions.

Feed and refresh interval

The endpoint liveactivity/ajax/getactivity (GET, optional product_id) returns up to 10 real events within the configured time range (the cutoff and the age of each event are calculated by the database, so PHP and database time zones cannot drift apart) plus 3 to 7 simulated entries, sorted by timestamp and cut to 20 entries. The storefront script fetches this feed once per page view (after requestIdleCallback, or 500 ms after DOM ready), waits for the display delay, then shows one card at a time for the configured duration, pauses for the configured interval and moves to the next entry. When it reaches the end of the list it starts again from the beginning until the maximum per page is reached. There is no polling; new data is only fetched on the next page load. Each card has a close button and a progress bar that runs for the duration; the timer and the progress bar pause while the pointer is over the card or a control inside it has keyboard focus, and resume with the remaining time. Closing a card stops further cards for the rest of the browser session (a panthLiveActivityDismissed flag in sessionStorage). Each card is announced through a polite role="status" region, the product name is a keyboard-focusable link and the close button has a 44 px hit area. With Top Left or Top Right the card is placed 12 px below the visible header. The card never covers primary actions (add to cart button, quantity, swatches and options, sticky add-to-cart bars, cart checkout buttons): if it would, it switches to the opposite edge, and if both edges would cover one it stays hidden with its timer paused until scrolling frees a spot. The check runs when the card appears and on scroll and resize.

Caching

The module does not store the feed in any Magento cache. The JSON endpoint returns a plain JSON result without layout, so it is not served from the full page cache. The product collection used for simulated notifications is fetched once per request. Product thumbnails are requested through the standard catalogue image helper at 90x90 pixels.

Templates and styling

Developer Notes

Key classes:

Dependency injection: etc/di.xml is empty. etc/frontend/di.xml adds Panth_LiveActivity to the registeredModules argument of Panth\Core\ViewModel\ThemeConfig. No plugins or preferences are declared.

ACL resource: Panth_LiveActivity::config ("Panth Live Activity Configuration") under Magento_Config::config.

Database tables from etc/db_schema.xml:

Uninstallation

The tables panth_live_activity and panth_live_activity_stats and the live_activity/* rows in core_config_data are not removed by these commands; drop or delete them manually if you no longer need them. mage2kishan/module-core stays installed if other modules depend on it.

Support

Documentation

USER_GUIDE.md walks an administrator through installation, verifying the extension is active, each configuration group, the featured product picker, fake names and locations, how notifications work and troubleshooting.

License

Free and open source under the MIT License. See LICENSE.txt.

Changelog

See CHANGELOG.md.

Links


All versions of module-live-activity with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0||~8.2.0||~8.3.0||~8.4.0
mage2kishan/module-core Version ^1.0
magento/framework Version ^103.0
magento/module-catalog Version ^104.0
magento/module-sales Version ^103.0
magento/module-checkout Version ^100.4
magento/module-wishlist Version ^101.0
magento/module-store Version ^101.1
magento/module-backend Version ^102.0
magento/module-config Version ^101.2
magento/module-catalog-inventory Version ^100.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mage2kishan/module-live-activity contains the following files

Loading the files please wait ...