hook_product_form_alter(&$pform, &$node_form)
ecommerce-5--4/docs/developer/hooks/product.php, line 155
Alter the node form, only if it is a product.
The benefit of using this hook over a normal form alter are:
$pform A product form that is being built. This should be passed by reference.
$node_form The actual node form, prior to product alteration, that can be altered as well. $node_form['#node'] contains existing values of the node.
n/a
<?php
function hook_product_form_alter(&$pform, &$node_form) {
// Example from ec_useracc_product_form_alter()
if (product_feature_exists($node_form['#node'], 'ec_useracc') && product_feature_exists($node_form['#node'], 'ec_recurring')) {
$pform['useracc'] = array(
'#type' => 'fieldset',
'#title' => t('User account provision'),
'#weight' => -14,
'#collapsible' => false,
'#collapsed' => false,
);
$pform['useracc']['useracc_block'] = array(
'#type' => 'checkbox',
'#title' => t('Block the user\'s account when this product expires.'),
'#default_value' => ($disabled ? false : $node_form['#node']->useracc['block']),
'#description' => $desc
);
}
}
?>