Download the PHP package mage2kishan/module-price-drop-alert without Composer

On this page you can find all versions of the php package mage2kishan/module-price-drop-alert. 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-price-drop-alert

Magento 2 Price Drop Alert

Price Drop Alert adds a "Get Price Drop Alerts" form to product pages. Shoppers, either guests or logged-in customers, subscribe with their name and email and can optionally set a target price. The module stores the price at the time of subscription, checks the current price by cron at the configured interval (24 hours by default) and immediately when an administrator saves a product with a changed price, and sends a transactional email when the price has dropped (or has reached the target price). Merchants get an admin dashboard, a "Manage Alerts" grid and a per-alert detail page with a manual "Send Email" action.

The module ships two storefront templates: an Alpine.js template for Hyva and a vanilla JavaScript template for Luma.

Product page: kishansavaliya.com/magento-2-price-drop-alert.html

Features

Compatibility

Platform Versions
Magento Open Source 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8
Adobe Commerce 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8
PHP 8.1, 8.2, 8.3, 8.4
Themes Hyva (Alpine.js template), Luma (vanilla JavaScript template)

Composer constraints on Magento packages: magento/framework ^103.0, magento/module-catalog ^104.0, magento/module-configurable-product ^100.4, magento/module-customer ^103.0, magento/module-email ^101.0, magento/module-config ^101.0, magento/module-store ^101.0, magento/module-backend ^102.0, magento/module-ui ^101.0.

Requirements

No other packages are suggested by composer.json.

Installation

setup:di:compile is only required in production mode. In production mode run bin/magento setup:static-content:deploy for the admin area so the bundled Chart.js file (view/adminhtml/web/js/lib/chart.umd.min.js) is published.

Check that the module is enabled:

Configuration

Admin path: Stores > Configuration > Panth Extensions > Price Drop Alert. All settings can be set at default, website and store view scope.

General Settings

Setting Default What it does
Enable Price Drop Alerts Yes Shows the subscribe form on product pages, enables the AJAX endpoints and lets the product-save observer send alerts. When set to No, the form is not rendered and the endpoints answer with "Price alerts are disabled."
Product Page Display Style Compact Compact shows one "Notify me of a price drop" link that opens the form in a dialog (focus kept inside, Esc closes, focus returns to the link). Full form shows the whole subscription card on the page. Config path pricedropalert/general/display_style.
Allow Guest Subscriptions Yes When set to No, guests see a "Sign in" link instead of the name, email and target fields, and the subscribe endpoint rejects guest submissions with "Please sign in to subscribe to price alerts.". Logged-in customers still get the full form.

Email Notifications

Setting Default What it does
Email Sender Identity General Contact Store email identity used as the sender of the notification.
Email Template Price Drop Alert Notification Transactional template used for the notification. Editable under Marketing > Email Templates.

Price Check Schedule

Setting Default What it does
Check Frequency (hours) 24 Digits only, minimum 1. The cron job is scheduled hourly and skips a run until this many hours have passed since the last check (read at default scope; the last run time is stored in the flag table as pricedropalert_last_run).

Design & Colors

This group has no fields. Its comment points to a Tailwind theme configuration file (app/design/frontend/Panth/Infotech/web/tailwind/theme-config.json, section modules.price-drop-alert) for the CSS variables --pricedropalert-primary, --pricedropalert-btn-from, --pricedropalert-btn-to, --pricedropalert-box-border and --pricedropalert-heading that the storefront templates use. Both templates fall back to built-in colors when the variables are not defined.

Abuse Protection

Setting Default What it does
Requests per Window 10 Maximum number of subscribe or unsubscribe requests (counted separately) one client IP address may send per window. Further requests get HTTP 429 with "Too many requests. Please try again later.". 0 disables the limit.
Window Length (seconds) 600 Length of the fixed rate limit window.

Counters are kept in the Magento cache. The client IP is read with Magento\Framework\HTTP\PhpEnvironment\RemoteAddress, so behind a proxy or load balancer configure the trusted forwarded-for headers (x-forwarded-for and similar) in app/etc/env.php; otherwise all visitors share the proxy's address.

Configuration paths:

Admin menu entries (under the "Panth Extensions" menu provided by Panth_Core): "Price Drop Alerts" > "Dashboard" (pricedropalert/dashboard/index), "Manage Alerts" (pricedropalert/alert/index) and "Configuration" (opens the section above).

Usage

Subscribing on the product page

The block is only rendered when the module is enabled, the product has a resolvable price greater than zero, and the layout handle catalog_product_view is loaded. On page load the template calls pricedropalert/alert/status to find out whether an active alert already exists for the product and email; if it does, a "Price Alert Active" card with the current price, the target price (if any) and a "Remove" button is shown instead of the form.

On Hyva the Alpine.js component also reads the customer section data from mage-cache-storage to detect a logged-in customer, so the block works on pages served from full page cache.

How price drops are detected

Model\PriceResolver returns the price that is compared:

An alert is sent when:

Alerts with a current price of zero are skipped, as are alerts of store views where the module is disabled. Prices are resolved for the alert's store view. For alerts of registered customers the price is calculated for the customer's current customer group (tier and group prices and group-specific catalog price rules apply; bundle products use the default price info). Guest alerts use the NOT LOGGED IN price. After a successful send the alert status changes to "Sent/Notified" and sent_at is recorded; sent alerts are not checked again.

Two triggers run this check:

  1. Cron job pricedropalert_price_alert (group default, schedule 0 * * * *, class Cron\PriceAlertNotification). It runs when the configured Check Frequency has elapsed, loads active alerts in batches of 500 and logs how many were checked and sent.
  2. Observer Observer\ProductSaveAfterCheckAlerts on catalog_product_save_after. When the saved product's price, special_price, special_from_date or special_to_date changed, it checks the active alerts for that product (and, for a simple product, for its configurable parents) and sends emails immediately.

Email content

The notification uses the template "Price Drop Alert Notification" (pricedropalert_email_email_template, file view/frontend/email/price_alert.html, frontend area). Subject: "Great news! {{var product_name}} just dropped in price". Available variables: customer_name, product_name, product_url, product_price, old_price, new_price, old_price_formatted, new_price_formatted, discount_percent, has_discount ("1" when the saving rounds to at least 1 percent, otherwise empty), unsubscribe_url and store. The template shows the price when subscribed, the current price, the savings percentage (only when has_discount is set, so a manual send at an unchanged price does not show "You save 0%"), a "Shop Now" button linking to the product and an "Unsubscribe from price drop alerts" link (unsubscribe_url). The email is sent with the sender identity and template configured for the alert's store view. The default template shows old_price_formatted and new_price_formatted, which are converted to and formatted in the store view's default display currency. product_price, old_price and new_price are plain numbers with two decimals and no currency symbol.

Unsubscribing

Subscribers unsubscribe from the product page with the "Remove" button, which posts to pricedropalert/alert/unsubscribe and deletes the active alert row for that product and the customer's email (logged-in customers) or for the alerts created in the current browser session (guests). Every notification email also contains an unsubscribe link, pricedropalert/unsubscribe/index/id/<alert id>/token/<token>. The token is a random 32-character value generated when the alert is saved and stored in unsubscribe_token. Opening the link with the correct token sets every active alert of that email address in that store view to "Cancelled" and redirects to the home page with a confirmation message; a wrong or missing token shows "This unsubscribe link is invalid or has expired." and changes nothing. The link is rate limited like the other endpoints. Custom email templates created before version 1.1.0 need {{var unsubscribe_url}} added. Administrators can delete alerts from the grid or the detail page.

Admin dashboard

Price Drop Alerts > Dashboard shows total, active, sent and cancelled alert counts, alerts created and emails sent today, the average target price of active alerts, an "Alert Trends (7 Days)" chart (Chart.js 4.5.0 bundled with the module in view/adminhtml/web/js/lib/chart.umd.min.js, MIT license in LICENSE-chartjs.txt next to it; nothing is loaded from a CDN), a "Most Wanted Products" table (top products by active alert count) and "Recent Alert Activity".

Manage Alerts grid

Price Drop Alerts > Manage Alerts lists all alerts with the columns ID, Product Name, Customer Email, Target Price, Current Price (resolved live), Status and Created At; Product ID, Customer Name and Sent At are available from the Columns menu. It offers a keyword search (customer email, customer name, product name, or the product ID when the keyword is a number), filters (including a Status filter with "Active/Pending", "Sent/Notified" and "Cancelled"), the row actions View, Delete and Send Email, and the mass actions Delete and Send Email. The grid has no inline editor.

The alert detail page (View) shows subscription details, customer type (registered or guest), the product, the price when subscribed, the target price, the current price and a message stating whether the price has dropped or how far it is from the target. "Send Email" sends the notification for that alert immediately, regardless of the current price, and marks it "Sent/Notified". "Send Email" and "Delete" ask for confirmation in the standard admin modal. The "Current Price" grid column is calculated live from the product and cannot be sorted.

Cron jobs

Job Schedule Class
pricedropalert_price_alert 0 * * * * (hourly, group default; checks run at the configured Check Frequency) Panth\PriceDropAlert\Cron\PriceAlertNotification::execute

The module registers no console commands.

Developer Notes

Uninstallation

Disabling the module leaves the panth_price_alert table and the pricedropalert/* rows in core_config_data in place. Once the package is removed, setup:upgrade lets the declarative schema drop panth_price_alert because it is no longer declared, so export the table first if you need the subscriptions. Configuration values remain in core_config_data until deleted manually.

Support

Documentation

USER_GUIDE.md covers installation, verifying the module, each configuration group, the dashboard, managing and viewing alerts, how customers subscribe on Hyva and Luma, the cron job and product-save observer, email template customization and troubleshooting.

License

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

Changelog

See CHANGELOG.md.

Links


All versions of module-price-drop-alert with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0||~8.2.0||~8.3.0||~8.4.0
magento/framework Version ^103.0
magento/module-catalog Version ^104.0
magento/module-configurable-product Version ^100.4
magento/module-customer Version ^103.0
magento/module-email Version ^101.0
magento/module-config Version ^101.0
magento/module-store Version ^101.0
magento/module-backend Version ^102.0
magento/module-ui Version ^101.0
mage2kishan/module-core Version ^1.0
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-price-drop-alert contains the following files

Loading the files please wait ...