In the linked forum post, a working solution is given on that post that you can use.
Otherwise, what are you hoping to gain from the functions when you are not doing anything after you have called them?
Try at least doing what the code samples in the Wix API give you sample code for to check that it is working with just the samples.
Examples
An event when a shopping cart is created
Place this code in the events.js file of your site’s Backend section.
export function wixStores_onCartCreated(event) {
let total = event.totals.total;
}
/* Full event object:
* {
* "cartId": "6d158831-1510-44ae-a420-1483a4200852",
* "creationTime": "2019-02-27T12:03:22.079Z",
* "buyerInfo": {
* "id": "4kf9ka09-4e9f-a02d-972f-9a5844d9d9a2",
* "email": "john.doe@somedomain.com",
* "phone": "5555555555",
* "firstName": "John",
* "lastName": "Doe"
* },
* "weightUnit": "LB",
* "currency": {
* "currency": "USD",
* "symbol": "$"
* },
* "totals": {
* "subtotal": 130,
* "discount": 0,
* "total": 130,
* "quantity": 1
* }
* }
*/
Examples
An event when a shopping cart is abandoned
Place this code in the events.js file of your site’s Backend section.
export function wixStores_onCartAbandoned(event) {
let cartId = event.cartId;
let abandonTime = event.abandonTime;
let buyerEmail = event.buyerInfo.email;
let formattedTotal = event.totals.formattedTotal;
}
/* Full event object:
* {
* "cartId": "60349781-b3hf-4349-8c9e-09492063da9",
* "creationTime": "2019-01-23T11:28:22.328Z",
* "abandonTime": "2019-01-23T12:28:02.373Z",
* "buyerInfo": {
* "id": "6g004532-732d-829f-5kf9-f9rk42afpla04m",
* "identityType": "MEMBER",
* "email": "john.doe@somedomain.com",
* "firstName": "John",
* "lastName": "Doe",
* "phone": "5555555555"
* },
* "itemsCount": 1,
* "couponId": "329a10d8-73a4-4a78-a68f-93a590c83672",
* "totals": {
* "subtotal": 20,
* "total": 20,
* "formattedTotal": "$20.00"
* },
* "checkoutUrl": "https://mysite.com/checkout?appSectionParams=%7B%22a11y%22%3Afalse%2C%22cartId%22%3A%2260819781-b3cf-4179-9c9e-4958kd89a9%22%2C%22storeUrl%22%3A%22https%3A%2F%2Fmysite.com%22%2C%22isFastFlow%22%3Afalse%2C%22isPickupFlow%22%3Afalse%7D&linkSource=acMail"
* }
*/