function commerce_product_pricing_ui_form_commerce_product_pricing_ui_add_pricing_rule_form_alter in Commerce Core 7
Implements hook_form_FORM_ID_alter().
The Product Pricing UI module instantiates the Rules Admin rule configuration add form at a particular path in the Commerce IA. It uses its own form ID to do so and alters the form here to select the necessary Rules event.
See also
rules_admin_add_reaction_rule()
File
- modules/
product_pricing/ commerce_product_pricing_ui.module, line 140 - Exposes a UI for managing product pricing rules and pre-calculation settings.
Code
function commerce_product_pricing_ui_form_commerce_product_pricing_ui_add_pricing_rule_form_alter(&$form, &$form_state) {
unset($form['settings']['help']);
$form['settings']['event']['#type'] = 'value';
$form['settings']['event']['#value'] = 'commerce_product_calculate_sell_price';
$form['submit']['#suffix'] = l(t('Cancel'), 'admin/commerce/config/product-pricing');
}