Download Miva Merchant 9 Module API Reference Guide

Transcript
Miva Merchant 9 Module API Reference Guide
Return Value
1 on success
0 on error
ComponentModule_Defaults
Admin calls this function when you assign a corresponding item to a page. Examples of
implementations of ComponentModule_Defaults can be found in the modules/component directory.
Syntax
ComponentModule_Defaults( module var, settings var )
Parameters
module
The Module record of the current module
settings
A structure containing configuration options for the current component on the current
page
Return Value
Ignored
ComponentModule_Initialize
Miva Merchant calls this function when displaying a page using an item based on the component.
Use this function to add, delete, or edit values in the settings and all_settings structures that
contain the data for display on the page (e.g., product name, list of shipping methods). Miva
Merchant will call this function sequentially from any component extending the first component,
for example, to add to the product name, or alter the order of the shipping methods in the list.
Examples of implementations of ComponentModule_Initialize can be found in the modules/
component directory.
Syntax
ComponentModule_Initialize( module var, item, all_settings var, settings var )
Parameters
module
The Module record of the current module
item
The item record for the current item
all_settings
A structure containing all configuration options for all assigned components for the
current page
settings
A structure containing configuration options for the current component for the current
page
35