Scot Ranney • September 24, 2025
The miva merchant notes table can be manipulated through smt. Adding records is probably the only reasonable use in smt.
General Notes: Do not read at your own risk.
Admin User ID: Track admin users by using the user_id variable. user_id is g.user:id which is the current admin user id. This is only available from admin.mvc and will not work in merchant.mvc screens.
user_id
g.user:id
Filling in the variables: Depending on what you are doing order id and customer id and perhaps other variables will be specific to the report, batch, email, and other templates you are working in.
Required Variables Info: It appears that order_id is the only required variable.
order_id
Email templates: If you don't want the note to be written from an email template during a normal merchant.mvc screen sale wrap it in: <mvt:if expr="g.user:id GT 0">...</mvt:if>
<mvt:if expr="g.user:id GT 0">...</mvt:if>
Code Example:
Fill out the variables and then write the note.
Tip: Try using mvt:capture for the notetext variable unless it's super simple text.
mvt:capture
<mvt:comment> # # write to the native miva merchant notes system # </mvt:comment> <mvt:assign name="l.note:cust_id" value="''" /> <mvt:assign name="l.note:account_id" value="''" /> <mvt:assign name="l.note:order_id" value="g.order:id" /> <mvt:assign name="l.note:user_id" value="g.user:id" /> <mvt:assign name="l.note:notetext" value="'This is some note text. Page code is: ' $ l.settings:page:code $ ', time t: ' $ s.dyn_time_t" /> <mvt:assign name="l.note:dtstamp" value="s.dyn_time_t" /> <mvt:assign name="l.note:cust_login" value="''" /> <mvt:assign name="l.note:business_title" value="''" /> <mvt:do file="g.Module_Library_DB" name="l.ok" value="Note_Insert_LowLevel( l.note )" />
mvkb_notes mvkb_smt