Miva Merchant 4 Module FAQs » Order Status (BROK_ORDERSTATUS)


I'm a module developer and I want to be able to update the order status by calling a function in your module. Is there a function for that?

(2004/10/01)here is now. The current version has two functions:



which can be MvDONE to update the order and order item status (and other information).

In the function UpdateOrderStatus:

The variables field1, field2, and field3 correspond with the "additional data fields" offered by the module (field1 and field2 are boolean, 1 or 0, field3 is a text field with maximum length of 40). Note1 corresponds to the "customer note", note2 with the "in-house" note. All 5 fields are option (but must be included in the function call w/ empty single quotes, '', if not used).

If the "override" option is set to 1 (or anything but 0 or '') all of the order's (or items) data will be overwritten by the imported values regardless of whether or not there is anything in the field. If it is set to 0 (or anything that evalutes to 0) then the data will be overwritten ONLY if the value in the field has a length.

If sendmail is empty, '', then no status notification email is sent. If it is set to -1, the email is sent only if hte status changed. If it is set to 1, the email is sent regardless of whether or not the status changed.

In the UpdateItemStatus function:

Similar to the UpdateOrderStatus function, the parameters are:

orderid: the order id "at issue"

lineid: the lineid of the item (corresponding to Merchant's "line_id" field)

newstatus: the new status assigned to the item

trackingtype: the "tracking type" assigned to the item

trackingnumber: the "tracking number" assigned to the item

override: if set to 1 then even if the other fields are set to 0 or null, they will be used as the new value. Otherwise
a null value for any field will cause that field to NOT be updated.

In either function, if StatusType is not found in the StatusTypes database it is added. Similarly, if the TrackingType is not found in the TrackingTypes database, it is added (albeit with no tracking url).

There are certain "conditions" that the module expects to be "set".
-it expects the Stores database to be open and pointing to the current store.
-it expects the variables g.Module_Library_DB to be defined and correctly point to the db.mv(c) file
-it expects the variable g.Module_Root to be defined
-in 4.x stores it expects the variable g.Module_Feature_CUS_DB to be set to the cus_db.db file

Last update: 2004-12-09 13:23
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category