merch_display module - hooks created by the merch_display module
- These hooks allow modules to override and extend the default merch-item properties.
hook_merch_display_service_list
Parameters:
$automatic_only => bool, // if TRUE, only return stores that can create legal buttons/link with their default parameters.
(e.g. merch_display_link creates a valid link with minimal input; merch_display_html does not.)
Returns:
array(
'module_name' => t('Human Readable Name')
)
)
Description:
Return the machine and human readable names of a module that implements
merch_display hooks
hook_merch_display_node_fields
Parameters:
None
Returns:
array(
'module_name' => array() //per forms API
)
Description:
Return form elements for editing a merch-item node. Form element keys may be shared between multiple modules. This allows field contents to move between stores. e.g. shipping1 will be used by most 3rd-party stores, so if both PayPal and MerchMo implement that field the value of the field will transfer between the stores.
hook_merch_display_node_fields_validate
Parameters:
$form - array (per forms API)
&$form_state - array (per forms API)
Returns:
none
Description:
Custom validation for fields created by hook_merch_display_node_fields
hook_merch_display_node_fields_submit
Parameters:
$form - array (per forms API)
&$form_state - array (per forms API)
Returns:
none
Description:
Custom submission for fields create by hook_merch_display_node_fields
hook_merch_display_display
Parameters:
$node - fully-loaded node object
Returns:
string - sanitized HTML code
Description:
Generate the HTML code to display a single merch item
hook_merch_display_display_header
Parameters
none
Returns:
string - HTML code
Description:
Generate HTML to append to the start of merch widgets (i.e. to include necessary CSS or JS)
hook_merch_display_display_footer
Parameters
none
Returns:
string - HTML code
Description:
Generate HTML to append to the end of merch widgets (i.e. to include necessary CSS or JS)
hook_merch_display_settings_form
Parameters:
None
Returns:
$form => array(), // per forms API
Description:
Generate fields for manage/merch/settings form. The form is ultimately run through system_settings_form.
hook_merch_display_disable_node
Parameters:
$node - fully-loaded node object
Returns:
boolean - should this node be blocked from display?
Description:
Allows modules to flag specific nodes to not be displayed. (e.g. fan_club will block fan_club_only products from display to anonymous users)
hook_merch_display_callback
Parameters:
none
Returns:
string - HTML for display - implementations may also exit() to short-circuit the theme system (e.g. if they return JSON)
Description:
This hook should check whatever GET/POST variables have been passed in and determine if a user's purchase has been made sucessfully
hook_merch_display_payment_configured
Parameters:
none
Returns:
boolean - is this payment type configured?
Description:
Verify if a store is configured or not. This is used to determine if any store is configured yet.
hook_merch_display_get_order_validate
Parameters:
$node object => a fully-loaded merch_item node
Returns:
array - data to be serialized and added to the custom field for IPN purposes
Description:
This hook is invoked when a merch item is displayed. It generates an array of data that may be relevant when a purchase of that item is confirmed. This data will generally be passed in the clear, so it should not be sensitive.
hook_merch_display_order_validate
Parameters
$params array => per hook_merch_display_get_order_validate
Returns:
none
Description:
$params contains the results of all of the invocations of hook_merch_display_get_order_validate from when it was invoked before purchasing a product. This hook is invoked after the order is confirmed. Modules can use whatever data they set before to grant services, send out emails, etc. At minimum, it should contain a session id (s) and an email address (mail).