E-com notification

Dominic Boyer asked on July 31, 2020 20:08

Him working on the e-com notification and i have a custom table (customtablename) and I can't figure out how to pass the Order.ID in the where condition:

{% GlobalObjects.CustomTables["customtablename"].Items.Where("OrderID = '" + Order.ID + "'")[0]["FirstName"]

Order.ID in the where condition doesnt work, but if i only put {% Order.ID #%} in my html notification it return the good value...

someone have a solution for that ? thank you

Recent Answers


Brenden Kehren answered on August 1, 2020 18:50

Where are you using this macro? Need some context to be able to provide an answer

0 votesVote for this answer Mark as a Correct answer

Dominic Boyer answered on August 2, 2020 17:29

Hi Brenden, i use this macro in the e-commerce notification for a new E-commerce Order send to the Administrator. I have a custom table with some information(fields) and a orderID field. So in my notification, i need to get those value of that custom table "link" to the orderID. i can get the count of that custom table, but i cant figute out how to "put" the order.id in the where condition??? hope you understand, i speak french :) Thank you

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 2, 2020 22:10

Ok makes sense. The COM_Order table doesn't have an ID field so so that may be your issue. Try OrderID instead.

0 votesVote for this answer Mark as a Correct answer

Dominic Boyer answered on August 3, 2020 16:49

The Order.ID (insert macro) is the associated context specific object "OrderID of the Com_Order table" of that customer for that order. If i insert simply {% Order.ID %} its ok, but i can't in the where conditions:(

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 4, 2020 15:26

Have you ran the macro statement under System > Macros > Console and inserted a value where the macro for Order ID is? Does it work? Have you tried casting that INT to a String in the macro?

{% GlobalObjects.CustomTables["customtablename"].Items.Where("OrderID = '" + Order.ID.ToString() + "'")[0]["FirstName"]

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.