- πΊπ¦Ukraine r_cheh
I found a custom solution: you need to override CustomerProfile plugin method - shouldRender, so I created CustomCustomerProfile plugin:
class CustomCustomerProfile extends CustomerProfile { /** * {@inheritDoc} */ protected function shouldRender(array $inline_form, FormStateInterface $form_state) { $render = parent::shouldRender($inline_form, $form_state); // Do not render inline form on shipping. if ($inline_form['#profile_scope'] === 'shipping') { return FALSE; } return $render; } }
return FALSE if you want to get inline form.
And then override plugin's class:function custom_module_commerce_inline_form_info_alter(array &$inline_form) { if (isset($inline_form['customer_profile'])) { $inline_form['customer_profile']['class'] = 'Drupal\custom_module\Plugin\Commerce\InlineForm\CustomCustomerProfile'; } }
- Status changed to Closed: works as designed
about 1 year ago 4:57am 8 April 2024 - π¦πΊAustralia jannakha Brisbane!
+1 for #5 comment!
thanks for the tip!