Module:Magenx_ProductAlertGraphQl · no settings of its own
Magento’s stock Product Alerts feature emails customers when a product’s price drops or it comes back in stock. Stock Magento offers it only to its own theme. This module brings it to the headless storefront: Notify me buttons on the product page, and a list of subscriptions in the customer account.
Emails are still sent by Magento’s own product alert cron. Nothing about the emails changes.
In the account, each alert shows Active until the email is sent, then Sent with the date. Price alerts also show the price at subscription and the current price.
productAlertStatus gives the subscription state for one product, for the product page buttons. Only select product_alerts on the subscribe output when you need the whole list: it loads every subscribed product.
Remove a price-drop or back-in-stock alert subscription for the logged-in customer.
Argument
Type
Description
input
ProductAlertSubscriptionInput!
The product and alert type to unsubscribe from.
Fields added to Magento types
Field
Type
Description
Customer.product_alerts
ProductAlerts
The logged-in customer's price and stock product alert subscriptions.
StoreConfig.product_alert_allow_price
Boolean
Whether price-drop alerts are enabled for the store (Catalog > Product Alerts).
StoreConfig.product_alert_allow_stock
Boolean
Whether back-in-stock alerts are enabled for the store (Catalog > Product Alerts).
Types
type ProductAlertStatusOutput - The logged-in customer's alert subscriptions for one product.
Field
Type
Description
product_sku
String!
The SKU that was checked.
is_price_alert_subscribed
Boolean!
Whether the customer is subscribed to a price-drop alert for the product in the current website.
is_stock_alert_subscribed
Boolean!
Whether the customer is subscribed to a back-in-stock alert for the product in the current website.
input ProductAlertSubscriptionInput - Identifies the product and the kind of alert.
Field
Type
Description
product_sku
String!
The SKU of the product the alert is for.
alert_type
ProductAlertType!
Whether the alert is for price drops or back-in-stock notifications.
enum ProductAlertType - The kind of product alert.
Value
Description
PRICE
STOCK
type ProductAlertSubscriptionOutput - The result of a product alert subscription change.
Field
Type
Description
product_sku
String!
The SKU of the product the change applied to.
alert_type
ProductAlertType!
The kind of alert that was changed.
is_subscribed
Boolean!
Whether the customer is now subscribed to this alert. Cheap; prefer it over product_alerts when only this product's state is needed.
product_alerts
ProductAlerts!
The logged-in customer's full product alert subscription list after the change. Loads every subscribed product, so only select it when the whole list is needed.
type ProductAlerts - A customer's price-drop and back-in-stock product alert subscriptions.
Field
Type
Description
price_alerts
[ProductAlertEntry!]!
Active price-drop alert subscriptions.
stock_alerts
[ProductAlertEntry!]!
Active back-in-stock alert subscriptions.
type ProductAlertEntry - A single product alert subscription.
Field
Type
Description
id
Int!
The unique ID of the alert subscription.
alert_type
ProductAlertType!
Whether this is a price-drop or back-in-stock alert.
product
ProductInterface
The product the alert is for. Null if the product is no longer available.
price
Float
For price alerts, the product price recorded when the subscription was created.
current_price
Float
For price alerts, the product's current price. Null for stock alerts or if the product is no longer available.
price_diff
Float
For price alerts, the recorded price minus the current price. Positive when the price has dropped since subscribing. Null for stock alerts or if the product is no longer available.
add_date
String!
The date the subscription was created.
status
ProductAlertStatus!
Whether the alert notification has already been sent to the customer.
status_changed_at
String
The date the alert notification was last sent, i.e. when the status changed to SENT. Null while the alert is still ACTIVE.
enum ProductAlertStatus - The state of a product alert subscription.