MIVA Merchant Component Modules are the main means by which developers can influence the user interface of a MIVA Merchant store. Components that ship with MIVA Merchant 5 include the fonts, headers and footers, colors, product lists, search results, and pretty much everything else. At the core of things a MIVA Merchant 5 store user interface is made up of pages each of which is a template that is plain html code and tokens that represent output by components. That's basically it, so understanding how components work is essential.
Parameters:
Return Type:cclist
<MvFUNCTION NAME="ComponentModule_Tabs" PARAMETERS="module var,item,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function when Admin displays an Edit Page configuration screen for a page using an item based on the component.
Recommended return (if one desires to have a tab show): {toupper(l.module:code) $ ‘:’ $ l.module:name }
Default Return: NULL
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Validate" PARAMETERS="module var,item,field_prefix,fields var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function when one hits Update on the Edit Page configuration screen for a page using an item based on the component
Default Return: 1
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Update" PARAMETERS="module var,item,field_prefix,fields var,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function when one hits Update on configuration screen for a page using an item based on the component
Default Return: 1
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Content" PARAMETERS="module var,item,tab,load_fields,field_prefix,fields var,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Runs when Admin displays the Edit Page configuration screen for a page using an item based on the component.
Contains instructions on what Admin should display on Edit Page screen when user selects the tab belonging to this module.
Default Return: NULL
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Defaults" PARAMETERS="module var,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Admin calls this function when one assigns corresponding item to page.
Default Return: NULL
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Page_Assign" PARAMETERS="module var,page var,item,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Admin calls this function when one assigns corresponding item to page.
Default Return: 1
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Page_Unassign" PARAMETERS="module var,page var,item,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Admin calls this function when one assigns corresponding item to page.
Default Return: 1
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Initialize" PARAMETERS="module var,item,all_settings var,settings var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function when displaying a page using an item based on the component.
One uses this function to add, delete, or edit values in the settings and all_settings structure which contain the data for display on the page (e.g. product name, list of shipping methods).
MIVA Merchant will also sequently call this function from any component extending the first component, allowing them to, say, add to the product name, or alter the order of the shipping methods in the list.
Default Return: 1
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Render_Start" PARAMETERS="module var,item,all_settings var,settings var,param" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Called when template manager encounters item tag start (
The function provides MIVA Merchant instructions on what html source to place at that point in the page.
Default Return: NULL
Parameters:
Return Type:bool
<MvFUNCTION NAME="ComponentModule_Render_End" PARAMETERS="module var,item,all_settings var,settings var,param" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
Called when template manager encounters item tag end (
The function provides MIVA Merchant instructions on what html source to place at that point in the page.
Default Return: NULL
MIVA Merchant Component Modules are used in templates in basically two ways, either by calling the component using the MIVA Merchant template language ""mvt:item" tag, or by using a MIVA Template language item entity referencing a setting the component has set.
The tag to call an item looks like this: <mvt:item name="itemname" param="parameter"> and at the point where that tag is found in the template the ComponentModule_Render_Start function will be called in the component, and where the closing tag is displayed, which looks like this </mvt:item>, the ComponentModule_Render_End function is called. Note also that the _End function will be called right after the _Start function if you do this <mvt:item name="itemname" param="parameter" /> which is programmatically the same as doing this <mvt:item name="itemname" param="parameter"></mvt:item>.
An item entity reference looks like &mvt:itemname:settingname;. The settings would be set by adding them to the l.settings structure when MIVA Merchant makes the call to ComponentModule_Initialize which happens before any portion of the page is displayed. In fact you can have a component that does nothing but load a bunch of values into it's l.settings and it coudl be very useful to a template depending on the values it was making available. A good example of that can be found by looking at the breadcrumbs example module.
Note: the name of an item is not the same as the code of the component module. The MIVA Merchant administrator editing the templates can add new items to a page and when they do so they choose what name the item is given and what MIVA Merchant module will be called when that item name is used. In fact the same MIVA Merchant module could be assigned to three different item names and both could be referenced on the same page. When this happens the ComponentModule_Initialize function will be called twice. If you need or want to know what item name your module is being called as you can reference the l.item variable which is available in the appropriate functions. Note also that when your module is added as an item to a page the
Return Types are expressed in the document by the following codes:
For information and function requirements for the various MIVA Merchant 5 Module API Feature Codes see the following:
batchreport,
component,
component_prov,
currency,
custrt,
data_domain,
data_store,
export,
externalreq,
fields_cust,
fields_prod,
fulfill,
import,
log,
not_fields,
payment,
provision_store,
shipping,
storeselui,
storewizard,
system,
tax,
upload,
util,
wizard,
vis_affil,
vis_affilbe,
vis_category,
vis_categorybe,
vis_cust,
vis_custbe,
vis_domain,
vis_fulfill,
vis_log,
vis_order,
vis_payment,
vis_product,
vis_productbe,
vis_shipping,
vis_store,
vis_system,
vis_util,
vis_wizard
This document is copyright 2005-2006 4TheBest eCommerce Solutions and was last generated using Serade on 01/13/2006 23:04:54. It is permissible to place a copy of this document in it's current or altered form on your website as long as you leave the copyright notice along with the links to the websites referenced intact.