Search...
onOrderStartDateChanged( )
An event that triggers when the start date of an order is changed.
Description
The onOrderStartDateChanged()
event handler runs when an order's start date is changed.
The received OrderStartDateChangedEvent
object contains information about the order whose start date changed.
Note: Backend events don't work when previewing your site.
Syntax
function onOrderStartDateChanged(event: OrderStartDateChangedEvent): void
onOrderStartDateChanged Parameters
NAME
TYPE
DESCRIPTION
event
OrderStartDateChangedEvent
Information about the order that has a changed start date and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event triggered when an order's start date is changed
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixPricingPlans_onOrderStartDateChanged(event) {6 const orderId = event.data.order._id;7 const eventId = event.metadata.id;8 const eventTime = event.metadata.eventTime;9}1011/* Full event object:12 * {13 * "metadata": {14 * "id":"d1ee0aa4-0c77-4481-a857-be913269ad6b",15 * "entityId":"13e8df07-b26d-43a1-8ce3-8206bce9e083",16 * "eventTime":"2022-07-27T09:48:51.178785Z",17 * "triggeredByAnonymizeRequest":false18 * },19 * "data": {20 * "order": {21 * "_id":"13e8df07-b26d-43a1-8ce3-8206bce9e083",22 * "planId":"6d7537c5-beac-44a3-bea3-b947ddc56b31",23 * "subscriptionId":"e7c79eb1-9bd9-4db4-be18-d02187b2aef8",24 * "wixPayOrderId":"ccc8dcd0-582d-48b4-a692-f69882108b03",25 * "buyer": {26 * "memberId":"0c9bca47-1f00-4b92-af1c-7852452e949a",27 * "contactId":"0c9bca47-1f00-4b92-af1c-7852452e949a"28 * },29 * "priceDetails": {30 * "subtotal":"14.99",31 * "discount":"0",32 * "total":"14.99",33 * "planPrice":"14.99",34 * "currency":"EUR",35 * "subscription": {36 * "cycleDuration": {37 * "count":1,38 * "unit":"MONTH"39 * },40 * "cycleCount":041 * }},42 * "pricing": {43 * "subscription": {44 * "cycleDuration": {45 * "count":1,46 * "unit":"MONTH"47 * },48 * "cycleCount":049 * },50 * "prices":51 * [{52 * "duration": {53 * "cycleFrom":154 * },55 * "price": {56 * "subtotal":"14.99",57 * "discount":"0",58 * "total":"14.99",59 * "currency":"EUR"60 * }61 * }]},62 * "type":"ONLINE",63 * "orderMethod":"UNKNOWN",64 * "status":"DRAFT",65 * "autoRenewCanceled":false,66 * "lastPaymentStatus":"UNPAID",67 * "startDate":"2022-08-15T10:00:00.000Z",68 * "pausePeriods":[],69 * "planName":"2x Week",70 * "planDescription":"",71 * "planPrice":"14.99",72 * "_createdDate":"2022-07-27T09:47:20.466Z",73 * "_updatedDate":"2022-07-27T09:48:51.150Z"74 * }75 * }76 * }77 */