MIVA Merchant 5 Module API Feature storewizard

What MIVA Says

Modules using the wizard feature provide the user with a simple step-by-step method to accomplish a common task in the administrative interface at the store level.

Required function: StoreWizardModule_Action [back]

Parameters:

  • module var

Return Type:bool

<MvFUNCTION NAME="StoreWizardModule_Action" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
    <MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>

What MIVA Says

Admin calls this function after the user completes all steps and after a successful return from StoreWizardModule_Privileges and StoreWizardModule_Validate.

Here one can place instructions about what to do with or in reaction to the input submitted by the user.

Default Return: 1

Required function: StoreWizardModule_Content [back]

Parameters:

  • module var
  • step
  • load_fields

Return Type:bool

<MvFUNCTION NAME="StoreWizardModule_Content" PARAMETERS="module var,step,load_fields" STANDARDOUTPUTLEVEL="">
    <MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>

What MIVA Says

Admin calls this function each time it displays a new screen.

It provides the instructions for the main portion of the wizard screen.

Default Return: 1

Required function: StoreWizardModule_Icon [back]

Parameters:

  • module var

Return Type:

<MvFUNCTION NAME="StoreWizardModule_Icon" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
</MvFUNCTION>

What MIVA Says

One uses this function to defines the path and name of the icon graphic that is displayed on the admin.mv front page, under the store section.

Default Return: NULL

Required function: StoreWizardModule_Logo [back]

Parameters:

  • module var

Return Type:

<MvFUNCTION NAME="StoreWizardModule_Logo" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
</MvFUNCTION>

What MIVA Says

Admin calls this function each time it displays a new screen.

One uses this function to define the path and name of the icon graphic that is displayed in the upper left corner of the wizard.

Default Return: NULL

Required function: StoreWizardModule_Privileges [back]

Parameters:

  • module var

Return Type:bool

<MvFUNCTION NAME="StoreWizardModule_Privileges" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
    <MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>

What MIVA Says

Admin calls this function when it expands the store portion of its left menu.

The module should return 1 if current user has privileges to run wizard. The module should return 0 if current user does not.

Default Return: 1

Required function: StoreWizardModule_Title [back]

Parameters:

  • module var
  • step

Return Type:

<MvFUNCTION NAME="StoreWizardModule_Title" PARAMETERS="module var,step" STANDARDOUTPUTLEVEL="">
</MvFUNCTION>

What MIVA Says

Admin calls this function each time it displays a new screen.

Default Return: NULL

Required function: StoreWizardModule_Validate [back]

Parameters:

  • module var

Return Type:bool

<MvFUNCTION NAME="StoreWizardModule_Validate" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
    <MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>

What MIVA Says

Admin calls this function after the user completes all steps

One should include instructions in the function to determine that any information the administrator submits is acceptable in format.

The function should return a 1 on success, 0 on failure.

Default Return: 1

Required function: StoreWizardModule_Validate_Step [back]

Parameters:

  • module var
  • step

Return Type:bool

<MvFUNCTION NAME="StoreWizardModule_Validate_Step" PARAMETERS="module var,step" STANDARDOUTPUTLEVEL="">
    <MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>

What MIVA Says

Admin calls this function each time it receives input from the submission of a wizard screen (one screen per step).

One should include instructions in the function to determine that any information the administrator submits is acceptable in format.

The function should return a 1 on success, 0 on failure. In the case of failure, Admin will not allow the wizard to move onto the next screen.

One can also set invalidity flags for use by the UI in a fashion similar to that of PaymentModule_Payment_Invalid.

Default Return: 1

Return Types [back]

Return Types are expressed in the document by the following codes:

  • string: A string return type is any string you wish though normally it is a string that has a specific intent such as the formatted version of a decimal number as you might use in a currency module.
  • cslist: This is a comma separated list values. Most commonly used to return a list of codes for fields.
  • cclist: This is a comma separated list of colon separated values. Most commonly used as a return from tab functions so that you might have a value like "NVALS:Normal Values,SPECVALS:Special Values,OVALS:Other Values" and the system would be treating each comma separated pair as a tab and using the value on the right of the colon as the label for the tab and the value on the left of the colon as the code for the tab.
  • bool: A boolean "true/false" return value, normally a "1" represents a true value and a "0" represents false. Because of the way the MIVA script language treats strings and numbers any string other than a space, and any number other than a 0 will be treated as a true return value whereas a false value can be expressed by a null value like "" or an expression that evaluates to null or zero like "{ 1 - 1 }" or the absence of the "VALUE" attribute entirely.
  • boolinv: An inverted boolean "true/false" return value. This is when the value returned is a boolean value just like the type "bool" but that the normal default return is a false rather than a true value and that you only return true if some special case is true. In the MIVA Merchant API Most functions that are boolean expect a return of true unless something has gone wrong or some special condition occurs, but in this case it is "normal" to return a false value and you only return a true value if something unusual happens. A specific example would be the TaxModule_Order_Invalid function which only returns a true value if one of the fields is invalid.
  • tristate: Acts like a boolean except that a negative value, usually -1 by convention, indicates an unusual but non error state. In most cases this will be used to cause the normal operations to not be completed without causing an error to be output in order to interrupt something that the system was about to do. This is used for example in system extension interrupts to stop a normal action like adding a product to the basket from taking place so the module can take on the role of adding the item to the basket itself, or preventing it from happening without causing the system to throw the normal errors.
  • acount: This is a numeric value that represents a count of the size of an array passed back by reference. A null or 0 return value acts the same as for a bool return type, meaning nothing happens, but a value of 1 indicates only one array index point exists whereas a return of 3 indicates 3 array index points returned. This is used for example in the shipping and payment method functions that have a method parameter passed in by reference and the return indicates the size of the method array being set in the l.method variable.