Default Price for Commerce Product As it is not possible to set a default price to products I was trying to achieve that by using rules. I'm checking "Before saving a commerce product" Event. Condition is "Data value is empty" and my Action would be "Set a data value", but all I get is an error because price isn't set. Anyone know why this is happening?As this is the first time I use rules, maybe I've done something wrong.
/**
 * Implements hook_field_widget_form_alter()
 */
function HOOK_field_widget_form_alter(&amp;$element, &amp;$form_state, $context) {
  if (isset($element['#field_name'])) {
    if ($element['#field_name'] == 'commerce_price') {
      if (empty($element['amount']['#default_value'])) {
        $element['amount']['#default_value'] = 0;
      }
    }
  }
}