- Status changed to Fixed
12 months ago 4:30pm 5 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.
I'm using hook_form_alter to set the stock_level default value by current_level, but it seems like i can't get the current_stock_level value.
function custom_module_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if(isset($form) && $form['#form_id'] == 'commerce_product_default_edit_form') {
// dpm($form['variations']['widget']['entity']['field_stock_level']['widget'][0]['current level']['#markup']);
$form['variations']['widget']['entity']['field_stock_level']['widget'][0]['stock_level']['#default_value'] = @stock_level should be here;
}
}
I want to get the @stock_level under #arguments to set the stock_level default value
Fixed
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.